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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 401683003: Specialize mint shift code on arm for a constant shift amount. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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 | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/locations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 38346)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -6038,7 +6038,6 @@
}
default:
UNREACHABLE();
- break;
}
} else {
// Code for a variable shift amount.
@@ -6061,10 +6060,10 @@
__ jmp(&done, Assembler::kNearJump);
__ Bind(&large_shift);
- __ subl(ECX, Immediate(32));
+ // No need to subtract 32 from CL, only 5 bits used by sarl.
__ movl(left_lo, left_hi); // Shift by 32.
__ sarl(left_hi, Immediate(31)); // Sign extend left hi.
- __ sarl(left_lo, ECX); // Shift count - 32 in CL.
+ __ sarl(left_lo, ECX); // Shift count: CL % 32.
break;
}
case Token::kSHL: {
@@ -6086,10 +6085,10 @@
__ jmp(&done, Assembler::kNearJump);
__ Bind(&large_shift);
- __ subl(ECX, Immediate(32));
+ // No need to subtract 32 from CL, only 5 bits used by shll.
__ movl(left_hi, left_lo); // Shift by 32.
__ xorl(left_lo, left_lo); // Zero left_lo.
- __ shll(left_hi, ECX); // Shift count in CL.
+ __ shll(left_hi, ECX); // Shift count: CL % 32.
// Check for overflow by sign extending the high 32 bits
// and comparing with the input.
__ movl(temp2, left_hi);
@@ -6105,10 +6104,10 @@
__ jmp(&done, Assembler::kNearJump);
__ Bind(&large_shift);
- __ subl(ECX, Immediate(32));
+ // No need to subtract 32 from CL, only 5 bits used by shll.
__ movl(left_hi, left_lo); // Shift by 32.
__ xorl(left_lo, left_lo); // Zero left_lo.
- __ shll(left_hi, ECX); // Shift count in CL.
+ __ shll(left_hi, ECX); // Shift count: CL % 32.
}
break;
}
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/locations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698