Commit c423e985 authored by mbrandy's avatar mbrandy Committed by Commit bot

Refine Word32Pair* shift code generation.

R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#34796}
parent 3b5e84ab
...@@ -860,7 +860,10 @@ void MacroAssembler::ShiftLeftPair(Register dst_low, Register dst_high, ...@@ -860,7 +860,10 @@ void MacroAssembler::ShiftLeftPair(Register dst_low, Register dst_high,
uint32_t shift) { uint32_t shift) {
DCHECK(!AreAliased(dst_low, src_high)); DCHECK(!AreAliased(dst_low, src_high));
DCHECK(!AreAliased(dst_high, src_low)); DCHECK(!AreAliased(dst_high, src_low));
if (shift >= 32) { if (shift == 32) {
Move(dst_high, src_low);
li(dst_low, Operand::Zero());
} else if (shift > 32) {
shift &= 0x1f; shift &= 0x1f;
slwi(dst_high, src_low, Operand(shift)); slwi(dst_high, src_low, Operand(shift));
li(dst_low, Operand::Zero()); li(dst_low, Operand::Zero());
...@@ -903,7 +906,10 @@ void MacroAssembler::ShiftRightPair(Register dst_low, Register dst_high, ...@@ -903,7 +906,10 @@ void MacroAssembler::ShiftRightPair(Register dst_low, Register dst_high,
uint32_t shift) { uint32_t shift) {
DCHECK(!AreAliased(dst_low, src_high)); DCHECK(!AreAliased(dst_low, src_high));
DCHECK(!AreAliased(dst_high, src_low)); DCHECK(!AreAliased(dst_high, src_low));
if (shift >= 32) { if (shift == 32) {
Move(dst_low, src_high);
li(dst_high, Operand::Zero());
} else if (shift > 32) {
shift &= 0x1f; shift &= 0x1f;
srwi(dst_low, src_high, Operand(shift)); srwi(dst_low, src_high, Operand(shift));
li(dst_high, Operand::Zero()); li(dst_high, Operand::Zero());
...@@ -946,7 +952,10 @@ void MacroAssembler::ShiftRightAlgPair(Register dst_low, Register dst_high, ...@@ -946,7 +952,10 @@ void MacroAssembler::ShiftRightAlgPair(Register dst_low, Register dst_high,
uint32_t shift) { uint32_t shift) {
DCHECK(!AreAliased(dst_low, src_high)); DCHECK(!AreAliased(dst_low, src_high));
DCHECK(!AreAliased(dst_high, src_low)); DCHECK(!AreAliased(dst_high, src_low));
if (shift >= 32) { if (shift == 32) {
Move(dst_low, src_high);
srawi(dst_high, src_high, 31);
} else if (shift > 32) {
shift &= 0x1f; shift &= 0x1f;
srawi(dst_low, src_high, shift); srawi(dst_low, src_high, shift);
srawi(dst_high, src_high, 31); srawi(dst_high, src_high, 31);
......
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