Open overmighty opened 1 month ago
@llvm/issue-subscribers-libc
Author: OverMighty (overmighty)
Added libc
label as this impacts development of LLVM libc math functions.
Isn't it undefined to change the fpenv without setting #pragma STDC FENV_ACCESS?
https://godbolt.org/z/dchq7rxe7
C code:
Output with libgcc:
Output with compiler-rt:
Relevant compiler-rt source:
https://github.com/llvm/llvm-project/blob/046a17717d9c5b5385ecd914621b48bdd91524d0/compiler-rt/lib/builtins/truncsfhf2.c#L15-L17
https://github.com/llvm/llvm-project/blob/046a17717d9c5b5385ecd914621b48bdd91524d0/compiler-rt/lib/builtins/fp_trunc_impl.inc#L9-L12
cc @lntue