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

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

Issue 1424983003: [turbofan] Cleanup RawMachineAssembler::Store interface. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ports. Created 5 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
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 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2149 ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind()); 2149 ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
2150 EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1))); 2150 EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1)));
2151 ASSERT_EQ(1U, s[0]->OutputCount()); 2151 ASSERT_EQ(1U, s[0]->OutputCount());
2152 } 2152 }
2153 } 2153 }
2154 2154
2155 2155
2156 TEST_P(InstructionSelectorMemoryAccessTest, StoreWithParameters) { 2156 TEST_P(InstructionSelectorMemoryAccessTest, StoreWithParameters) {
2157 const MemoryAccess memacc = GetParam(); 2157 const MemoryAccess memacc = GetParam();
2158 StreamBuilder m(this, kMachInt32, kMachPtr, kMachInt32, memacc.type); 2158 StreamBuilder m(this, kMachInt32, kMachPtr, kMachInt32, memacc.type);
2159 StoreRepresentation store_rep(memacc.type, kNoWriteBarrier); 2159 m.Store(memacc.type, m.Parameter(0), m.Parameter(1), m.Parameter(2),
2160 m.Store(store_rep, m.Parameter(0), m.Parameter(1), m.Parameter(2)); 2160 kNoWriteBarrier);
2161 m.Return(m.Int32Constant(0)); 2161 m.Return(m.Int32Constant(0));
2162 Stream s = m.Build(); 2162 Stream s = m.Build();
2163 ASSERT_EQ(1U, s.size()); 2163 ASSERT_EQ(1U, s.size());
2164 EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode()); 2164 EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode());
2165 EXPECT_EQ(kMode_MRR, s[0]->addressing_mode()); 2165 EXPECT_EQ(kMode_MRR, s[0]->addressing_mode());
2166 EXPECT_EQ(3U, s[0]->InputCount()); 2166 EXPECT_EQ(3U, s[0]->InputCount());
2167 EXPECT_EQ(0U, s[0]->OutputCount()); 2167 EXPECT_EQ(0U, s[0]->OutputCount());
2168 } 2168 }
2169 2169
2170 2170
2171 TEST_P(InstructionSelectorMemoryAccessTest, StoreWithImmediateIndex) { 2171 TEST_P(InstructionSelectorMemoryAccessTest, StoreWithImmediateIndex) {
2172 const MemoryAccess memacc = GetParam(); 2172 const MemoryAccess memacc = GetParam();
2173 TRACED_FOREACH(int32_t, index, memacc.immediates) { 2173 TRACED_FOREACH(int32_t, index, memacc.immediates) {
2174 StreamBuilder m(this, kMachInt32, kMachPtr, memacc.type); 2174 StreamBuilder m(this, kMachInt32, kMachPtr, memacc.type);
2175 StoreRepresentation store_rep(memacc.type, kNoWriteBarrier); 2175 m.Store(memacc.type, m.Parameter(0), m.Int32Constant(index), m.Parameter(1),
2176 m.Store(store_rep, m.Parameter(0), m.Int32Constant(index), m.Parameter(1)); 2176 kNoWriteBarrier);
2177 m.Return(m.Int32Constant(0)); 2177 m.Return(m.Int32Constant(0));
2178 Stream s = m.Build(); 2178 Stream s = m.Build();
2179 ASSERT_EQ(1U, s.size()); 2179 ASSERT_EQ(1U, s.size());
2180 EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode()); 2180 EXPECT_EQ(memacc.str_opcode, s[0]->arch_opcode());
2181 EXPECT_EQ(kMode_MRI, s[0]->addressing_mode()); 2181 EXPECT_EQ(kMode_MRI, s[0]->addressing_mode());
2182 ASSERT_EQ(3U, s[0]->InputCount()); 2182 ASSERT_EQ(3U, s[0]->InputCount());
2183 ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind()); 2183 ASSERT_EQ(InstructionOperand::IMMEDIATE, s[0]->InputAt(1)->kind());
2184 EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1))); 2184 EXPECT_EQ(index, s.ToInt32(s[0]->InputAt(1)));
2185 EXPECT_EQ(0U, s[0]->OutputCount()); 2185 EXPECT_EQ(0U, s[0]->OutputCount());
2186 } 2186 }
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
3182 ASSERT_EQ(2U, s[0]->InputCount()); 3182 ASSERT_EQ(2U, s[0]->InputCount());
3183 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0))); 3183 EXPECT_EQ(s.ToVreg(p0), s.ToVreg(s[0]->InputAt(0)));
3184 EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1))); 3184 EXPECT_EQ(s.ToVreg(p1), s.ToVreg(s[0]->InputAt(1)));
3185 ASSERT_EQ(1U, s[0]->OutputCount()); 3185 ASSERT_EQ(1U, s[0]->OutputCount());
3186 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); 3186 EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output()));
3187 } 3187 }
3188 3188
3189 } // namespace compiler 3189 } // namespace compiler
3190 } // namespace internal 3190 } // namespace internal
3191 } // namespace v8 3191 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698