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

Side by Side Diff: test/unittests/compiler/mips/instruction-selector-mips-unittest.cc

Issue 2500863003: Revert of MIPS: Optimize load/store with large offset (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/mips/assembler-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "test/unittests/compiler/instruction-selector-unittest.h" 5 #include "test/unittests/compiler/instruction-selector-unittest.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace compiler { 9 namespace compiler {
10 10
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 -87, -86, -82, -44, -23, -3, 0, 7, 10, 39, 52, 69, 71, 91, 92, 107, 109, 909 -87, -86, -82, -44, -23, -3, 0, 7, 10, 39, 52, 69, 71, 91, 92, 107, 109,
910 115, 124, 286, 655, 1362, 1569, 2587, 3067, 3096, 3462, 3510, 4095}}, 910 115, 124, 286, 655, 1362, 1569, 2587, 3067, 3096, 3462, 3510, 4095}},
911 {MachineType::Float64(), 911 {MachineType::Float64(),
912 kMipsLdc1, 912 kMipsLdc1,
913 kMipsSdc1, 913 kMipsSdc1,
914 &InstructionSelectorTest::Stream::IsDouble, 914 &InstructionSelectorTest::Stream::IsDouble,
915 {-4095, -3340, -3231, -3224, -3088, -1758, -1203, -123, -117, -91, -89, 915 {-4095, -3340, -3231, -3224, -3088, -1758, -1203, -123, -117, -91, -89,
916 -87, -86, -82, -44, -23, -3, 0, 7, 10, 39, 52, 69, 71, 91, 92, 107, 109, 916 -87, -86, -82, -44, -23, -3, 0, 7, 10, 39, 52, 69, 71, 91, 92, 107, 109,
917 115, 124, 286, 655, 1362, 1569, 2587, 3067, 3096, 3462, 3510, 4095}}}; 917 115, 124, 286, 655, 1362, 1569, 2587, 3067, 3096, 3462, 3510, 4095}}};
918 918
919
919 const MemoryAccessImm1 kMemoryAccessImmMoreThan16bit[] = { 920 const MemoryAccessImm1 kMemoryAccessImmMoreThan16bit[] = {
920 {MachineType::Int8(), 921 {MachineType::Int8(),
921 kMipsLb, 922 kMipsLb,
922 kMipsSb, 923 kMipsSb,
923 &InstructionSelectorTest::Stream::IsInteger, 924 &InstructionSelectorTest::Stream::IsInteger,
924 {-65000, -55000, 32777, 55000, 65000}}, 925 {-65000, -55000, 32777, 55000, 65000}},
925 {MachineType::Uint8(), 926 {MachineType::Int8(),
926 kMipsLbu, 927 kMipsLbu,
927 kMipsSb, 928 kMipsSb,
928 &InstructionSelectorTest::Stream::IsInteger, 929 &InstructionSelectorTest::Stream::IsInteger,
929 {-65000, -55000, 32777, 55000, 65000}}, 930 {-65000, -55000, 32777, 55000, 65000}},
930 {MachineType::Int16(), 931 {MachineType::Int16(),
931 kMipsLh, 932 kMipsLh,
932 kMipsSh, 933 kMipsSh,
933 &InstructionSelectorTest::Stream::IsInteger, 934 &InstructionSelectorTest::Stream::IsInteger,
934 {-65000, -55000, 32777, 55000, 65000}}, 935 {-65000, -55000, 32777, 55000, 65000}},
935 {MachineType::Uint16(), 936 {MachineType::Int16(),
936 kMipsLhu, 937 kMipsLhu,
937 kMipsSh, 938 kMipsSh,
938 &InstructionSelectorTest::Stream::IsInteger, 939 &InstructionSelectorTest::Stream::IsInteger,
939 {-65000, -55000, 32777, 55000, 65000}}, 940 {-65000, -55000, 32777, 55000, 65000}},
940 {MachineType::Int32(), 941 {MachineType::Int32(),
941 kMipsLw, 942 kMipsLw,
942 kMipsSw, 943 kMipsSw,
943 &InstructionSelectorTest::Stream::IsInteger, 944 &InstructionSelectorTest::Stream::IsInteger,
944 {-65000, -55000, 32777, 55000, 65000}}, 945 {-65000, -55000, 32777, 55000, 65000}},
945 {MachineType::Float32(), 946 {MachineType::Float32(),
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 InstructionSelectorMemoryAccessImmMoreThan16bitTest; 1058 InstructionSelectorMemoryAccessImmMoreThan16bitTest;
1058 1059
1059 1060
1060 TEST_P(InstructionSelectorMemoryAccessImmMoreThan16bitTest, 1061 TEST_P(InstructionSelectorMemoryAccessImmMoreThan16bitTest,
1061 LoadWithImmediateIndex) { 1062 LoadWithImmediateIndex) {
1062 const MemoryAccessImm1 memacc = GetParam(); 1063 const MemoryAccessImm1 memacc = GetParam();
1063 TRACED_FOREACH(int32_t, index, memacc.immediates) { 1064 TRACED_FOREACH(int32_t, index, memacc.immediates) {
1064 StreamBuilder m(this, memacc.type, MachineType::Pointer()); 1065 StreamBuilder m(this, memacc.type, MachineType::Pointer());
1065 m.Return(m.Load(memacc.type, m.Parameter(0), m.Int32Constant(index))); 1066 m.Return(m.Load(memacc.type, m.Parameter(0), m.Int32Constant(index)));
1066 Stream s = m.Build(); 1067 Stream s = m.Build();
1067 ASSERT_EQ(1U, s.size()); 1068 ASSERT_EQ(2U, s.size());
1068 EXPECT_EQ(memacc.load_opcode, s[0]->arch_opcode()); 1069 // kMipsAdd is expected opcode.
1069 EXPECT_EQ(kMode_MRI, s[0]->addressing_mode()); 1070 // size more than 16 bits wide.
1071 EXPECT_EQ(kMipsAdd, s[0]->arch_opcode());
1072 EXPECT_EQ(kMode_None, s[0]->addressing_mode());
1070 EXPECT_EQ(2U, s[0]->InputCount()); 1073 EXPECT_EQ(2U, s[0]->InputCount());
1071 EXPECT_EQ(1U, s[0]->OutputCount()); 1074 EXPECT_EQ(1U, s[0]->OutputCount());
1072 } 1075 }
1073 } 1076 }
1074 1077
1075 1078
1076 TEST_P(InstructionSelectorMemoryAccessImmMoreThan16bitTest, 1079 TEST_P(InstructionSelectorMemoryAccessImmMoreThan16bitTest,
1077 StoreWithImmediateIndex) { 1080 StoreWithImmediateIndex) {
1078 const MemoryAccessImm1 memacc = GetParam(); 1081 const MemoryAccessImm1 memacc = GetParam();
1079 TRACED_FOREACH(int32_t, index, memacc.immediates) { 1082 TRACED_FOREACH(int32_t, index, memacc.immediates) {
1080 StreamBuilder m(this, MachineType::Int32(), MachineType::Pointer(), 1083 StreamBuilder m(this, MachineType::Int32(), MachineType::Pointer(),
1081 memacc.type); 1084 memacc.type);
1082 m.Store(memacc.type.representation(), m.Parameter(0), 1085 m.Store(memacc.type.representation(), m.Parameter(0),
1083 m.Int32Constant(index), m.Parameter(1), kNoWriteBarrier); 1086 m.Int32Constant(index), m.Parameter(1), kNoWriteBarrier);
1084 m.Return(m.Int32Constant(0)); 1087 m.Return(m.Int32Constant(0));
1085 Stream s = m.Build(); 1088 Stream s = m.Build();
1086 ASSERT_EQ(1U, s.size()); 1089 ASSERT_EQ(2U, s.size());
1087 EXPECT_EQ(memacc.store_opcode, s[0]->arch_opcode()); 1090 // kMipsAdd is expected opcode
1088 EXPECT_EQ(kMode_MRI, s[0]->addressing_mode()); 1091 // size more than 16 bits wide
1089 EXPECT_EQ(3U, s[0]->InputCount()); 1092 EXPECT_EQ(kMipsAdd, s[0]->arch_opcode());
1090 EXPECT_EQ(0, s[0]->OutputCount()); 1093 EXPECT_EQ(kMode_None, s[0]->addressing_mode());
1094 EXPECT_EQ(2U, s[0]->InputCount());
1095 EXPECT_EQ(1U, s[0]->OutputCount());
1091 } 1096 }
1092 } 1097 }
1093 1098
1094 1099
1095 INSTANTIATE_TEST_CASE_P(InstructionSelectorTest, 1100 INSTANTIATE_TEST_CASE_P(InstructionSelectorTest,
1096 InstructionSelectorMemoryAccessImmMoreThan16bitTest, 1101 InstructionSelectorMemoryAccessImmMoreThan16bitTest,
1097 ::testing::ValuesIn(kMemoryAccessImmMoreThan16bit)); 1102 ::testing::ValuesIn(kMemoryAccessImmMoreThan16bit));
1098 1103
1099 1104
1100 // ---------------------------------------------------------------------------- 1105 // ----------------------------------------------------------------------------
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 ASSERT_EQ(1U, s.size()); 1420 ASSERT_EQ(1U, s.size());
1416 EXPECT_EQ(kMipsFloat64Min, s[0]->arch_opcode()); 1421 EXPECT_EQ(kMipsFloat64Min, s[0]->arch_opcode());
1417 ASSERT_EQ(2U, s[0]->InputCount()); 1422 ASSERT_EQ(2U, s[0]->InputCount());
1418 ASSERT_EQ(1U, s[0]->OutputCount()); 1423 ASSERT_EQ(1U, s[0]->OutputCount());
1419 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); 1424 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
1420 } 1425 }
1421 1426
1422 } // namespace compiler 1427 } // namespace compiler
1423 } // namespace internal 1428 } // namespace internal
1424 } // namespace v8 1429 } // namespace v8
OLDNEW
« no previous file with comments | « src/mips/assembler-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698