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

riscv64: fix fenv handling #5

Conversation

liushuyu
Copy link
Contributor

This pull request fixes several issues with fenv handling and should close aosp-riscv/working-group#39.

Issues with fesetenv

There was a typo in fesetenv that prevented the fcsr to be set correctly. The typo has been corrected.

Issues with fesetexcept

fesetexcept should return -1 when the architecture does not support masking FPU exception vectors.

Issues with tests/fenv_test.cpp

Since RISC-V is a RISC architecture, it should be tested like other RISC architecture: fesetexcept should return -1 (indicates the platforms does not support it), and fegetexcept should always return 0.

@liushuyu liushuyu requested a review from unicornx March 10, 2022 02:37
tests/fenv_test.cpp Outdated Show resolved Hide resolved
libm/riscv64/fenv.c Outdated Show resolved Hide resolved
@unicornx
Copy link
Contributor

From your changes and test result, I think for this issue, we'd better catch up with RVI upstream for fenv related files.
Please correct as per my comments and keep in line with the RVI upstream. Then I will merge this PR. Any question please let me know.

@liushuyu
Copy link
Contributor Author

Addressed comments.

tests/fenv_test: add RISC-V to the RISC test group, so that fesetexcept
will be tested according to RISC architectures
@unicornx unicornx self-assigned this Mar 11, 2022
@unicornx unicornx merged commit f256977 into aosp-riscv:riscv64-android-12.0.0_dev Mar 11, 2022
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.

bionic test: fenv
2 participants