[libc-commits] [libc] [libc][NFC] Make `EXP_MANT_MASK` an implementation detail (PR #75621)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Mon Dec 18 02:57:14 PST 2023


================
@@ -34,7 +35,7 @@ LLVM_LIBC_FUNCTION(float, acoshf, (float x)) {
 
   if (LIBC_UNLIKELY(x_u >= 0x4f8ffb03)) {
     // Check for exceptional values.
-    uint32_t x_abs = x_u & FPBits_t::EXP_MANT_MASK;
+    uint32_t x_abs = FloatProp::abs(x_u);
----------------
gchatelet wrote:

@lntue let me know what you think but it might be confusing to see `abs` on `FloatProperties` which is about ... well float **properties**.

Ultimately I think we should just have one or two types for interacting with floating point number representations. AFAICT right now we have : `FloatProperties`, `FPBits`, `DyadicFloat` and `NormalFloat`. I'm not completely clear on the scope of each of them and I'd like to reduce them if possible.

https://github.com/llvm/llvm-project/pull/75621


More information about the libc-commits mailing list