[libc-commits] [libc] [libc][NFC] Make EXP_MANT_MASK an implementation detail (PR #75810)
Guillaume Chatelet via libc-commits
libc-commits at lists.llvm.org
Mon Dec 18 08:21:58 PST 2023
================
@@ -162,13 +165,20 @@ struct FPProperties : public internal::FPBaseProperties<fp_type> {
FRACTION_LEN + 1;
LIBC_INLINE_VAR static constexpr StorageType FRACTION_MASK =
mask_trailing_ones<StorageType, FRACTION_LEN>();
- LIBC_INLINE_VAR static constexpr StorageType EXP_MANT_MASK =
- EXP_MASK | SIG_MASK;
// If a number x is a NAN, then it is a quiet NAN if:
// QuietNaNMask & bits(x) != 0
// Else, it is a signalling NAN.
static constexpr StorageType QUIET_NAN_MASK = QNAN_MASK;
+
+ //---------------------------------------------------------------------------
+ // Modifiers
+ //---------------------------------------------------------------------------
+
+ // Returns the absolute value of 'value'.
+ LIBC_INLINE static constexpr StorageType abs(StorageType value) {
----------------
gchatelet wrote:
Fair enough, I wanted to unify `FloatProperties` and `FPBits` at some point but it's probably better to do this afterwards. It is clear that `FPBits` is a better place for `abs` right now. Thx for the suggestion.
https://github.com/llvm/llvm-project/pull/75810
More information about the libc-commits
mailing list