[libc-commits] [libc] [libc][math][c23] Implement canonicalize functions (PR #85940)

Joshua Cranmer via libc-commits libc-commits at lists.llvm.org
Wed Mar 20 08:26:35 PDT 2024


jcranmer-intel 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.

https://github.com/llvm/llvm-project/pull/85940


More information about the libc-commits mailing list