Fix SHL when shift amount is zero for arm and mips.
authorulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 31 Jul 2013 12:46:54 +0000 (12:46 +0000)
committerulan@chromium.org <ulan@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 31 Jul 2013 12:46:54 +0000 (12:46 +0000)
BUG=v8:2817
R=titzer@chromium.org
TEST=octane

Review URL: https://chromiumcodereview.appspot.com/21358002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15987 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/arm/lithium-codegen-arm.cc
src/mips/lithium-codegen-mips.cc

index 974bcccb11646d8ec8a0ea4db4494a5b374802fe..a92604ecbf0e37040c0e526f1302bd655e6e2f82 100644 (file)
@@ -1746,8 +1746,10 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
               instr->can_deopt()) {
             if (shift_count != 1) {
               __ mov(result, Operand(left, LSL, shift_count - 1));
+              __ SmiTag(result, result, SetCC);
+            } else {
+              __ SmiTag(result, left, SetCC);
             }
-            __ SmiTag(result, result, SetCC);
             DeoptimizeIf(vs, instr->environment());
           } else {
             __ mov(result, Operand(left, LSL, shift_count));
index 85528f0ab24de850dbbf1628fecff02b43b47f0e..d7d12411d40c8b5ece5423709696a674c7ea67fc 100644 (file)
@@ -1585,8 +1585,10 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
               instr->can_deopt()) {
             if (shift_count != 1) {
               __ sll(result, left, shift_count - 1);
+              __ SmiTagCheckOverflow(result, result, scratch);
+            } else {
+              __ SmiTagCheckOverflow(result, left, scratch);
             }
-            __ SmiTagCheckOverflow(result, result, scratch);
             DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg));
           } else {
             __ sll(result, left, shift_count);