@@ -90,8 +90,11 @@ struct FPProperties : public internal::FPBaseProperties<fp_type> {
90
90
using UP::EXP_BITS;
91
91
using UP::SIG_BITS;
92
92
using UP::TOTAL_BITS;
93
+
94
+ public:
93
95
using UIntType = typename UP::UIntType;
94
96
97
+ private:
95
98
LIBC_INLINE_VAR static constexpr int STORAGE_BITS =
96
99
sizeof (UIntType) * CHAR_BIT;
97
100
static_assert (STORAGE_BITS >= TOTAL_BITS);
@@ -116,14 +119,16 @@ struct FPProperties : public internal::FPBaseProperties<fp_type> {
116
119
mask_trailing_ones<UIntType, SIG_BITS>() << SIG_MASK_SHIFT;
117
120
LIBC_INLINE_VAR static constexpr UIntType EXP_MASK =
118
121
mask_trailing_ones<UIntType, EXP_BITS>() << EXP_MASK_SHIFT;
119
- // Trailing underscore on SIGN_MASK_ is temporary - it will be removed
120
- // once we can replace the public part below with the private one.
121
- LIBC_INLINE_VAR static constexpr UIntType SIGN_MASK_ =
122
+
123
+ public:
124
+ LIBC_INLINE_VAR static constexpr UIntType SIGN_MASK =
122
125
mask_trailing_ones<UIntType, SIGN_BITS>() << SIGN_MASK_SHIFT;
126
+
127
+ private:
123
128
LIBC_INLINE_VAR static constexpr UIntType FP_MASK =
124
129
mask_trailing_ones<UIntType, TOTAL_BITS>();
125
- static_assert ((SIG_MASK & EXP_MASK & SIGN_MASK_ ) == 0 , " masks disjoint" );
126
- static_assert ((SIG_MASK | EXP_MASK | SIGN_MASK_ ) == FP_MASK, " masks cover" );
130
+ static_assert ((SIG_MASK & EXP_MASK & SIGN_MASK ) == 0 , " masks disjoint" );
131
+ static_assert ((SIG_MASK | EXP_MASK | SIGN_MASK ) == FP_MASK, " masks cover" );
127
132
128
133
LIBC_INLINE static constexpr UIntType bit_at (int position) {
129
134
return UIntType (1 ) << position;
@@ -145,25 +150,21 @@ struct FPProperties : public internal::FPBaseProperties<fp_type> {
145
150
: SIG_BITS;
146
151
147
152
public:
148
- // Public facing API to keep the change local to this file.
149
- using BitsType = UIntType;
150
-
151
153
LIBC_INLINE_VAR static constexpr uint32_t BIT_WIDTH = TOTAL_BITS;
152
154
LIBC_INLINE_VAR static constexpr uint32_t MANTISSA_WIDTH = FRACTION_BITS;
153
155
LIBC_INLINE_VAR static constexpr uint32_t MANTISSA_PRECISION =
154
156
MANTISSA_WIDTH + 1 ;
155
- LIBC_INLINE_VAR static constexpr BitsType MANTISSA_MASK =
157
+ LIBC_INLINE_VAR static constexpr UIntType MANTISSA_MASK =
156
158
mask_trailing_ones<UIntType, MANTISSA_WIDTH>();
157
159
LIBC_INLINE_VAR static constexpr uint32_t EXPONENT_WIDTH = EXP_BITS;
158
160
LIBC_INLINE_VAR static constexpr int32_t EXPONENT_BIAS = EXP_BIAS;
159
- LIBC_INLINE_VAR static constexpr BitsType SIGN_MASK = SIGN_MASK_;
160
- LIBC_INLINE_VAR static constexpr BitsType EXPONENT_MASK = EXP_MASK;
161
- LIBC_INLINE_VAR static constexpr BitsType EXP_MANT_MASK = EXP_MASK | SIG_MASK;
161
+ LIBC_INLINE_VAR static constexpr UIntType EXPONENT_MASK = EXP_MASK;
162
+ LIBC_INLINE_VAR static constexpr UIntType EXP_MANT_MASK = EXP_MASK | SIG_MASK;
162
163
163
164
// If a number x is a NAN, then it is a quiet NAN if:
164
165
// QuietNaNMask & bits(x) != 0
165
166
// Else, it is a signalling NAN.
166
- static constexpr BitsType QUIET_NAN_MASK = QNAN_MASK;
167
+ static constexpr UIntType QUIET_NAN_MASK = QNAN_MASK;
167
168
};
168
169
169
170
// -----------------------------------------------------------------------------
0 commit comments