-
Notifications
You must be signed in to change notification settings - Fork 4
New math intrinsics #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: riscv
Are you sure you want to change the base?
Conversation
__ bind(Lnan1); | ||
if (double_precision) { | ||
__ fmind(F10_RET, F10_ARG0, F10_ARG0); | ||
} else { | ||
__ fmins(F10_RET, F10_ARG0, F10_ARG0); | ||
} | ||
__ mv(R2_SP, R21_sender_SP); | ||
__ ret(); | ||
|
||
__ bind(Lnan2); | ||
if (double_precision) { | ||
__ fmind(F10_RET, F11_ARG1, F11_ARG1); | ||
} else { | ||
__ fmins(F10_RET, F11_ARG1, F11_ARG1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.oracle.com/javase/7/docs/api/java/lang/Math.html#min(double,%20double)
-- If either value is NaN, then the result is NaN
Are you trying to canonicalize the value?
Spec doesn't impose which NaN should it be, I think it safe to return any (the NaN argument for example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced fmind
/fmins
with fmvd
/fmvs
.
do_intrinsic(_min, java_lang_Math, min_name, int2_int_signature, F_S) \ | ||
do_intrinsic(_max, java_lang_Math, max_name, int2_int_signature, F_S) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to preserve original identifiers even if we would have min
and minL
. Various shared code could depend on names (JIT compilers for example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored _min
/_max
and abs
symbols.
case vmIntrinsics::_dabs : return java_lang_math_absD ; | ||
#else | ||
case vmIntrinsics::_dabs : return java_lang_math_abs ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, let's stick to original identifiers
No description provided.