| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <list> | 5 #include "test/unittests/compiler/instruction-selector-unittest.h" |
| 6 | |
| 7 #include "src/compiler/instruction-selector-unittest.h" | |
| 8 | 6 |
| 9 namespace v8 { | 7 namespace v8 { |
| 10 namespace internal { | 8 namespace internal { |
| 11 namespace compiler { | 9 namespace compiler { |
| 12 | 10 |
| 13 namespace { | 11 namespace { |
| 14 | 12 |
| 15 typedef RawMachineAssembler::Label MLabel; | 13 typedef RawMachineAssembler::Label MLabel; |
| 16 | 14 |
| 17 template <typename T> | 15 template <typename T> |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 | 994 |
| 997 | 995 |
| 998 std::ostream& operator<<(std::ostream& os, const MemoryAccess& memacc) { | 996 std::ostream& operator<<(std::ostream& os, const MemoryAccess& memacc) { |
| 999 return os << memacc.type; | 997 return os << memacc.type; |
| 1000 } | 998 } |
| 1001 | 999 |
| 1002 } // namespace | 1000 } // namespace |
| 1003 | 1001 |
| 1004 | 1002 |
| 1005 static const MemoryAccess kMemoryAccesses[] = { | 1003 static const MemoryAccess kMemoryAccesses[] = { |
| 1006 {kMachInt8, kArm64Ldrsb, kArm64Strb, | 1004 {kMachInt8, |
| 1007 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 257, 258, 1000, 1001, | 1005 kArm64Ldrsb, |
| 1008 2121, 2442, 4093, 4094, 4095}}, | 1006 kArm64Strb, |
| 1009 {kMachUint8, kArm64Ldrb, kArm64Strb, | 1007 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 257, 258, 1000, 1001, 2121, |
| 1010 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 257, 258, 1000, 1001, | 1008 2442, 4093, 4094, 4095}}, |
| 1011 2121, 2442, 4093, 4094, 4095}}, | 1009 {kMachUint8, |
| 1012 {kMachInt16, kArm64Ldrsh, kArm64Strh, | 1010 kArm64Ldrb, |
| 1013 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 258, 260, 4096, 4098, | 1011 kArm64Strb, |
| 1014 4100, 4242, 6786, 8188, 8190}}, | 1012 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 257, 258, 1000, 1001, 2121, |
| 1015 {kMachUint16, kArm64Ldrh, kArm64Strh, | 1013 2442, 4093, 4094, 4095}}, |
| 1016 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 258, 260, 4096, 4098, | 1014 {kMachInt16, |
| 1017 4100, 4242, 6786, 8188, 8190}}, | 1015 kArm64Ldrsh, |
| 1018 {kMachInt32, kArm64LdrW, kArm64StrW, | 1016 kArm64Strh, |
| 1019 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192, | 1017 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 258, 260, 4096, 4098, 4100, |
| 1020 8196, 3276, 3280, 16376, 16380}}, | 1018 4242, 6786, 8188, 8190}}, |
| 1021 {kMachUint32, kArm64LdrW, kArm64StrW, | 1019 {kMachUint16, |
| 1022 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192, | 1020 kArm64Ldrh, |
| 1023 8196, 3276, 3280, 16376, 16380}}, | 1021 kArm64Strh, |
| 1024 {kMachInt64, kArm64Ldr, kArm64Str, | 1022 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 258, 260, 4096, 4098, 4100, |
| 1025 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192, | 1023 4242, 6786, 8188, 8190}}, |
| 1026 8200, 16384, 16392, 32752, 32760}}, | 1024 {kMachInt32, |
| 1027 {kMachUint64, kArm64Ldr, kArm64Str, | 1025 kArm64LdrW, |
| 1028 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192, | 1026 kArm64StrW, |
| 1029 8200, 16384, 16392, 32752, 32760}}, | 1027 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192, 8196, |
| 1030 {kMachFloat32, kArm64LdrS, kArm64StrS, | 1028 3276, 3280, 16376, 16380}}, |
| 1031 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192, | 1029 {kMachUint32, |
| 1032 8196, 3276, 3280, 16376, 16380}}, | 1030 kArm64LdrW, |
| 1033 {kMachFloat64, kArm64LdrD, kArm64StrD, | 1031 kArm64StrW, |
| 1034 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192, | 1032 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192, 8196, |
| 1035 8200, 16384, 16392, 32752, 32760}}}; | 1033 3276, 3280, 16376, 16380}}, |
| 1034 {kMachInt64, |
| 1035 kArm64Ldr, |
| 1036 kArm64Str, |
| 1037 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192, 8200, |
| 1038 16384, 16392, 32752, 32760}}, |
| 1039 {kMachUint64, |
| 1040 kArm64Ldr, |
| 1041 kArm64Str, |
| 1042 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192, 8200, |
| 1043 16384, 16392, 32752, 32760}}, |
| 1044 {kMachFloat32, |
| 1045 kArm64LdrS, |
| 1046 kArm64StrS, |
| 1047 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 260, 4096, 4100, 8192, 8196, |
| 1048 3276, 3280, 16376, 16380}}, |
| 1049 {kMachFloat64, |
| 1050 kArm64LdrD, |
| 1051 kArm64StrD, |
| 1052 {-256, -255, -3, -2, -1, 0, 1, 2, 3, 255, 256, 264, 4096, 4104, 8192, 8200, |
| 1053 16384, 16392, 32752, 32760}}}; |
| 1036 | 1054 |
| 1037 | 1055 |
| 1038 typedef InstructionSelectorTestWithParam<MemoryAccess> | 1056 typedef InstructionSelectorTestWithParam<MemoryAccess> |
| 1039 InstructionSelectorMemoryAccessTest; | 1057 InstructionSelectorMemoryAccessTest; |
| 1040 | 1058 |
| 1041 | 1059 |
| 1042 TEST_P(InstructionSelectorMemoryAccessTest, LoadWithParameters) { | 1060 TEST_P(InstructionSelectorMemoryAccessTest, LoadWithParameters) { |
| 1043 const MemoryAccess memacc = GetParam(); | 1061 const MemoryAccess memacc = GetParam(); |
| 1044 StreamBuilder m(this, memacc.type, kMachPtr, kMachInt32); | 1062 StreamBuilder m(this, memacc.type, kMachPtr, kMachInt32); |
| 1045 m.Return(m.Load(memacc.type, m.Parameter(0), m.Parameter(1))); | 1063 m.Return(m.Load(memacc.type, m.Parameter(0), m.Parameter(1))); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1386 ASSERT_EQ(1U, s.size()); | 1404 ASSERT_EQ(1U, s.size()); |
| 1387 EXPECT_EQ(kArm64Not, s[0]->arch_opcode()); | 1405 EXPECT_EQ(kArm64Not, s[0]->arch_opcode()); |
| 1388 EXPECT_EQ(1U, s[0]->InputCount()); | 1406 EXPECT_EQ(1U, s[0]->InputCount()); |
| 1389 EXPECT_EQ(1U, s[0]->OutputCount()); | 1407 EXPECT_EQ(1U, s[0]->OutputCount()); |
| 1390 } | 1408 } |
| 1391 } | 1409 } |
| 1392 | 1410 |
| 1393 } // namespace compiler | 1411 } // namespace compiler |
| 1394 } // namespace internal | 1412 } // namespace internal |
| 1395 } // namespace v8 | 1413 } // namespace v8 |
| OLD | NEW |