diff --git a/js/src/builtin/SIMD.h b/js/src/builtin/SIMD.h index 6aa76a9dcee..b4ef96bed43 100644 --- a/js/src/builtin/SIMD.h +++ b/js/src/builtin/SIMD.h @@ -23,14 +23,14 @@ #define FLOAT32X4_UNARY_FUNCTION_LIST(V) \ V(abs, (Func, Float32x4>), 1, 0, Abs) \ - V(bitsToInt32x4, (FuncConvertBits), 1, 0, BitsToInt32x4) \ + V(fromInt32x4Bits, (FuncConvertBits), 1, 0, FromInt32x4Bits) \ V(neg, (Func, Float32x4>), 1, 0, Neg) \ V(not, (CoercedFunc, Float32x4>), 1, 0, Not) \ V(reciprocal, (Func, Float32x4>), 1, 0, Reciprocal) \ V(reciprocalSqrt, (Func, Float32x4>), 1, 0, ReciprocalSqrt) \ V(splat, (FuncSplat), 1, 0, Splat) \ V(sqrt, (Func, Float32x4>), 1, 0, Sqrt) \ - V(toInt32x4, (FuncConvert), 1, 0, ToInt32x4) + V(fromInt32x4, (FuncConvert ), 1, 0, FromInt32x4) #define FLOAT32X4_BINARY_FUNCTION_LIST(V) \ V(add, (Func, Float32x4>), 2, 0, Add) \ @@ -69,11 +69,11 @@ V(zero, (FuncZero), 0, 0, Zero) #define INT32X4_UNARY_FUNCTION_LIST(V) \ - V(bitsToFloat32x4, (FuncConvertBits), 1, 0, BitsToFloat32x4) \ + V(fromFloat32x4Bits, (FuncConvertBits), 1, 0, FromFloat32x4Bits) \ V(neg, (Func, Int32x4>), 1, 0, Neg) \ V(not, (Func, Int32x4>), 1, 0, Not) \ V(splat, (FuncSplat), 0, 0, Splat) \ - V(toFloat32x4, (FuncConvert), 1, 0, ToFloat32x4) + V(fromFloat32x4, (FuncConvert), 1, 0, FromFloat32x4) #define INT32X4_BINARY_FUNCTION_LIST(V) \ V(add, (Func, Int32x4>), 2, 0, Add) \ diff --git a/js/src/tests/ecma_6/TypedObject/simd/bug953270.js b/js/src/tests/ecma_6/TypedObject/simd/bug953270.js index 74ac44dc92b..bc591a9fd08 100644 --- a/js/src/tests/ecma_6/TypedObject/simd/bug953270.js +++ b/js/src/tests/ecma_6/TypedObject/simd/bug953270.js @@ -13,14 +13,14 @@ var summary = 'Handles'; var int32x4 = SIMD.int32x4; var a = int32x4((4294967295), 200, 300, 400); -var c = SIMD.int32x4.bitsToFloat32x4(a); +var c = SIMD.float32x4.fromInt32x4Bits(a); // NaN canonicalization occurs when extracting out x lane: assertEq(c.x, NaN); // but underlying bits are faithfully transmitted // (though reinterpreted as a signed integer): -var d = SIMD.float32x4.bitsToInt32x4(c); +var d = SIMD.int32x4.fromFloat32x4Bits(c); assertEq(d.x, -1); reportCompare(true, true); diff --git a/js/src/tests/ecma_6/TypedObject/simd/int32x4tofloat32x4.js b/js/src/tests/ecma_6/TypedObject/simd/float32x4fromint32x4.js similarity index 85% rename from js/src/tests/ecma_6/TypedObject/simd/int32x4tofloat32x4.js rename to js/src/tests/ecma_6/TypedObject/simd/float32x4fromint32x4.js index 569eb336a20..fe8428254d6 100644 --- a/js/src/tests/ecma_6/TypedObject/simd/int32x4tofloat32x4.js +++ b/js/src/tests/ecma_6/TypedObject/simd/float32x4fromint32x4.js @@ -3,7 +3,7 @@ var BUGNUMBER = 946042; var float32x4 = SIMD.float32x4; var int32x4 = SIMD.int32x4; -var summary = 'int32x4 toFloat32x4'; +var summary = 'float32x4 fromInt32x4'; function test() { print(BUGNUMBER + ": " + summary); @@ -11,7 +11,7 @@ function test() { // FIXME -- Bug 948379: Amend to check for correctness of border cases. var a = int32x4(1, 2, 3, 4); - var c = SIMD.int32x4.toFloat32x4(a); + var c = SIMD.float32x4.fromInt32x4(a); assertEq(c.x, 1); assertEq(c.y, 2); assertEq(c.z, 3); diff --git a/js/src/tests/ecma_6/TypedObject/simd/int32x4bitstofloat32x4.js b/js/src/tests/ecma_6/TypedObject/simd/float32x4fromint32x4bits.js similarity index 86% rename from js/src/tests/ecma_6/TypedObject/simd/int32x4bitstofloat32x4.js rename to js/src/tests/ecma_6/TypedObject/simd/float32x4fromint32x4bits.js index 371817e935f..90b07c3e97d 100644 --- a/js/src/tests/ecma_6/TypedObject/simd/int32x4bitstofloat32x4.js +++ b/js/src/tests/ecma_6/TypedObject/simd/float32x4fromint32x4bits.js @@ -3,7 +3,7 @@ var BUGNUMBER = 946042; var float32x4 = SIMD.float32x4; var int32x4 = SIMD.int32x4; -var summary = 'int32x4 bitsToFloat32x4'; +var summary = 'float32x4 fromInt32x4Bits'; function test() { print(BUGNUMBER + ": " + summary); @@ -11,7 +11,7 @@ function test() { // FIXME -- Bug 948379: Amend to check for correctness of border cases. var a = int32x4(100, 200, 300, 400); - var c = SIMD.int32x4.bitsToFloat32x4(a); + var c = SIMD.float32x4.fromInt32x4Bits(a); assertEq(c.x, 1.401298464324817e-43); assertEq(c.y, 2.802596928649634e-43); assertEq(c.z, 4.203895392974451e-43); diff --git a/js/src/tests/ecma_6/TypedObject/simd/float32x4toint32x4.js b/js/src/tests/ecma_6/TypedObject/simd/int32x4fromfloat32x4.js similarity index 85% rename from js/src/tests/ecma_6/TypedObject/simd/float32x4toint32x4.js rename to js/src/tests/ecma_6/TypedObject/simd/int32x4fromfloat32x4.js index 3b191733f61..87063663728 100644 --- a/js/src/tests/ecma_6/TypedObject/simd/float32x4toint32x4.js +++ b/js/src/tests/ecma_6/TypedObject/simd/int32x4fromfloat32x4.js @@ -3,7 +3,7 @@ var BUGNUMBER = 946042; var float32x4 = SIMD.float32x4; var int32x4 = SIMD.int32x4; -var summary = 'float32x4 toInt32x4'; +var summary = 'int32x4 fromFloat32x4'; function test() { print(BUGNUMBER + ": " + summary); @@ -11,7 +11,7 @@ function test() { // FIXME -- Bug 948379: Amend to check for correctness of border cases. var a = float32x4(1.1, 2.2, 3.3, 4.6); - var c = SIMD.float32x4.toInt32x4(a); + var c = SIMD.int32x4.fromFloat32x4(a); assertEq(c.x, 1); assertEq(c.y, 2); assertEq(c.z, 3); diff --git a/js/src/tests/ecma_6/TypedObject/simd/float32x4bitstoint32x4.js b/js/src/tests/ecma_6/TypedObject/simd/int32x4fromfloat32x4bits.js similarity index 85% rename from js/src/tests/ecma_6/TypedObject/simd/float32x4bitstoint32x4.js rename to js/src/tests/ecma_6/TypedObject/simd/int32x4fromfloat32x4bits.js index c4ac600d0e0..83b2dab16c7 100644 --- a/js/src/tests/ecma_6/TypedObject/simd/float32x4bitstoint32x4.js +++ b/js/src/tests/ecma_6/TypedObject/simd/int32x4fromfloat32x4bits.js @@ -3,7 +3,7 @@ var BUGNUMBER = 946042; var float32x4 = SIMD.float32x4; var int32x4 = SIMD.int32x4; -var summary = 'float32x4 bitsToInt32x4'; +var summary = 'int32x4 fromFloat32x4Bits'; function test() { print(BUGNUMBER + ": " + summary); @@ -11,7 +11,7 @@ function test() { // FIXME -- Bug 948379: Amend to check for correctness of border cases. var a = float32x4(1, 2, 3, 4); - var c = SIMD.float32x4.bitsToInt32x4(a); + var c = SIMD.int32x4.fromFloat32x4Bits(a); assertEq(c.x, 1065353216); assertEq(c.y, 1073741824); assertEq(c.z, 1077936128);