Index: src/arm/assembler-arm-inl.h |
diff --git a/src/arm/assembler-arm-inl.h b/src/arm/assembler-arm-inl.h |
index 175a21df51b2d52bb82f24bf0284805f4c37b438..ff44f40dc2a910e62b45e117f35a9e77e187b31a 100644 |
--- a/src/arm/assembler-arm-inl.h |
+++ b/src/arm/assembler-arm-inl.h |
@@ -50,8 +50,50 @@ |
bool CpuFeatures::SupportsCrankshaft() { return IsSupported(VFP3); } |
-int DoubleRegister::NumRegisters() { |
+int Register::NumAllocatableRegisters() { |
+ return kMaxNumAllocatableRegisters; |
+} |
+ |
+ |
+int DwVfpRegister::NumRegisters() { |
return CpuFeatures::IsSupported(VFP32DREGS) ? 32 : 16; |
+} |
+ |
+ |
+int DwVfpRegister::NumReservedRegisters() { |
+ return kNumReservedRegisters; |
+} |
+ |
+ |
+int DwVfpRegister::NumAllocatableRegisters() { |
+ return NumRegisters() - kNumReservedRegisters; |
+} |
+ |
+ |
+// static |
+int DwVfpRegister::NumAllocatableAliasedRegisters() { |
+ return LowDwVfpRegister::kMaxNumLowRegisters - kNumReservedRegisters; |
+} |
+ |
+ |
+int DwVfpRegister::ToAllocationIndex(DwVfpRegister reg) { |
+ DCHECK(!reg.is(kDoubleRegZero)); |
+ DCHECK(!reg.is(kScratchDoubleReg)); |
+ if (reg.code() > kDoubleRegZero.code()) { |
+ return reg.code() - kNumReservedRegisters; |
+ } |
+ return reg.code(); |
+} |
+ |
+ |
+DwVfpRegister DwVfpRegister::FromAllocationIndex(int index) { |
+ DCHECK(index >= 0 && index < NumAllocatableRegisters()); |
+ DCHECK(kScratchDoubleReg.code() - kDoubleRegZero.code() == |
+ kNumReservedRegisters - 1); |
+ if (index >= kDoubleRegZero.code()) { |
+ return from_code(index + kNumReservedRegisters); |
+ } |
+ return from_code(index); |
} |