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

Unified Diff: test/unittests/compiler/machine-operator-reducer-unittest.cc

Issue 648663002: [turbofan] Optimize Uint32LessThan with Word32Sar. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « test/unittests/compiler/graph-unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/machine-operator-reducer-unittest.cc
diff --git a/test/unittests/compiler/machine-operator-reducer-unittest.cc b/test/unittests/compiler/machine-operator-reducer-unittest.cc
index 3a5eb1af45d1efc30baa43d92e439a8fec86c2ac..6c46a5bd95874848eedc5a327756170c08b2fba6 100644
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc
@@ -656,6 +656,29 @@ TEST_F(MachineOperatorReducerTest, Int32SubWithOverflowWithConstant) {
// -----------------------------------------------------------------------------
+// Uint32LessThan
+
+
+TEST_F(MachineOperatorReducerTest, Uint32LessThanWithWord32Sar) {
+ Node* const p0 = Parameter(0);
+ TRACED_FORRANGE(uint32_t, shift, 1, 3) {
+ const uint32_t limit = (kMaxInt >> shift) - 1;
+ Node* const node = graph()->NewNode(
+ machine()->Uint32LessThan(),
+ graph()->NewNode(machine()->Word32Sar(), p0, Uint32Constant(shift)),
+ Uint32Constant(limit));
+
+ Reduction r = Reduce(node);
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(
+ r.replacement(),
+ IsUint32LessThan(p0, IsInt32Constant(bit_cast<int32_t>(
+ (limit << shift) | ((1u << shift) - 1)))));
+ }
+}
+
+
+// -----------------------------------------------------------------------------
// Store
« no previous file with comments | « test/unittests/compiler/graph-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698