[llvm] [APFloat] Extend fltSemantics with field for explicit integer bit (PR #204860)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 08:47:30 PDT 2026


================
@@ -3813,6 +3805,21 @@ void IEEEFloat::initFromIEEEAPInt(const APInt &api) {
     is_nan = is_zero && sign;
   }
 
+  if constexpr (S.hasExplicitIntegerBit) {
+    // This is only used and tested for x87DoubleExtended
+    static_assert(S.precision == 64);
+    const integerPart myintegerbit = mysignificand[0] >> 63;
+    constexpr integerPart significand_mask_no_int_bit =
+        (uint64_t{1} << (trailing_significand_bits - 1)) - 1;
+    if (myexponent - bias != ::exponentNaN(S) && myexponent != 0 &&
+        myintegerbit == 0) {
+      is_nan = true;
----------------
janr-bay wrote:

@matthias-springer ping

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


More information about the llvm-commits mailing list