Commit e2613ce7 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

ARM: use vstm/vldm when possible.

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/74193004

Patch from Rodolph Perfetta <rodolph.perfetta@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17854 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ca5265d9
...@@ -57,6 +57,11 @@ int DwVfpRegister::NumRegisters() { ...@@ -57,6 +57,11 @@ int DwVfpRegister::NumRegisters() {
} }
int DwVfpRegister::NumReservedRegisters() {
return kNumReservedRegisters;
}
int DwVfpRegister::NumAllocatableRegisters() { int DwVfpRegister::NumAllocatableRegisters() {
return NumRegisters() - kNumReservedRegisters; return NumRegisters() - kNumReservedRegisters;
} }
......
...@@ -285,6 +285,7 @@ struct DwVfpRegister { ...@@ -285,6 +285,7 @@ struct DwVfpRegister {
// Any code included in the snapshot must be able to run both with 16 or 32 // Any code included in the snapshot must be able to run both with 16 or 32
// registers. // registers.
inline static int NumRegisters(); inline static int NumRegisters();
inline static int NumReservedRegisters();
inline static int NumAllocatableRegisters(); inline static int NumAllocatableRegisters();
inline static int ToAllocationIndex(DwVfpRegister reg); inline static int ToAllocationIndex(DwVfpRegister reg);
......
...@@ -620,22 +620,26 @@ void MacroAssembler::PushSafepointRegistersAndDoubles() { ...@@ -620,22 +620,26 @@ void MacroAssembler::PushSafepointRegistersAndDoubles() {
// Number of d-regs not known at snapshot time. // Number of d-regs not known at snapshot time.
ASSERT(!Serializer::enabled()); ASSERT(!Serializer::enabled());
PushSafepointRegisters(); PushSafepointRegisters();
sub(sp, sp, Operand(DwVfpRegister::NumAllocatableRegisters() * // Only save allocatable registers.
kDoubleSize)); ASSERT(kScratchDoubleReg.is(d15) && kDoubleRegZero.is(d14));
for (int i = 0; i < DwVfpRegister::NumAllocatableRegisters(); i++) { ASSERT(DwVfpRegister::NumReservedRegisters() == 2);
vstr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize); if (CpuFeatures::IsSupported(VFP32DREGS)) {
vstm(db_w, sp, d16, d31);
} }
vstm(db_w, sp, d0, d13);
} }
void MacroAssembler::PopSafepointRegistersAndDoubles() { void MacroAssembler::PopSafepointRegistersAndDoubles() {
// Number of d-regs not known at snapshot time. // Number of d-regs not known at snapshot time.
ASSERT(!Serializer::enabled()); ASSERT(!Serializer::enabled());
for (int i = 0; i < DwVfpRegister::NumAllocatableRegisters(); i++) { // Only save allocatable registers.
vldr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize); ASSERT(kScratchDoubleReg.is(d15) && kDoubleRegZero.is(d14));
ASSERT(DwVfpRegister::NumReservedRegisters() == 2);
vldm(ia_w, sp, d0, d13);
if (CpuFeatures::IsSupported(VFP32DREGS)) {
vldm(ia_w, sp, d16, d31);
} }
add(sp, sp, Operand(DwVfpRegister::NumAllocatableRegisters() *
kDoubleSize));
PopSafepointRegisters(); PopSafepointRegisters();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment