[libc-commits] [libc] [libc][math][c23] Implement canonicalize functions (PR #85940)
via libc-commits
libc-commits at lists.llvm.org
Wed Mar 20 08:51:47 PDT 2024
lntue wrote:
> Some drive-by comments:
>
> * canonicalize(SNAN) needs to raise the INVALID floating point exception
> * it's a should, not a must requirement, but the corresponding quiet NaN should have the same payload as the signaling NaN (i.e., only the bit indicating whether or not the NaN is an sNaN should change)
> * x86 and PPC long double types have non-canonical values that need to be handled. I don't know enough about the PPC long double type to give guidance here, but the x86 long double type considers all non-canonical values to be invalid, and will generally refuse to operate on them in the first place--glibc in this case returns 1 and does nothing.
Thanks @jcranmer-intel ! I totally forgot to include error handling section F.10.8.7 (N3096) of canonicalize functions to the issue's description.
About the PPC long double, we will skip it for now and focusing on x86-64, arm, and riscv, which we have the hardware to test directly. Hopefully, someone with PPC knowledge and hardware could help us to fill it in later.
https://github.com/llvm/llvm-project/pull/85940
More information about the libc-commits
mailing list