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

Clang Picolibc FP test failures on RISC-V #838

Open
stephanosio opened this issue Nov 24, 2024 · 4 comments
Open

Clang Picolibc FP test failures on RISC-V #838

stephanosio opened this issue Nov 24, 2024 · 4 comments
Labels
area: Clang Issues related to Clang area: LLVM Issues related to LLVM area: Picolibc Issues related to Picolibc known issue

Comments

@stephanosio
Copy link
Member

stephanosio commented Nov 24, 2024

Some Picolibc floating-point tests fail on RV32 and RV64 architectures with hardware FPU (F and D extensions)

For instance, on rv32imafc_zicsr_zifencei:

122/196 picolibc / rounding-mode                           FAIL             1.42s   exit status 4
127/196 picolibc / math_errhandling                        FAIL             1.53s   (exit status 241 or signal 113 SIGinvalid)
194/196 picolibc / test-fma                                FAIL             1.63s   exit status 1
127/196 picolibc / math_errhandling                        FAIL             1.53s   (exit status 241 or signal 113 SIGinvalid)
...
Double tests:
Exceptions claim to be supported, but 0/0 doesn't raise FE_INVALID
Exceptions claim to be supported, but 1/0 doesn't raise FE_DIVBYZERO
Exceptions claim to be supported, but 5e-324*5e-324 doesn't raise FE_UNDERFLOW
Exceptions claim to be supported, but 1.7e+308*1.7e+308 doesn't raise FE_OVERFLOW
122/196 picolibc / rounding-mode                           FAIL             1.42s   exit status 4
...
testing up/down
ERROR up/down: 0 is not > 0
testing up/toward
ERROR up/toward: 0 is not > 0
testing -up/-down
ERROR -up/-down: 0 is not > 0
testing -toward/-down
ERROR -toward/-down: 0 is not > 0
194/196 picolibc / test-fma                                FAIL             1.63s   exit status 1
...
float
double
27: round FE_UPWARD -0x1.0000000000001p-1 * 0x0.0000000000001p-1022 + 0x0p+0 -> got -0x0.0000000000001p-1022 want 0x0p+0
34: round FE_UPWARD 0x0.0000000000001p-1022 * 0x0.0000000000001p-1022 + 0x0p+0 -> got 0x0p+0 want 0x0.0000000000001p-1022
35: round FE_UPWARD 0x0.8p-1022 * 0x0.0000000000001p-1022 + 0x0p+0 -> got 0x0p+0 want 0x0.0000000000001p-1022
36: round FE_UPWARD 0x1.0000000000001p-1022 * 0x0.0000000000001p-1022 + 0x0p+0 -> got 0x0p+0 want 0x0.0000000000001p-1022
37: round FE_UPWARD 0x1.0000000000001p-1021 * 0x0.0000000000001p-1022 + 0x0p+0 -> got 0x0p+0 want 0x0.0000000000001p-1022
...

Full test log: https://gist.githubusercontent.com/stephanosio/1934c4156f0e231651690e118ccf6207/raw/4b4463912991676e1d7e9ae2d6c71405b32a3b89/testlog.txt

$ qemu-system-riscv32 --version
QEMU emulator version 9.1.2
@stephanosio stephanosio added bug area: Picolibc Issues related to Picolibc area: Clang Issues related to Clang labels Nov 24, 2024
@keith-packard
Copy link
Collaborator

Welcome to clang's buggy FP support?

@keith-packard
Copy link
Collaborator

I assume you're using llvm's compiler-rt runtime library? That's where the bugs lie -- its soft FP code doesn't support exceptions or rounding modes, unlike libgcc.

@stephanosio
Copy link
Member Author

I assume you're using llvm's compiler-rt runtime library?

Yes, from LLVM 19.1.1.

its soft FP code doesn't support exceptions or rounding modes, unlike libgcc.

That is unfortunate. I will mark this as a known issue and disable the affected tests on the relevant targets for now.

@stephanosio stephanosio added the area: LLVM Issues related to LLVM label Nov 24, 2024
stephanosio added a commit to stephanosio/zephyr-sdk-ng that referenced this issue Nov 24, 2024
LLVM compiler-rt does not currently support exceptions and rounding
modes for computations on the types that are emulated in software.

For more details, refer to the GitHub issue zephyrproject-rtos#838.

