[libc-commits] [PATCH] D127097: [libc][math] Improved FBits performance and readablity.
Tue Ly via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon Jun 6 06:56:40 PDT 2022
lntue added inline comments.
================
Comment at: libc/src/__support/FPUtil/FPBits.h:129
bool is_inf() const {
- return get_mantissa() == 0 && get_unbiased_exponent() == MAX_EXPONENT;
+ return (bits & (~(FloatProp::SIGN_MASK))) == FloatProp::EXPONENT_MASK;
}
----------------
I forget whether for 80-bit long double, bits 80-127 might contain garbage or not. Would you mind double checking that? If that's the case, you might simply add `EXPONENT_MANTISSA_MASK` (or abbreviated to `EXP_MANT_MASK` is up to you) and use that instead of `~SIGN_MASK`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127097/new/
https://reviews.llvm.org/D127097
More information about the libc-commits
mailing list