summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/SIMD/inline-missing-arguments.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/jit-test/tests/SIMD/inline-missing-arguments.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/jit-test/tests/SIMD/inline-missing-arguments.js')
-rw-r--r--js/src/jit-test/tests/SIMD/inline-missing-arguments.js81
1 files changed, 81 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/SIMD/inline-missing-arguments.js b/js/src/jit-test/tests/SIMD/inline-missing-arguments.js
new file mode 100644
index 000000000..5ef91d072
--- /dev/null
+++ b/js/src/jit-test/tests/SIMD/inline-missing-arguments.js
@@ -0,0 +1,81 @@
+load(libdir + 'simd.js');
+
+setJitCompilerOption("ion.warmup.trigger", 50);
+
+function test(i) {
+ assertEqX4(SIMD.Int32x4(), [0, 0, 0, 0]);
+ assertEqX4(SIMD.Int32x4(i), [i, 0, 0, 0]);
+ assertEqX4(SIMD.Int32x4(i, 1), [i, 1, 0, 0]);
+ assertEqX4(SIMD.Int32x4(i, 1, 2), [i, 1, 2, 0]);
+ assertEqX4(SIMD.Int32x4(i, 1, 2, 3), [i, 1, 2, 3]);
+ assertEqX4(SIMD.Int32x4(i, 1, 2, 3, 4), [i, 1, 2, 3]);
+
+ assertEqVecArr(SIMD.Int16x8(), [0, 0, 0, 0, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int16x8(i), [i, 0, 0, 0, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int16x8(i, 1), [i, 1, 0, 0, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int16x8(i, 1, 2), [i, 1, 2, 0, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int16x8(i, 1, 2, 3), [i, 1, 2, 3, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int16x8(i, 1, 2, 3, 4), [i, 1, 2, 3, 4, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int16x8(i, 1, 2, 3, 4, 5, 6),
+ [i, 1, 2, 3, 4, 5, 6, 0]);
+ j = i & 32
+ assertEqVecArr(SIMD.Int8x16(), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int8x16(j), [j, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int8x16(j, 1), [j, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int8x16(j, 1, 2), [j, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int8x16(j, 1, 2, 3), [j, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int8x16(j, 1, 2, 3, 4), [j, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int8x16(j, 1, 2, 3, 4, 5, 6),
+ [j, 1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+ assertEqVecArr(SIMD.Int8x16(j, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12),
+ [j, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 0, 0]);
+
+ assertEqX4(SIMD.Float32x4(), [NaN, NaN, NaN, NaN]);
+ assertEqX4(SIMD.Float32x4(i), [i, NaN, NaN, NaN]);
+ assertEqX4(SIMD.Float32x4(i, 1), [i, 1, NaN, NaN]);
+ assertEqX4(SIMD.Float32x4(i, 1, 2), [i, 1, 2, NaN]);
+ assertEqX4(SIMD.Float32x4(i, 1, 2, 3), [i, 1, 2, 3 ]);
+ assertEqX4(SIMD.Float32x4(i, 1, 2, 3, 4), [i, 1, 2, 3 ]);
+
+ var b = i % 2 > 0 ;
+ assertEqX4(SIMD.Bool32x4(), [false, false, false, false]);
+ assertEqX4(SIMD.Bool32x4(b), [b, false, false, false]);
+ assertEqX4(SIMD.Bool32x4(b, true), [b, true, false, false]);
+ assertEqX4(SIMD.Bool32x4(b, false, true), [b, false, true, false]);
+ assertEqX4(SIMD.Bool32x4(b, false, true, true), [b, false, true, true ]);
+ assertEqX4(SIMD.Bool32x4(b, false, true, true, true), [b, false, true, true ]);
+
+ assertEqVecArr(SIMD.Bool16x8(),
+ [false, false, false, false, false, false, false, false]);
+ assertEqVecArr(SIMD.Bool16x8(b),
+ [b, false, false, false, false, false, false, false]);
+ assertEqVecArr(SIMD.Bool16x8(b, true),
+ [b, true, false, false, false, false, false, false]);
+ assertEqVecArr(SIMD.Bool16x8(b, false, true),
+ [b, false, true, false, false, false, false, false]);
+ assertEqVecArr(SIMD.Bool16x8(b, false, true, true),
+ [b, false, true, true, false, false, false, false]);
+ assertEqVecArr(SIMD.Bool16x8(b, false, true, true, true),
+ [b, false, true, true, true, false, false, false]);
+ assertEqVecArr(SIMD.Bool16x8(b, false, true, true, true, true),
+ [b, false, true, true, true, true, false, false]);
+
+ assertEqVecArr(SIMD.Bool8x16(),
+ [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]);
+ assertEqVecArr(SIMD.Bool8x16(b),
+ [b, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]);
+ assertEqVecArr(SIMD.Bool8x16(b, true),
+ [b, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false]);
+ assertEqVecArr(SIMD.Bool8x16(b, false, true),
+ [b, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false]);
+ assertEqVecArr(SIMD.Bool8x16(b, false, true, true),
+ [b, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false]);
+ assertEqVecArr(SIMD.Bool8x16(b, false, true, true, true),
+ [b, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false]);
+ assertEqVecArr(SIMD.Bool8x16(b, false, true, true, true, true, false, true, true, true),
+ [b, false, true, true, true, true, false, true, true, true, false, false, false, false, false, false]);
+}
+
+for(var i=0; i<300; i++) {
+ test(i);
+}