[llvm] [APFloat] Fix `IEEEFloat::addOrSubtractSignificand` and `IEEEFloat::normalize` (PR #98721)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 02:51:31 PDT 2024


================
@@ -560,6 +560,17 @@ TEST(APFloatTest, FMA) {
     EXPECT_EQ(-8.85242279E-41f, f1.convertToFloat());
   }
 
+  // Regression test for failing the `assert(!carry)` in
+  // `addOrSubtractSignificand` and normalizing the exponent even when the
+  // significand is zero if there is a lost fraction.
+  {
+    APFloat f1(-1.4728589E-38f);
----------------
arsenm wrote:

I assume more test values are required to hit the cmpGreaterThan, capLessThan, and cmpEqual cases 

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


More information about the llvm-commits mailing list