Commit 6f76cc56 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC: Sign-extended result in DoFlooringDivI/DoDivI on 64bit

     result is sign-extended on 64bit for functions
     LCodeGen::DoFlooringDivI and LCodeGen::DoDivI

R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2029273002
Cr-Commit-Position: refs/heads/master@{#36661}
parent 2fd3f9d6
...@@ -1140,6 +1140,10 @@ void LCodeGen::DoDivI(LDivI* instr) { ...@@ -1140,6 +1140,10 @@ void LCodeGen::DoDivI(LDivI* instr) {
} }
} }
#if V8_TARGET_ARCH_PPC64
__ extsw(result, result);
#endif
if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) { if (!hdiv->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) {
// Deoptimize if remainder is not 0. // Deoptimize if remainder is not 0.
Register scratch = scratch0(); Register scratch = scratch0();
...@@ -1333,6 +1337,9 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) { ...@@ -1333,6 +1337,9 @@ void LCodeGen::DoFlooringDivI(LFlooringDivI* instr) {
// We performed a truncating division. Correct the result. // We performed a truncating division. Correct the result.
__ subi(result, result, Operand(1)); __ subi(result, result, Operand(1));
__ bind(&done); __ bind(&done);
#if V8_TARGET_ARCH_PPC64
__ extsw(result, result);
#endif
} }
......
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