Index: test/cctest/compiler/test-run-machops.cc |
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc |
index c68a6ffddd2ba9a978904446f9a123ccae359a5d..a8bccbb955a8d8150a198de22cfb02dfab13032c 100644 |
--- a/test/cctest/compiler/test-run-machops.cc |
+++ b/test/cctest/compiler/test-run-machops.cc |
@@ -4385,6 +4385,56 @@ TEST(RunWord32PairShlWithSharedInput) { |
TestWord32PairShlWithSharedInput(1, 1); |
} |
+TEST(RunWord32PairShr) { |
+ BufferedRawMachineAssemblerTester<int32_t> m( |
+ MachineType::Uint32(), MachineType::Uint32(), MachineType::Uint32()); |
+ |
+ uint32_t high; |
+ uint32_t low; |
+ |
+ Node* PairAdd = |
+ m.Word32PairShr(m.Parameter(0), m.Parameter(1), m.Parameter(2)); |
+ |
+ m.StoreToPointer(&low, MachineRepresentation::kWord32, |
+ m.Projection(0, PairAdd)); |
+ m.StoreToPointer(&high, MachineRepresentation::kWord32, |
+ m.Projection(1, PairAdd)); |
+ m.Return(m.Int32Constant(74)); |
+ |
+ FOR_UINT64_INPUTS(i) { |
+ for (uint32_t j = 0; j < 64; j++) { |
+ m.Call(static_cast<uint32_t>(*i & 0xffffffff), |
+ static_cast<uint32_t>(*i >> 32), j); |
+ CHECK_EQ(*i >> j, ToInt64(low, high)); |
+ } |
+ } |
+} |
+ |
+TEST(RunWord32PairSar) { |
+ BufferedRawMachineAssemblerTester<int32_t> m( |
+ MachineType::Uint32(), MachineType::Uint32(), MachineType::Uint32()); |
+ |
+ uint32_t high; |
+ uint32_t low; |
+ |
+ Node* PairAdd = |
+ m.Word32PairSar(m.Parameter(0), m.Parameter(1), m.Parameter(2)); |
+ |
+ m.StoreToPointer(&low, MachineRepresentation::kWord32, |
+ m.Projection(0, PairAdd)); |
+ m.StoreToPointer(&high, MachineRepresentation::kWord32, |
+ m.Projection(1, PairAdd)); |
+ m.Return(m.Int32Constant(74)); |
+ |
+ FOR_INT64_INPUTS(i) { |
+ for (uint32_t j = 0; j < 64; j++) { |
+ m.Call(static_cast<uint32_t>(*i & 0xffffffff), |
+ static_cast<uint32_t>(*i >> 32), j); |
+ CHECK_EQ(*i >> j, ToInt64(low, high)); |
+ } |
+ } |
+} |
+ |
#endif |
TEST(RunDeadChangeFloat64ToInt32) { |