Bug 713463 - Support JM+TI for architectures without native square root. r=dmandelin
authorCameron Kaiser <spectre@armory.com>
Thu, 29 Dec 2011 12:36:22 +0100
changeset 84732 c443d73c4346d7d873f2774f37d67aadf8543bed
parent 84731 565bca74dca39f2fcb522650514c3aba475b3a6f
child 84733 29b864db2073f2d252439b1549a17e91fbbe3909
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmandelin
bugs713463
milestone12.0a1
Bug 713463 - Support JM+TI for architectures without native square root. r=dmandelin
js/src/methodjit/FastBuiltins.cpp
--- a/js/src/methodjit/FastBuiltins.cpp
+++ b/js/src/methodjit/FastBuiltins.cpp
@@ -904,16 +904,17 @@ mjit::Compiler::inlineNativeFunction(uin
             type == JSVAL_TYPE_INT32) {
             return compileRound(arg, Floor);
         }
         if (native == js_math_round && argType == JSVAL_TYPE_DOUBLE &&
             type == JSVAL_TYPE_INT32) {
             return compileRound(arg, Round);
         }
         if (native == js_math_sqrt && type == JSVAL_TYPE_DOUBLE &&
+             masm.supportsFloatingPointSqrt() &&
             (argType == JSVAL_TYPE_INT32 || argType == JSVAL_TYPE_DOUBLE)) {
             return compileMathSqrt(arg);
         }
         if (native == js_str_charCodeAt && argType == JSVAL_TYPE_INT32 &&
             thisType == JSVAL_TYPE_STRING && type == JSVAL_TYPE_INT32) {
             return compileGetChar(thisValue, arg, GetCharCode);
         }
         if (native == js_str_charAt && argType == JSVAL_TYPE_INT32 &&
@@ -944,16 +945,17 @@ mjit::Compiler::inlineNativeFunction(uin
     } else if (argc == 2) {
         FrameEntry *arg1 = frame.peek(-2);
         FrameEntry *arg2 = frame.peek(-1);
 
         JSValueType arg1Type = arg1->isTypeKnown() ? arg1->getKnownType() : JSVAL_TYPE_UNKNOWN;
         JSValueType arg2Type = arg2->isTypeKnown() ? arg2->getKnownType() : JSVAL_TYPE_UNKNOWN;
 
         if (native == js_math_pow && type == JSVAL_TYPE_DOUBLE &&
+             masm.supportsFloatingPointSqrt() &&
             (arg1Type == JSVAL_TYPE_DOUBLE || arg1Type == JSVAL_TYPE_INT32) &&
             arg2Type == JSVAL_TYPE_DOUBLE && arg2->isConstant())
         {
             Value arg2Value = arg2->getValue();
             if (arg2Value.toDouble() == -0.5 || arg2Value.toDouble() == 0.5)
                 return compileMathPowSimple(arg1, arg2);
         }
         if ((native == js_math_min || native == js_math_max)) {