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

Improve fmin/fmax #51

Merged
merged 1 commit into from
Sep 11, 2022
Merged

Improve fmin/fmax #51

merged 1 commit into from
Sep 11, 2022

Conversation

2011eric
Copy link
Collaborator

@2011eric 2011eric commented Sep 8, 2022

Passed 2 more tests in riscv-arch-test.
Support of fmin and fmax is complete.

riscv_private.h Outdated Show resolved Hide resolved
riscv_private.h Outdated Show resolved Hide resolved
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase the latest "master" branch which checks C/C++ source files for consistent style.

Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should explain the IEEE754-201x semantics of fmin/fmax in git commit messages.

@jserv jserv changed the title Add support of FMIN/MAX Improve fmin/fmax Sep 8, 2022
@2011eric 2011eric force-pushed the master branch 3 times, most recently from 8476893 to 686d398 Compare September 9, 2022 00:24
@2011eric
Copy link
Collaborator Author

2011eric commented Sep 9, 2022

I think I can pack the code into a function, since the code of fmin and the one of fmax is similar.

@jserv
Copy link
Contributor

jserv commented Sep 9, 2022

I think I can pack the code into a function, since the code of fmin and the one of fmax is similar.

You can introduce some macros as what SoftFP does.

@jserv
Copy link
Contributor

jserv commented Sep 10, 2022

Fix the conflicts caused by recent directory structure changes.

src/riscv_private.h Outdated Show resolved Hide resolved
Passed 2 more test in riscv-arch-test.
Supports of fmin and fmax is complete.

In IEEE 754-201x, fmin(x,y)/fmax(x,y) is defined as:
    - min(x,y)/max(x,y) if both x and y are numbers
    - if one is NAN and another is a number, return the number
    - if both are NAN, return NAN

This operation raises invalid_operation when receiving SNAN.
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