[libc-commits] [PATCH] D134917: [libc] Resolve NaN/implementation-defined behavior of floating-point tests
Tue Ly via Phabricator via libc-commits
libc-commits at lists.llvm.org
Fri Sep 30 14:46:31 PDT 2022
lntue added inline comments.
Comment at: libc/src/__support/FPUtil/FPBits.h:182
FPBits<T> bits = inf();
+ bits.set_mantissa(QUIET_BIT | v);
> this would make it impossible to generate a signaling NaN with this function, since it would always set the quiet bit. Currently the expectation is that the client code will pass a mantissa with the quiet bit set iff the resulting NaN should be quiet.
It's probably better to add another method called `build_quiet_nan` and leave `build_nan` to create signaling nan if needed? Most of `build_nan` usage in `src/math` folder then can simply be replaced with `build_quiet_nan`.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the libc-commits