Index: src/compiler/wasm-linkage.cc |
diff --git a/src/compiler/wasm-linkage.cc b/src/compiler/wasm-linkage.cc |
index 14d7e93d84cc029ea066bcc5194c599ca962a466..cfeb6c523f03d5f721d3b260858c82cc6cadc7ed 100644 |
--- a/src/compiler/wasm-linkage.cc |
+++ b/src/compiler/wasm-linkage.cc |
@@ -4,6 +4,7 @@ |
#include "src/assembler.h" |
#include "src/macro-assembler.h" |
+#include "src/register-configuration.h" |
#include "src/wasm/wasm-module.h" |
@@ -178,7 +179,18 @@ struct Allocator { |
if (IsFloatingPoint(type)) { |
// Allocate a floating point register/stack location. |
if (fp_offset < fp_count) { |
- return regloc(fp_regs[fp_offset++]); |
+ DoubleRegister reg = fp_regs[fp_offset++]; |
+#if V8_TARGET_ARCH_ARM |
+ // Allocate floats using a double register, but modify the code to |
+ // reflect how ARM FP registers alias. |
+ // TODO(bbudge) Modify wasm linkage to allow use of all float regs. |
+ if (type == kAstF32) { |
+ int float_reg_code = reg.code() * 2; |
+ DCHECK(float_reg_code < RegisterConfiguration::kMaxFPRegisters); |
+ return regloc(DoubleRegister::from_code(float_reg_code)); |
+ } |
+#endif |
+ return regloc(reg); |
} else { |
int offset = -1 - stack_offset; |
stack_offset += Words(type); |