Commit 471a8937 authored by Zhao Jiazhong's avatar Zhao Jiazhong Committed by Commit Bot

[mips32] Fix Float64 Abs operation

The lower 32 bits of output FPURegister is undefined now, this CL
copies the input FPURegister's lower 32 bits to output FPURegister.

Change-Id: I10c078fafeddd5de207ced4f7c01f35d32999733
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2449153Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#70302}
parent c8f73f22
...@@ -1336,15 +1336,19 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1336,15 +1336,19 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ MovFromFloatResult(i.OutputDoubleRegister()); __ MovFromFloatResult(i.OutputDoubleRegister());
break; break;
} }
case kMipsAbsD: case kMipsAbsD: {
FPURegister src = i.InputDoubleRegister(0);
FPURegister dst = i.OutputDoubleRegister();
if (IsMipsArchVariant(kMips32r6)) { if (IsMipsArchVariant(kMips32r6)) {
__ abs_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); __ abs_d(dst, src);
} else { } else {
__ mfhc1(kScratchReg, i.InputDoubleRegister(0)); __ Move(dst, src);
__ mfhc1(kScratchReg, src);
__ Ins(kScratchReg, zero_reg, 31, 1); __ Ins(kScratchReg, zero_reg, 31, 1);
__ mthc1(kScratchReg, i.OutputDoubleRegister()); __ mthc1(kScratchReg, dst);
} }
break; break;
}
case kMipsNegS: case kMipsNegS:
__ Neg_s(i.OutputSingleRegister(), i.InputSingleRegister(0)); __ Neg_s(i.OutputSingleRegister(), i.InputSingleRegister(0));
break; break;
......
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