Commit a795aa35 authored by akos.palfi's avatar akos.palfi Committed by Commit bot

MIPS: Save and restore callee-saved FP registers in cctest/ConvertDToI.

Correctly save and restore FP registers in cctest/ConvertDToI to
avoid accidental register overwriting by the generated code.

Note: This failure is manifested only in R6 mode.

TEST=test/cctest/interpreter/test-interpreter
BUG=

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

Cr-Commit-Position: refs/heads/master@{#30700}
parent d1ca0121
......@@ -62,6 +62,11 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
// Save callee save registers.
__ MultiPush(kCalleeSaved | ra.bit());
// Save callee-saved FPU registers.
__ MultiPushFPU(kCalleeSavedFPU);
// Set up the reserved register for 0.0.
__ Move(kDoubleRegZero, 0.0);
// For softfp, move the input value into f12.
if (IsMipsSoftFloatABI) {
__ Move(f12, a0, a1);
......@@ -117,6 +122,9 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
__ Branch(&ok, eq, v0, Operand(zero_reg));
__ bind(&ok);
// Restore callee-saved FPU registers.
__ MultiPopFPU(kCalleeSavedFPU);
// Restore callee save registers.
__ MultiPop(kCalleeSaved | ra.bit());
......
......@@ -62,6 +62,11 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
// Save callee save registers.
__ MultiPush(kCalleeSaved | ra.bit());
// Save callee-saved FPU registers.
__ MultiPushFPU(kCalleeSavedFPU);
// Set up the reserved register for 0.0.
__ Move(kDoubleRegZero, 0.0);
// For softfp, move the input value into f12.
if (IsMipsSoftFloatABI) {
__ Move(f12, a0, a1);
......@@ -117,6 +122,9 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
__ Branch(&ok, eq, v0, Operand(zero_reg));
__ bind(&ok);
// Restore callee-saved FPU registers.
__ MultiPopFPU(kCalleeSavedFPU);
// Restore callee save registers.
__ MultiPop(kCalleeSaved | ra.bit());
......
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