Skip to content
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

Support java behaviour w.r.t fmin/fmax/dmin/dmax #20185

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

matthewhall2
Copy link

@matthewhall2 matthewhall2 commented Sep 18, 2024

  • Enables inlining of f/d min ax functions

  • Implements Java standard found while testing

    • +0 compares as strictly greater than -0
    • if the first arg is a NaN, returns the corresponding quiet NaN, same for if only the second arg is a NaN
  • Depends on OMR PR:Support IEEE-754 w.r.t fmin/fmax/dmin/dmax eclipse/omr#7464

    • Differs from this in that it returns the first NaN argument unchanged if present (the omr pr implements the IEEE-754 standard which returns the corresponding quiet NaN)

https://hyc-runtimes-jenkins.swg-devops.com/job/jvm.29.personal/34226/

Add functional tests for `Math.max` and `Math.min`:
- to test specific float and double corner cases
- test with NaN, +0, & -0, values to confirm respective omr changes
- test all possible execution paths

Signed-off-by: Sarwat Shaheen <[email protected]>
- Adds java_lang_Math_max/min_float/double as a recognized method
- Adds a SupportsInlineMath_MaxMin_FD flag to the Z code generator
- Flag is only set in Z if the TR_disableInlineMath_MaxMin_FD environment variable is not set
- If the flag is set, call nodes are transformed to a functionally equivalent tree that uses fmax/fmin/dmax/dmin

Signed-off-by: Sarwat Shaheen <[email protected]>
- separate evaluators for J9 vs omr to return the NaN unchanged
- compare int/long bits instead of float bits to check behaviour for +-0 and NaNs

Signed-off-by: Matthew Hall <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants