================
@@ -9860,6 +9898,298 @@ TEST(APFloatTest, ConvertDoubleToE8M0FNU) {
EXPECT_EQ(status, APFloat::opUnderflow | APFloat::opInexact);
}
+TEST(APFloatTest, Float8E5M3FNUValues) {
+ // High end of the range
+ auto test = APFloat(APFloat::Float8E5M3FNU(), "0x1.c0p16");
+ EXPECT_EQ(0x1.c0p16, test.convertToDouble());
+
+ test = APFloat(APFloat::Float8E5M3FNU(), "0x1.c0p15");
+ EXPECT_EQ(0x1.cp15, test.convertToDouble());
+
+ test = APFloat(APFloat::Float8E5M3FNU(), "0x1.0p14");
+ EXPECT_EQ(0x1.0p14, test.convertToDouble());
+
+ // tests the fix in makeLargest()
----------------
durga4github wrote:
This fix was specific to the `M0` type and nothing special for this `M3` format
here.
Also, this is already getting tested in line 2321 above. So, we can remove this
getLargest() test from here.
https://github.com/llvm/llvm-project/pull/210720
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits