[libc-commits] [PATCH] D127097: [libc][math] Improved FBits performance and readablity.
Siva Chandra via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon Jun 6 23:24:06 PDT 2022
sivachandra accepted this revision.
sivachandra added a comment.
This revision is now accepted and ready to land.
As with the other patch, while this is accepted, please hold-off on submitting until further notice here.
================
Comment at: libc/src/__support/FPUtil/FloatProperties.h:36
+ static constexpr BitsType EXP_MANT_MASK = MANTISSA_MASK + EXPONENT_MASK;
+ static_assert(EXP_MANT_MASK == ~SIGN_MASK, "Masks problem");
+
----------------
We should use a more formal tone. So, may be: "Exponent and mantissa masks are not as expected."
================
Comment at: libc/src/__support/FPUtil/FloatProperties.h:49
- static constexpr uint32_t BIT_WIDTH = sizeof(BitsType) << 3;
+ static constexpr uint32_t BIT_WIDTH = sizeof(BitsType) * 8;
----------------
Why is multiplication by 8 preferred over shift by 3?
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