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

Unified Diff: src/compiler/arm/code-generator-arm.cc

Issue 2827743002: [ARM] Reserve scratch q-register. (Closed)
Patch Set: Fix issue with allocatable double registers without VFP32DREGS. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/deoptimizer-arm.cc ('k') | src/register-configuration.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/arm/code-generator-arm.cc
diff --git a/src/compiler/arm/code-generator-arm.cc b/src/compiler/arm/code-generator-arm.cc
index 6247f1f8022b46578c85270ca4e6b7df263d570e..77fb70e3b90ef59a5db6e0f244fd85c4544f5d0b 100644
--- a/src/compiler/arm/code-generator-arm.cc
+++ b/src/compiler/arm/code-generator-arm.cc
@@ -2822,7 +2822,6 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
__ add(kScratchReg, dst.rn(), Operand(dst.offset()));
__ vst1(Neon8, NeonListOperand(kScratchQuadReg.low(), 2),
NeonMemOperand(kScratchReg));
- __ veor(kDoubleRegZero, kDoubleRegZero, kDoubleRegZero);
}
}
} else {
@@ -2905,40 +2904,41 @@ void CodeGenerator::AssembleSwap(InstructionOperand* source,
NeonMemOperand(kScratchReg));
__ vst1(Neon8, NeonListOperand(kScratchQuadReg.low(), 2),
NeonMemOperand(kScratchReg));
- __ veor(kDoubleRegZero, kDoubleRegZero, kDoubleRegZero);
}
}
} else if (source->IsFPStackSlot()) {
DCHECK(destination->IsFPStackSlot());
- MemOperand src = g.ToMemOperand(source);
- MemOperand dst = g.ToMemOperand(destination);
+ Register temp_0 = kScratchReg;
+ LowDwVfpRegister temp_1 = kScratchDoubleReg;
+ MemOperand src0 = g.ToMemOperand(source);
+ MemOperand dst0 = g.ToMemOperand(destination);
MachineRepresentation rep = LocationOperand::cast(source)->representation();
if (rep == MachineRepresentation::kFloat64) {
- __ vldr(kScratchDoubleReg, dst);
- __ vldr(kDoubleRegZero, src);
- __ vstr(kScratchDoubleReg, src);
- __ vstr(kDoubleRegZero, dst);
- // Restore the 0 register.
- __ veor(kDoubleRegZero, kDoubleRegZero, kDoubleRegZero);
+ MemOperand src1(src0.rn(), src0.offset() + kPointerSize);
+ MemOperand dst1(dst0.rn(), dst0.offset() + kPointerSize);
+ __ vldr(temp_1, dst0); // Save destination in temp_1.
+ __ ldr(temp_0, src0); // Then use temp_0 to copy source to destination.
+ __ str(temp_0, dst0);
+ __ ldr(temp_0, src1);
+ __ str(temp_0, dst1);
+ __ vstr(temp_1, src0);
} else if (rep == MachineRepresentation::kFloat32) {
- __ vldr(kScratchDoubleReg.low(), dst);
- __ vldr(kScratchDoubleReg.high(), src);
- __ vstr(kScratchDoubleReg.low(), src);
- __ vstr(kScratchDoubleReg.high(), dst);
+ __ vldr(temp_1.low(), dst0); // Save destination in temp_1.
+ __ ldr(temp_0, src0); // Then use temp_0 to copy source to destination.
+ __ str(temp_0, dst0);
+ __ vstr(temp_1.low(), src0);
} else {
DCHECK_EQ(MachineRepresentation::kSimd128, rep);
- __ vldr(kScratchDoubleReg, dst);
- __ vldr(kDoubleRegZero, src);
- __ vstr(kScratchDoubleReg, src);
- __ vstr(kDoubleRegZero, dst);
- src.set_offset(src.offset() + kDoubleSize);
- dst.set_offset(dst.offset() + kDoubleSize);
- __ vldr(kScratchDoubleReg, dst);
- __ vldr(kDoubleRegZero, src);
- __ vstr(kScratchDoubleReg, src);
- __ vstr(kDoubleRegZero, dst);
- // Restore the 0 register.
- __ veor(kDoubleRegZero, kDoubleRegZero, kDoubleRegZero);
+ MemOperand src1(src0.rn(), src0.offset() + kDoubleSize);
+ MemOperand dst1(dst0.rn(), dst0.offset() + kDoubleSize);
+ __ vldr(kScratchQuadReg.low(), dst0);
+ __ vldr(kScratchQuadReg.high(), src0);
+ __ vstr(kScratchQuadReg.low(), src0);
+ __ vstr(kScratchQuadReg.high(), dst0);
+ __ vldr(kScratchQuadReg.low(), dst1);
+ __ vldr(kScratchQuadReg.high(), src1);
+ __ vstr(kScratchQuadReg.low(), src1);
+ __ vstr(kScratchQuadReg.high(), dst1);
}
} else {
// No other combinations are possible.
« no previous file with comments | « src/arm/deoptimizer-arm.cc ('k') | src/register-configuration.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698