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

Unified Diff: dart/runtime/vm/intermediate_language_ia32.cc

Issue 754763003: Version 1.8.3 (Closed) Base URL: http://dart.googlecode.com/svn/branches/1.8/
Patch Set: Created 6 years 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 | « dart/runtime/vm/intermediate_language_arm.cc ('k') | dart/runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/vm/intermediate_language_ia32.cc
===================================================================
--- dart/runtime/vm/intermediate_language_ia32.cc (revision 42037)
+++ dart/runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -5921,7 +5921,6 @@
__ movl(temp1, left_hi); // Preserve high 32 bits.
if (shift > 31) {
__ movl(left_hi, left_lo); // Shift by 32.
- __ xorl(left_lo, left_lo); // Zero left_lo.
if (shift > 32) {
__ shll(left_hi, Immediate(shift - 32));
}
@@ -5931,6 +5930,15 @@
__ sarl(temp2, Immediate(31));
__ cmpl(temp1, temp2);
__ j(NOT_EQUAL, deopt);
+ if (shift > 32) {
+ // Also compare low word from input with high word from
+ // output shifted back shift - 32.
+ __ movl(temp2, left_hi);
+ __ sarl(temp2, Immediate(shift - 32));
+ __ cmpl(left_lo, temp2);
+ __ j(NOT_EQUAL, deopt);
+ }
+ __ xorl(left_lo, left_lo); // Zero left_lo.
} else {
__ shldl(left_hi, left_lo, Immediate(shift));
__ shll(left_lo, Immediate(shift));
@@ -6006,7 +6014,6 @@
__ Bind(&large_shift);
// 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: CL % 32.
// Check for overflow by sign extending the high 32 bits
// and comparing with the input.
@@ -6014,6 +6021,13 @@
__ sarl(temp2, Immediate(31));
__ cmpl(temp1, temp2);
__ j(NOT_EQUAL, deopt);
+ // Also compare low word from input with high word from
+ // output shifted back shift - 32.
+ __ movl(temp2, left_hi);
+ __ sarl(temp2, ECX); // Shift count: CL % 32.
+ __ cmpl(left_lo, temp2);
+ __ j(NOT_EQUAL, deopt);
+ __ xorl(left_lo, left_lo); // Zero left_lo.
} else {
__ cmpl(ECX, Immediate(31));
__ j(ABOVE, &large_shift);
« no previous file with comments | « dart/runtime/vm/intermediate_language_arm.cc ('k') | dart/runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698