Revert this commit when this issue is fixed in the compiler-rt.

Signed-off-by: Stephanos Ioannidis <[email protected]>
stephanosio added a commit to stephanosio/zephyr-sdk-ng that referenced this issue Nov 24, 2024
LLVM compiler-rt does not currently support exceptions and rounding
modes for computations on the types that are emulated in software.

For more details, refer to the GitHub issue zephyrproject-rtos#838.

Revert this commit when this issue is fixed in the compiler-rt.

Signed-off-by: Stephanos Ioannidis <[email protected]>
@stephanosio stephanosio changed the title Clang Picolibc FP test failures on RV32F Clang Picolibc FP test failures on RISC-V Nov 24, 2024
@keith-packard
Copy link
Collaborator

I'm downloading the new toolchain and will disable the tests once I've gotten that working. Looks like there are some minor issues with the llvm riscv toolchain which is making that a bit harder than anticipated.

stephanosio added a commit to stephanosio/zephyr-sdk-ng that referenced this issue Nov 25, 2024
LLVM compiler-rt does not currently support exceptions and rounding
modes for computations on the types that are emulated in software.

For more details, refer to the GitHub issue zephyrproject-rtos#838.

Revert this commit when this issue is fixed in the compiler-rt.

Signed-off-by: Stephanos Ioannidis <[email protected]>
stephanosio added a commit to stephanosio/zephyr-sdk-ng that referenced this issue Nov 25, 2024
LLVM compiler-rt does not currently support exceptions and rounding
modes for computations on the types that are emulated in software.

For more details, refer to the GitHub issue zephyrproject-rtos#838.

Revert this commit when this issue is fixed in the compiler-rt.

Signed-off-by: Stephanos Ioannidis <[email protected]>
stephanosio added a commit to stephanosio/zephyr-sdk-ng that referenced this issue Nov 25, 2024
LLVM compiler-rt does not currently support exceptions and rounding
modes for computations on the types that are emulated in software.

For more details, refer to the GitHub issue zephyrproject-rtos#838.

Revert this commit when this issue is fixed in the compiler-rt.

Signed-off-by: Stephanos Ioannidis <[email protected]>
stephanosio added a commit to stephanosio/zephyr-sdk-ng that referenced this issue Nov 25, 2024
LLVM compiler-rt does not currently support exceptions and rounding
modes for computations on the types that are emulated in software.

For more details, refer to the GitHub issue zephyrproject-rtos#838.

Revert this commit when this issue is fixed in the compiler-rt.

Signed-off-by: Stephanos Ioannidis <[email protected]>
stephanosio added a commit to stephanosio/zephyr-sdk-ng that referenced this issue Nov 25, 2024
LLVM compiler-rt does not currently support exceptions and rounding
modes for computations on the types that are emulated in software.

For more details, refer to the GitHub issue zephyrproject-rtos#838.

Revert this commit when this issue is fixed in the compiler-rt.

Signed-off-by: Stephanos Ioannidis <[email protected]>
stephanosio added a commit to stephanosio/zephyr-sdk-ng that referenced this issue Nov 25, 2024
LLVM compiler-rt does not currently support exceptions and rounding
modes for computations on the types that are emulated in software.

For more details, refer to the GitHub issue zephyrproject-rtos#838.

Revert this commit when this issue is fixed in the compiler-rt.

Signed-off-by: Stephanos Ioannidis <[email protected]>
stephanosio added a commit to stephanosio/zephyr-sdk-ng that referenced this issue Nov 25, 2024
LLVM compiler-rt does not currently support exceptions and rounding
modes for computations on the types that are emulated in software.

For more details, refer to the GitHub issue zephyrproject-rtos#838.

Revert this commit when this issue is fixed in the compiler-rt.

Signed-off-by: Stephanos Ioannidis <[email protected]>
stephanosio added a commit that referenced this issue Nov 26, 2024
LLVM compiler-rt does not currently support exceptions and rounding
modes for computations on the types that are emulated in software.

For more details, refer to the GitHub issue #838.

Revert this commit when this issue is fixed in the compiler-rt.

Signed-off-by: Stephanos Ioannidis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Clang Issues related to Clang area: LLVM Issues related to LLVM area: Picolibc Issues related to Picolibc known issue
Projects
None yet
Development

No branches or pull requests

2 participants