Avoid turning a floating point division with a constant power of two into a denormal multiplication.
Some platforms may treat denormals as zero, on other platforms multiplication
with a subnormal is slower than dividing by a normal.
llvm-svn: 128555
diff --git a/llvm/unittests/ADT/APFloatTest.cpp b/llvm/unittests/ADT/APFloatTest.cpp
index dea4a65..5f05b86 100644
--- a/llvm/unittests/ADT/APFloatTest.cpp
+++ b/llvm/unittests/ADT/APFloatTest.cpp
@@ -589,10 +589,8 @@
EXPECT_TRUE(APFloat(1.17549435e-38f).getExactInverse(&inv));
EXPECT_TRUE(inv.bitwiseIsEqual(APFloat(8.5070592e+37f)));
- // Large float
- EXPECT_TRUE(APFloat(1.7014118e38f).getExactInverse(&inv));
- EXPECT_TRUE(inv.bitwiseIsEqual(APFloat(5.8774718e-39f)));
-
+ // Large float, inverse is a denormal.
+ EXPECT_FALSE(APFloat(1.7014118e38f).getExactInverse(0));
// Zero
EXPECT_FALSE(APFloat(0.0).getExactInverse(0));
// Denormalized float