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

Unified Diff: src/ppc/macro-assembler-ppc.cc

Issue 1797383002: Refine Word32Pair* shift code generation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/macro-assembler-ppc.cc
diff --git a/src/ppc/macro-assembler-ppc.cc b/src/ppc/macro-assembler-ppc.cc
index 863adc492cf196ac2360095010e091a6b4c70003..100ed2f328837674838aa5018ca0d1d7a71fcd3e 100644
--- a/src/ppc/macro-assembler-ppc.cc
+++ b/src/ppc/macro-assembler-ppc.cc
@@ -860,7 +860,10 @@ void MacroAssembler::ShiftLeftPair(Register dst_low, Register dst_high,
uint32_t shift) {
DCHECK(!AreAliased(dst_low, src_high));
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;
slwi(dst_high, src_low, Operand(shift));
li(dst_low, Operand::Zero());
@@ -903,7 +906,10 @@ void MacroAssembler::ShiftRightPair(Register dst_low, Register dst_high,
uint32_t shift) {
DCHECK(!AreAliased(dst_low, src_high));
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;
srwi(dst_low, src_high, Operand(shift));
li(dst_high, Operand::Zero());
@@ -946,7 +952,10 @@ void MacroAssembler::ShiftRightAlgPair(Register dst_low, Register dst_high,
uint32_t shift) {
DCHECK(!AreAliased(dst_low, src_high));
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;
srawi(dst_low, src_high, shift);
srawi(dst_high, src_high, 31);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698