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

Side by Side Diff: src/compiler/wasm-linkage.cc

Issue 2410673002: [Turbofan] Add concept of FP register aliasing on ARM 32. (Closed)
Patch Set: Add a TODO. 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/compiler/register-allocator.cc ('k') | src/machine-type.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 "src/assembler.h" 5 #include "src/assembler.h"
6 #include "src/base/lazy-instance.h" 6 #include "src/base/lazy-instance.h"
7 #include "src/macro-assembler.h" 7 #include "src/macro-assembler.h"
8 #include "src/register-configuration.h" 8 #include "src/register-configuration.h"
9 9
10 #include "src/wasm/wasm-module.h" 10 #include "src/wasm/wasm-module.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 int fp_offset; 171 int fp_offset;
172 const DoubleRegister* fp_regs; 172 const DoubleRegister* fp_regs;
173 173
174 int stack_offset; 174 int stack_offset;
175 175
176 LinkageLocation Next(LocalType type) { 176 LinkageLocation Next(LocalType type) {
177 if (IsFloatingPoint(type)) { 177 if (IsFloatingPoint(type)) {
178 // Allocate a floating point register/stack location. 178 // Allocate a floating point register/stack location.
179 if (fp_offset < fp_count) { 179 if (fp_offset < fp_count) {
180 DoubleRegister reg = fp_regs[fp_offset++]; 180 DoubleRegister reg = fp_regs[fp_offset++];
181 #if V8_TARGET_ARCH_ARM
182 // Allocate floats using a double register, but modify the code to
183 // reflect how ARM FP registers alias.
184 // TODO(bbudge) Modify wasm linkage to allow use of all float regs.
185 if (type == kAstF32) {
186 int float_reg_code = reg.code() * 2;
187 DCHECK(float_reg_code < RegisterConfiguration::kMaxFPRegisters);
188 return regloc(DoubleRegister::from_code(float_reg_code),
189 MachineTypeFor(type));
190 }
191 #endif
181 return regloc(reg, MachineTypeFor(type)); 192 return regloc(reg, MachineTypeFor(type));
182 } else { 193 } else {
183 int offset = -1 - stack_offset; 194 int offset = -1 - stack_offset;
184 stack_offset += Words(type); 195 stack_offset += Words(type);
185 return stackloc(offset, MachineTypeFor(type)); 196 return stackloc(offset, MachineTypeFor(type));
186 } 197 }
187 } else { 198 } else {
188 // Allocate a general purpose register/stack location. 199 // Allocate a general purpose register/stack location.
189 if (gp_offset < gp_count) { 200 if (gp_offset < gp_count) {
190 return regloc(gp_regs[gp_offset++], MachineTypeFor(type)); 201 return regloc(gp_regs[gp_offset++], MachineTypeFor(type));
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 CallDescriptor* ModuleEnv::GetI32WasmCallDescriptorForSimd( 389 CallDescriptor* ModuleEnv::GetI32WasmCallDescriptorForSimd(
379 Zone* zone, CallDescriptor* descriptor) { 390 Zone* zone, CallDescriptor* descriptor) {
380 return ReplaceTypeInCallDescriptorWith(zone, descriptor, 4, 391 return ReplaceTypeInCallDescriptorWith(zone, descriptor, 4,
381 MachineType::Simd128(), 392 MachineType::Simd128(),
382 MachineRepresentation::kWord32); 393 MachineRepresentation::kWord32);
383 } 394 }
384 395
385 } // namespace wasm 396 } // namespace wasm
386 } // namespace internal 397 } // namespace internal
387 } // namespace v8 398 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/register-allocator.cc ('k') | src/machine-type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698