Revision: 13247
Author:   [email protected]
Date:     Thu Dec 20 01:07:05 2012
Log:      Fix ARM code for DoModI.

[email protected]
BUG=166379

Review URL: https://chromiumcodereview.appspot.com/11618020
http://code.google.com/p/v8/source/detail?r=13247

Modified:
 /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc

=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Tue Dec 18 08:25:45 2012 +++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Thu Dec 20 01:07:05 2012
@@ -1104,6 +1104,16 @@
       __ cmp(right, Operand(0));
       DeoptimizeIf(eq, instr->environment());
     }
+
+    // Check for (kMinInt % -1).
+    if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
+      Label left_not_min_int;
+      __ cmp(left, Operand(kMinInt));
+      __ b(ne, &left_not_min_int);
+      __ cmp(right, Operand(-1));
+      DeoptimizeIf(eq, instr->environment());
+      __ bind(&left_not_min_int);
+    }

     // For  r3 = r1 % r2; we can have the following ARM code
     // sdiv r3, r1, r2
@@ -1134,6 +1144,8 @@

     Label vfp_modulo, both_positive, right_negative;

+    CpuFeatures::Scope scope(VFP2);
+
     // Check for x % 0.
     if (instr->hydrogen()->CheckFlag(HValue::kCanBeDivByZero)) {
       __ cmp(right, Operand(0));
@@ -1356,7 +1368,7 @@
     __ bind(&left_not_zero);
   }

-  // Check for (-kMinInt / -1).
+  // Check for (kMinInt / -1).
   if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
     Label left_not_min_int;
     __ cmp(left, Operand(kMinInt));

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to