Bug 1150836 - SIMD (interpreter): change order of operations of ReciprocalSqrtApproximation. r=bbouvier

This commit is contained in:
ProgramFOX 2015-04-08 14:04:58 +02:00
parent d7edd2b33d
commit 574d13da7d
3 changed files with 3 additions and 3 deletions

View File

@ -508,7 +508,7 @@ struct RecApprox {
};
template<typename T>
struct RecSqrtApprox {
static inline T apply(T x) { return sqrt(1 / x); }
static inline T apply(T x) { return 1 / sqrt(x); }
};
template<typename T>
struct Sqrt {

View File

@ -6,7 +6,7 @@ var int32x4 = SIMD.int32x4;
var summary = 'float32x4 reciprocalSqrt';
function reciprocalsqrtf(a) {
return Math.fround(Math.sqrt(1 / Math.fround(a)));
return Math.fround(1 / Math.sqrt(a));
}
function test() {

View File

@ -15,7 +15,7 @@ function mul(a, b) { return a * b; }
function div(a, b) { return a / b; }
function neg(a) { return -a; }
function reciprocalApproximation(a) { return 1 / a; }
function reciprocalSqrtApproximation(a) { return Math.sqrt(1 / a); }
function reciprocalSqrtApproximation(a) { return 1 / Math.sqrt(a); }
function testAdd(v, w) {
return testBinaryFunc(v, w, float64x2.add, add);