[clang] [llvm] [LLVM][APFloat] Add APFloat support for 8-bit UE5M3 type (PR #210720)

Pradeep Kumar via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 22 07:37:53 PDT 2026


================
@@ -1046,37 +1046,45 @@ TEST(APFloatTest, IsSmallestNormalized) {
     if (I == APFloat::S_Float8E8M0FNU)
       continue;
 
-    EXPECT_FALSE(APFloat::getZero(Semantics, false).isSmallestNormalized());
-    EXPECT_FALSE(APFloat::getZero(Semantics, true).isSmallestNormalized());
+    EXPECT_FALSE(
+        APFloat::getZero(Semantics, /*Negative=*/false).isSmallestNormalized());
+    if (Semantics.hasSignedRepr)
+      EXPECT_FALSE(APFloat::getZero(Semantics, /*Negative=*/true)
+                       .isSmallestNormalized());
 
     if (APFloat::semanticsHasNaN(Semantics)) {
       // Types that do not support Inf will return NaN when asked for Inf.
       // (But only if they support NaN.)
-      EXPECT_FALSE(APFloat::getInf(Semantics, false).isSmallestNormalized());
-      EXPECT_FALSE(APFloat::getInf(Semantics, true).isSmallestNormalized());
+      EXPECT_FALSE(APFloat::getInf(Semantics, /*Negative=*/false)
+                       .isSmallestNormalized());
+      if (Semantics.hasSignedRepr)
----------------
schwarzschild-radius wrote:

Right. I will follow up this with an NFC PR to update the comments

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


More information about the cfe-commits mailing list