Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2247)

Unified Diff: Source/wtf/SaturatedArithmeticTest.cpp

Issue 337323004: Revert of Some inline ARM assembly for saturated arithmetic, a small speed-up for (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/SaturatedArithmetic.h ('k') | Source/wtf/asm/SaturatedArithmeticARM.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/SaturatedArithmeticTest.cpp
diff --git a/Source/wtf/SaturatedArithmeticTest.cpp b/Source/wtf/SaturatedArithmeticTest.cpp
index 402471c6f6ef31a94292127b1d2166d2687cb093..00df8e97bbc7fb31005de9eea5d68046424b5939 100644
--- a/Source/wtf/SaturatedArithmeticTest.cpp
+++ b/Source/wtf/SaturatedArithmeticTest.cpp
@@ -104,52 +104,4 @@
EXPECT_EQ(INT_MAX, saturatedSubtraction(INT_MAX, INT_MIN));
}
-TEST(SaturatedArithmeticTest, SetSigned)
-{
- const int kFractionBits = 6;
- const int intMaxForLayoutUnit = INT_MAX >> kFractionBits;
- const int intMinForLayoutUnit = INT_MIN >> kFractionBits;
-
- EXPECT_EQ(0, saturatedSet(0, kFractionBits));
-
- // Internally the max number we can represent (without saturating)
- // is all the (non-sign) bits set except for the bottom n fraction bits
- const int maxInternalRepresentation = INT_MAX ^ ((1 << kFractionBits)-1);
- EXPECT_EQ(maxInternalRepresentation,
- saturatedSet(intMaxForLayoutUnit, kFractionBits));
-
- EXPECT_EQ(getMaxSaturatedSetResultForTesting(kFractionBits),
- saturatedSet(intMaxForLayoutUnit + 100, kFractionBits));
-
- EXPECT_EQ((intMaxForLayoutUnit - 100) << kFractionBits,
- saturatedSet(intMaxForLayoutUnit - 100, kFractionBits));
-
- EXPECT_EQ(getMinSaturatedSetResultForTesting(kFractionBits),
- saturatedSet(intMinForLayoutUnit, kFractionBits));
-
- EXPECT_EQ(getMinSaturatedSetResultForTesting(kFractionBits),
- saturatedSet(intMinForLayoutUnit - 100, kFractionBits));
-
- EXPECT_EQ((intMinForLayoutUnit + 100) << kFractionBits,
- saturatedSet(intMinForLayoutUnit + 100, kFractionBits));
-}
-
-TEST(SaturatedArithmeticTest, SetUnsigned)
-{
- const int kFractionBits = 6;
- const int intMaxForLayoutUnit = INT_MAX >> kFractionBits;
-
- EXPECT_EQ(0, saturatedSet((unsigned)0, kFractionBits));
-
- EXPECT_EQ(getMaxSaturatedSetResultForTesting(kFractionBits),
- saturatedSet((unsigned)intMaxForLayoutUnit, kFractionBits));
-
- EXPECT_EQ(getMaxSaturatedSetResultForTesting(kFractionBits),
- saturatedSet((unsigned)(intMaxForLayoutUnit+100), kFractionBits));
-
- EXPECT_EQ((intMaxForLayoutUnit - 100) << kFractionBits,
- saturatedSet((unsigned)(intMaxForLayoutUnit - 100), kFractionBits));
-}
-
-
} // namespace
« no previous file with comments | « Source/wtf/SaturatedArithmetic.h ('k') | Source/wtf/asm/SaturatedArithmeticARM.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698