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

Unified Diff: test/cctest/compiler/test-run-machops.cc

Issue 1776393004: [wasm] Fixed register allocation for Word32PairShl on arm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-add
Patch Set: Rebase Created 4 years, 9 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 | « src/compiler/arm/instruction-selector-arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 13bce4a612540875270900c2088df2684d84c6a8..d826487e9839a0c68896fdf79788c47528ff51a7 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -4264,6 +4264,64 @@ TEST(RunInt32PairAddWithSharedInput) {
TestInt32PairAddWithSharedInput(0, 0, 0, 1);
TestInt32PairAddWithSharedInput(1, 1, 0, 0);
}
+
+TEST(RunWord32PairShl) {
+ BufferedRawMachineAssemblerTester<int32_t> m(
+ MachineType::Uint32(), MachineType::Uint32(), MachineType::Uint32());
+
+ uint32_t high;
+ uint32_t low;
+
+ Node* PairAdd =
+ m.Word32PairShl(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));
+ }
+ }
+}
+
+void TestWord32PairShlWithSharedInput(int a, int b) {
+ BufferedRawMachineAssemblerTester<int32_t> m(MachineType::Uint32(),
+ MachineType::Uint32());
+
+ uint32_t high;
+ uint32_t low;
+
+ Node* PairAdd =
+ m.Word32PairShl(m.Parameter(a), m.Parameter(b), m.Parameter(1));
+
+ m.StoreToPointer(&low, MachineRepresentation::kWord32,
+ m.Projection(0, PairAdd));
+ m.StoreToPointer(&high, MachineRepresentation::kWord32,
+ m.Projection(1, PairAdd));
+ m.Return(m.Int32Constant(74));
+
+ FOR_UINT32_INPUTS(i) {
+ for (uint32_t j = 0; j < 64; j++) {
+ m.Call(*i, j);
+ uint32_t inputs[] = {*i, j};
+ CHECK_EQ(ToInt64(inputs[a], inputs[b]) << j, ToInt64(low, high));
+ }
+ }
+}
+
+TEST(RunWord32PairShlWithSharedInput) {
+ TestWord32PairShlWithSharedInput(0, 0);
+ TestWord32PairShlWithSharedInput(0, 1);
+ TestWord32PairShlWithSharedInput(1, 0);
+ TestWord32PairShlWithSharedInput(1, 1);
+}
+
#endif
TEST(RunDeadChangeFloat64ToInt32) {
« no previous file with comments | « src/compiler/arm/instruction-selector-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698