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

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

Issue 2410673002: [Turbofan] Add concept of FP register aliasing on ARM 32. (Closed)
Patch Set: Move helper fn / macro into OperandSet class. Created 4 years, 2 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 unified diff | Download patch
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 descriptor->CalleeSavedFPRegisters(), // callee-saved fp regs 380 descriptor->CalleeSavedFPRegisters(), // callee-saved fp regs
370 descriptor->flags(), // flags 381 descriptor->flags(), // flags
371 descriptor->debug_name()); 382 descriptor->debug_name());
372 383
373 return descriptor; 384 return descriptor;
374 } 385 }
375 386
376 } // namespace wasm 387 } // namespace wasm
377 } // namespace internal 388 } // namespace internal
378 } // namespace v8 389 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698