Bug 673314: Enable generation of multiply instructions on ARM. r=adrake
authorMartin Rosenberg <mrosenberg@mozilla.com>
Thu, 28 Jul 2011 09:35:22 -0700
changeset 73514 6591070ab016
parent 73513 35bd1513465d
child 73515 d146b9c0f92e
push id20884
push usermak77@bonardo.net
push dateFri, 29 Jul 2011 09:49:02 +0000
treeherdermozilla-central@f5f1e3822540 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadrake
bugs673314
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 673314: Enable generation of multiply instructions on ARM. r=adrake
js/src/methodjit/FastArithmetic.cpp
--- a/js/src/methodjit/FastArithmetic.cpp
+++ b/js/src/methodjit/FastArithmetic.cpp
@@ -242,22 +242,18 @@ mjit::Compiler::jsop_binary(JSOp op, Voi
         return;
 
     /*
      * Bail out if there are unhandled types or ops.
      * This is temporary while ops are still being implemented.
      */
     if ((op == JSOP_MOD) ||
         (lhs->isTypeKnown() && (lhs->getKnownType() > JSVAL_UPPER_INCL_TYPE_OF_NUMBER_SET)) ||
-        (rhs->isTypeKnown() && (rhs->getKnownType() > JSVAL_UPPER_INCL_TYPE_OF_NUMBER_SET)) 
-#if defined(JS_CPU_ARM)
-        /* ARM cannot detect integer overflow with multiplication. */
-        || op == JSOP_MUL
-#endif /* JS_CPU_ARM */
-    ) {
+        (rhs->isTypeKnown() && (rhs->getKnownType() > JSVAL_UPPER_INCL_TYPE_OF_NUMBER_SET)))
+    {
         bool isStringResult = (op == JSOP_ADD) &&
                               (lhs->isType(JSVAL_TYPE_STRING) ||
                                rhs->isType(JSVAL_TYPE_STRING));
 
         prepareStubCall(Uses(2));
         INLINE_STUBCALL(stub);
         frame.popn(2);
         if (isStringResult)
@@ -440,21 +436,19 @@ mjit::Compiler::jsop_binary_full_simple(
       case JSOP_ADD:
         overflow = masm.branchAdd32(Assembler::Overflow, regs.result, regs.result);
         break;
 
       case JSOP_SUB:
         overflow = masm.branchSub32(Assembler::Overflow, regs.result, regs.result);
         break;
 
-#if !defined(JS_CPU_ARM)
       case JSOP_MUL:
         overflow = masm.branchMul32(Assembler::Overflow, regs.result, regs.result);
         break;
-#endif
 
       default:
         JS_NOT_REACHED("unrecognized op");
     }
     
     JS_ASSERT(overflow.isSet());
 
     /*
@@ -624,17 +618,16 @@ mjit::Compiler::jsop_binary_full(FrameEn
 
       case JSOP_SUB:
         if (reg.isSet())
             overflow = masm.branchSub32(Assembler::Overflow, reg.reg(), regs.result);
         else
             overflow = masm.branchSub32(Assembler::Overflow, Imm32(value), regs.result);
         break;
 
-#if !defined(JS_CPU_ARM)
       case JSOP_MUL:
       {
         JS_ASSERT(reg.isSet());
         
         MaybeJump storeNegZero;
         bool maybeNegZero = true;
         bool hasConstant = (lhs->isConstant() || rhs->isConstant());
         
@@ -677,17 +670,16 @@ mjit::Compiler::jsop_binary_full(FrameEn
                 stubcc.linkExitDirect(storeNegZero.get(), stubcc.masm.label());
             }
             stubcc.masm.storeValue(DoubleValue(-0.0), frame.addressOf(lhs));
             stubcc.masm.loadPayload(frame.addressOf(lhs), regs.result);
             negZeroDone = stubcc.masm.jump();
         }
         break;
       }
-#endif
 
       default:
         JS_NOT_REACHED("unrecognized op");
     }
     op = origOp;
     
     JS_ASSERT(overflow.isSet());