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 1284c566a3431d75b20407bbaf1252e19b360df2..d8640163b3e9d9d6e977f0aacc4d9177882cc36c 100644 |
--- a/test/unittests/compiler/machine-operator-reducer-unittest.cc |
+++ b/test/unittests/compiler/machine-operator-reducer-unittest.cc |
@@ -573,23 +573,22 @@ TEST_F(MachineOperatorReducerTest, ReduceToWord32RorWithParameters) { |
Node* value = Parameter(0); |
Node* shift = Parameter(1); |
Node* shl = graph()->NewNode(machine()->Word32Shl(), value, shift); |
- Node* shr = graph()->NewNode( |
- machine()->Word32Shr(), value, |
- graph()->NewNode(machine()->Int32Sub(), Int32Constant(32), shift)); |
+ Node* sub = graph()->NewNode(machine()->Int32Sub(), Int32Constant(32), shift); |
+ Node* shr = graph()->NewNode(machine()->Word32Shr(), value, sub); |
- // (x << y) | (x >> (32 - y)) => x ror y |
+ // (x << y) | (x >>> (32 - y)) => x ror (32 - y) |
Node* node1 = graph()->NewNode(machine()->Word32Or(), shl, shr); |
Reduction reduction1 = Reduce(node1); |
EXPECT_TRUE(reduction1.Changed()); |
EXPECT_EQ(reduction1.replacement(), node1); |
- EXPECT_THAT(reduction1.replacement(), IsWord32Ror(value, shift)); |
+ EXPECT_THAT(reduction1.replacement(), IsWord32Ror(value, sub)); |
- // (x >> (32 - y)) | (x << y) => x ror y |
+ // (x >>> (32 - y)) | (x << y) => x ror y |
Node* node2 = graph()->NewNode(machine()->Word32Or(), shr, shl); |
Reduction reduction2 = Reduce(node2); |
EXPECT_TRUE(reduction2.Changed()); |
EXPECT_EQ(reduction2.replacement(), node2); |
- EXPECT_THAT(reduction2.replacement(), IsWord32Ror(value, shift)); |
+ EXPECT_THAT(reduction2.replacement(), IsWord32Ror(value, sub)); |
} |
@@ -601,21 +600,21 @@ TEST_F(MachineOperatorReducerTest, ReduceToWord32RorWithConstant) { |
Node* shr = |
graph()->NewNode(machine()->Word32Shr(), value, Int32Constant(32 - k)); |
- // (x << K) | (x >> ((32 - K) - y)) => x ror K |
+ // (x << K) | (x >>> ((32 - K) - y)) => x ror (32 - K) |
Node* node1 = graph()->NewNode(machine()->Word32Or(), shl, shr); |
Reduction reduction1 = Reduce(node1); |
EXPECT_TRUE(reduction1.Changed()); |
EXPECT_EQ(reduction1.replacement(), node1); |
EXPECT_THAT(reduction1.replacement(), |
- IsWord32Ror(value, IsInt32Constant(k))); |
+ IsWord32Ror(value, IsInt32Constant(32 - k))); |
- // (x >> (32 - K)) | (x << K) => x ror K |
+ // (x >>> (32 - K)) | (x << K) => x ror K |
Node* node2 = graph()->NewNode(machine()->Word32Or(), shr, shl); |
Reduction reduction2 = Reduce(node2); |
EXPECT_TRUE(reduction2.Changed()); |
EXPECT_EQ(reduction2.replacement(), node2); |
EXPECT_THAT(reduction2.replacement(), |
- IsWord32Ror(value, IsInt32Constant(k))); |
+ IsWord32Ror(value, IsInt32Constant(32 - k))); |
} |
} |