summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-03-30 17:02:54 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-03-30 17:02:54 +0000
commit8398512f89623144c8bb45ce9deb4f74f76480fc (patch)
treef36a0e103a6f63fa6537a9eda91358964e17d0d7 /unittests
parent546739656ec9469499d3866d87dca6fdbcf2eee0 (diff)
downloadllvm-8398512f89623144c8bb45ce9deb4f74f76480fc.tar.gz
llvm-8398512f89623144c8bb45ce9deb4f74f76480fc.tar.bz2
llvm-8398512f89623144c8bb45ce9deb4f74f76480fc.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128555 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/ADT/APFloatTest.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/unittests/ADT/APFloatTest.cpp b/unittests/ADT/APFloatTest.cpp
index dea4a65b88..5f05b86169 100644
--- a/unittests/ADT/APFloatTest.cpp
+++ b/unittests/ADT/APFloatTest.cpp
@@ -589,10 +589,8 @@ TEST(APFloatTest, exactInverse) {
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