[libc-commits] [libc] [libc][NFC] Move functions from `FPBits` to `FPRep`, make `bits` member private (PR #79974)

Clement Courbet via libc-commits libc-commits at lists.llvm.org
Tue Jan 30 05:05:49 PST 2024


================
@@ -652,6 +655,44 @@ struct FPRep : public FPRepSem<fp_type, RetT> {
     bits = merge(bits, mantVal, FRACTION_MASK);
   }
 
+  // TODO: Use an uint32_t for 'biased_exp'.
+  LIBC_INLINE static constexpr RetT
+  create_value(Sign sign, StorageType biased_exp, StorageType mantissa) {
+    static_assert(fp_type != FPType::X86_Binary80,
+                  "This function is not tested for X86 Extended Precision");
+    return RetT(encode(sign, BiasedExp(static_cast<uint32_t>(biased_exp)),
+                       Sig(mantissa)));
+  }
+
+  // The function convert integer number and unbiased exponent to proper float
----------------
legrosbuffle wrote:

*converts

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


More information about the libc-commits mailing list