Bug 1102893: Remove some SIMD.js outdated functions; r=till
authorBenjamin Bouvier <benj@benj.me>
Mon, 24 Nov 2014 16:09:34 +0100
changeset 241555 2471a54e5a5ae336d633841a1a23fe561610ab05
parent 241554 66c241782eed86eb4cceff8d1826c032562a4812
child 241556 9188c8b7962b5b20e564b3ba1f6df2b12a0a0f7d
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs1102893
milestone36.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 1102893: Remove some SIMD.js outdated functions; r=till
js/src/builtin/SIMD.cpp
js/src/builtin/SIMD.h
js/src/tests/ecma_6/TypedObject/simd/float32x4scale.js
js/src/tests/ecma_6/TypedObject/simd/int32x4withflag.js
--- a/js/src/builtin/SIMD.cpp
+++ b/js/src/builtin/SIMD.cpp
@@ -554,51 +554,31 @@ template<typename T>
 struct And {
     static inline T apply(T l, T r) { return l & r; }
 };
 template<typename T>
 struct Or {
     static inline T apply(T l, T r) { return l | r; }
 };
 template<typename T>
-struct Scale {
-    static inline T apply(int32_t lane, T scalar, T x) { return scalar * x; }
-};
-template<typename T>
 struct WithX {
     static inline T apply(int32_t lane, T scalar, T x) { return lane == 0 ? scalar : x; }
 };
 template<typename T>
 struct WithY {
     static inline T apply(int32_t lane, T scalar, T x) { return lane == 1 ? scalar : x; }
 };
 template<typename T>
 struct WithZ {
     static inline T apply(int32_t lane, T scalar, T x) { return lane == 2 ? scalar : x; }
 };
 template<typename T>
 struct WithW {
     static inline T apply(int32_t lane, T scalar, T x) { return lane == 3 ? scalar : x; }
 };
-template<typename T>
-struct WithFlagX {
-    static inline T apply(T l, T f, T x) { return l == 0 ? (f ? 0xFFFFFFFF : 0x0) : x; }
-};
-template<typename T>
-struct WithFlagY {
-    static inline T apply(T l, T f, T x) { return l == 1 ? (f ? 0xFFFFFFFF : 0x0) : x; }
-};
-template<typename T>
-struct WithFlagZ {
-    static inline T apply(T l, T f, T x) { return l == 2 ? (f ? 0xFFFFFFFF : 0x0) : x; }
-};
-template<typename T>
-struct WithFlagW {
-    static inline T apply(T l, T f, T x) { return l == 3 ? (f ? 0xFFFFFFFF : 0x0) : x; }
-};
 struct ShiftLeft {
     static inline int32_t apply(int32_t v, int32_t bits) { return v << bits; }
 };
 struct ShiftRight {
     static inline int32_t apply(int32_t v, int32_t bits) { return v >> bits; }
 };
 struct ShiftRightLogical {
     static inline int32_t apply(int32_t v, int32_t bits) { return uint32_t(v) >> (bits & 31); }
--- a/js/src/builtin/SIMD.h
+++ b/js/src/builtin/SIMD.h
@@ -13,19 +13,16 @@
 #include "vm/GlobalObject.h"
 
 /*
  * JS SIMD functions.
  * Spec matching polyfill:
  * https://github.com/johnmccutchan/ecmascript_simd/blob/master/src/ecmascript_simd.js
  */
 
-#define FLOAT32X4_NULLARY_FUNCTION_LIST(V)                                          \
-  V(zero, (FuncZero<Float32x4>), 0, 0)
-
 #define FLOAT32X4_UNARY_FUNCTION_LIST(V)                                            \
   V(abs, (UnaryFunc<Float32x4, Abs, Float32x4>), 1, 0)                              \
   V(fromInt32x4, (FuncConvert<Int32x4, Float32x4> ), 1, 0)                          \
   V(fromInt32x4Bits, (FuncConvertBits<Int32x4, Float32x4>), 1, 0)                   \
   V(neg, (UnaryFunc<Float32x4, Neg, Float32x4>), 1, 0)                              \
   V(not, (CoercedUnaryFunc<Float32x4, Int32x4, Not, Float32x4>), 1, 0)              \
   V(reciprocal, (UnaryFunc<Float32x4, Rec, Float32x4>), 1, 0)                       \
   V(reciprocalSqrt, (UnaryFunc<Float32x4, RecSqrt, Float32x4>), 1, 0)               \
@@ -47,17 +44,16 @@
   V(loadX,   (Load<Float32x4, 1>), 2, 0)                                            \
   V(max, (BinaryFunc<Float32x4, Maximum, Float32x4>), 2, 0)                         \
   V(maxNum, (BinaryFunc<Float32x4, MaxNum, Float32x4>), 2, 0)                       \
   V(min, (BinaryFunc<Float32x4, Minimum, Float32x4>), 2, 0)                         \
   V(minNum, (BinaryFunc<Float32x4, MinNum, Float32x4>), 2, 0)                       \
   V(mul, (BinaryFunc<Float32x4, Mul, Float32x4>), 2, 0)                             \
   V(notEqual, (CompareFunc<Float32x4, NotEqual>), 2, 0)                             \
   V(or, (CoercedBinaryFunc<Float32x4, Int32x4, Or, Float32x4>), 2, 0)               \
-  V(scale, (FuncWith<Float32x4, Scale>), 2, 0)                                      \
   V(store,    (Store<Float32x4, 4>), 3, 0)                                          \
   V(storeXYZ, (Store<Float32x4, 3>), 3, 0)                                          \
   V(storeXY,  (Store<Float32x4, 2>), 3, 0)                                          \
   V(storeX,   (Store<Float32x4, 1>), 3, 0)                                          \
   V(sub, (BinaryFunc<Float32x4, Sub, Float32x4>), 2, 0)                             \
   V(withX, (FuncWith<Float32x4, WithX>), 2, 0)                                      \
   V(withY, (FuncWith<Float32x4, WithY>), 2, 0)                                      \
   V(withZ, (FuncWith<Float32x4, WithZ>), 2, 0)                                      \
@@ -68,25 +64,21 @@
   V(clamp, Float32x4Clamp, 3, 0)                                                    \
   V(select, Float32x4Select, 3, 0)
 
 #define FLOAT32X4_SHUFFLE_FUNCTION_LIST(V)                                          \
   V(swizzle, Swizzle<Float32x4>, 2, 0)                                              \
   V(shuffle, Shuffle<Float32x4>, 3, 0)
 
 #define FLOAT32X4_FUNCTION_LIST(V)                                                  \
-  FLOAT32X4_NULLARY_FUNCTION_LIST(V)                                                \
   FLOAT32X4_UNARY_FUNCTION_LIST(V)                                                  \
   FLOAT32X4_BINARY_FUNCTION_LIST(V)                                                 \
   FLOAT32X4_TERNARY_FUNCTION_LIST(V)                                                \
   FLOAT32X4_SHUFFLE_FUNCTION_LIST(V)
 
-#define INT32X4_NULLARY_FUNCTION_LIST(V)                                            \
-  V(zero, (FuncZero<Int32x4>), 0, 0)
-
 #define INT32X4_UNARY_FUNCTION_LIST(V)                                              \
   V(fromFloat32x4, (FuncConvert<Float32x4, Int32x4>), 1, 0)                         \
   V(fromFloat32x4Bits, (FuncConvertBits<Float32x4, Int32x4>), 1, 0)                 \
   V(neg, (UnaryFunc<Int32x4, Neg, Int32x4>), 1, 0)                                  \
   V(not, (UnaryFunc<Int32x4, Not, Int32x4>), 1, 0)                                  \
   V(splat, (FuncSplat<Int32x4>), 0, 0)
 
 #define INT32X4_BINARY_FUNCTION_LIST(V)                                             \
@@ -107,20 +99,16 @@
   V(sub, (BinaryFunc<Int32x4, Sub, Int32x4>), 2, 0)                                 \
   V(shiftLeft, (Int32x4BinaryScalar<ShiftLeft>), 2, 0)                              \
   V(shiftRight, (Int32x4BinaryScalar<ShiftRight>), 2, 0)                            \
   V(shiftRightLogical, (Int32x4BinaryScalar<ShiftRightLogical>), 2, 0)              \
   V(store,    (Store<Int32x4, 4>), 3, 0)                                            \
   V(storeXYZ, (Store<Int32x4, 3>), 3, 0)                                            \
   V(storeXY,  (Store<Int32x4, 2>), 3, 0)                                            \
   V(storeX,   (Store<Int32x4, 1>), 3, 0)                                            \
-  V(withFlagX, (FuncWith<Int32x4, WithFlagX>), 2, 0)                                \
-  V(withFlagY, (FuncWith<Int32x4, WithFlagY>), 2, 0)                                \
-  V(withFlagZ, (FuncWith<Int32x4, WithFlagZ>), 2, 0)                                \
-  V(withFlagW, (FuncWith<Int32x4, WithFlagW>), 2, 0)                                \
   V(withX, (FuncWith<Int32x4, WithX>), 2, 0)                                        \
   V(withY, (FuncWith<Int32x4, WithY>), 2, 0)                                        \
   V(withZ, (FuncWith<Int32x4, WithZ>), 2, 0)                                        \
   V(withW, (FuncWith<Int32x4, WithW>), 2, 0)                                        \
   V(xor, (BinaryFunc<Int32x4, Xor, Int32x4>), 2, 0)
 
 #define INT32X4_TERNARY_FUNCTION_LIST(V)                                            \
   V(select, Int32x4Select, 3, 0)                                                    \
@@ -128,17 +116,16 @@
 #define INT32X4_QUARTERNARY_FUNCTION_LIST(V)                                        \
   V(bool, Int32x4Bool, 4, 0)
 
 #define INT32X4_SHUFFLE_FUNCTION_LIST(V)                                            \
   V(swizzle, Swizzle<Int32x4>, 2, 0)                                                \
   V(shuffle, Shuffle<Int32x4>, 3, 0)
 
 #define INT32X4_FUNCTION_LIST(V)                                                    \
-  INT32X4_NULLARY_FUNCTION_LIST(V)                                                  \
   INT32X4_UNARY_FUNCTION_LIST(V)                                                    \
   INT32X4_BINARY_FUNCTION_LIST(V)                                                   \
   INT32X4_TERNARY_FUNCTION_LIST(V)                                                  \
   INT32X4_QUARTERNARY_FUNCTION_LIST(V)                                              \
   INT32X4_SHUFFLE_FUNCTION_LIST(V)
 
 #define FOREACH_INT32X4_SIMD_OP(_)   \
     _(fromFloat32x4)                 \
deleted file mode 100644
--- a/js/src/tests/ecma_6/TypedObject/simd/float32x4scale.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// |reftest| skip-if(!this.hasOwnProperty("SIMD"))
-var BUGNUMBER = 946042;
-var float32x4 = SIMD.float32x4;
-var int32x4 = SIMD.int32x4;
-
-var summary = 'float32x4 scale';
-
-function mulf(a, b) {
-  return Math.fround(Math.fround(a) * Math.fround(b));
-}
-
-function test() {
-  print(BUGNUMBER + ": " + summary);
-
-  var a = float32x4(1, 2, 3, 4);
-  var c = SIMD.float32x4.scale(a, 2);
-  assertEq(c.x, 2);
-  assertEq(c.y, 4);
-  assertEq(c.z, 6);
-  assertEq(c.w, 8);
-
-  var d = float32x4(1.34, 2.76, 3.21, 4.09);
-  var f = float32x4.scale(d, 2.54);
-  assertEq(f.x, mulf(1.34, 2.54));
-  assertEq(f.y, mulf(2.76, 2.54));
-  assertEq(f.z, mulf(3.21, 2.54));
-  assertEq(f.w, mulf(4.09, 2.54));
-
-  var g = float32x4(NaN, -0, Infinity, -Infinity);
-  var i = float32x4.scale(g, 2.54);
-  assertEq(i.x, NaN);
-  assertEq(i.y, -0);
-  assertEq(i.z, Infinity);
-  assertEq(i.w, -Infinity);
-
-  if (typeof reportCompare === "function")
-    reportCompare(true, true);
-}
-
-test();
-
deleted file mode 100644
--- a/js/src/tests/ecma_6/TypedObject/simd/int32x4withflag.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// |reftest| skip-if(!this.hasOwnProperty("SIMD"))
-var BUGNUMBER = 946042;
-var float32x4 = SIMD.float32x4;
-var int32x4 = SIMD.int32x4;
-
-var summary = 'int32x4 with';
-
-function test() {
-  print(BUGNUMBER + ": " + summary);
-
-  var a = int32x4(1, 2, 3, 4);
-  var x = SIMD.int32x4.withFlagX(a, true);
-  var y = SIMD.int32x4.withFlagY(a, false);
-  var z = SIMD.int32x4.withFlagZ(a, false);
-  var w = SIMD.int32x4.withFlagW(a, true);
-  assertEq(x.x, -1);
-  assertEq(y.y, 0);
-  assertEq(z.z, 0);
-  assertEq(w.w, -1);
-
-  if (typeof reportCompare === "function")
-    reportCompare(true, true);
-}
-
-test();
-