summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/simd/neg-abs-not-x64-ion-codegen.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /js/src/jit-test/tests/wasm/simd/neg-abs-not-x64-ion-codegen.js
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/wasm/simd/neg-abs-not-x64-ion-codegen.js')
-rw-r--r--js/src/jit-test/tests/wasm/simd/neg-abs-not-x64-ion-codegen.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/simd/neg-abs-not-x64-ion-codegen.js b/js/src/jit-test/tests/wasm/simd/neg-abs-not-x64-ion-codegen.js
new file mode 100644
index 0000000000..ba3429236a
--- /dev/null
+++ b/js/src/jit-test/tests/wasm/simd/neg-abs-not-x64-ion-codegen.js
@@ -0,0 +1,34 @@
+// |jit-test| skip-if: !wasmSimdEnabled() || !hasDisassembler() || wasmCompileMode() != "ion" || !getBuildConfiguration("x64") || getBuildConfiguration("simulator"); include:codegen-x64-test.js
+
+// Test that there are no extraneous moves for variable SIMD negate, abs, and
+// not instructions. See README-codegen.md for general information about this
+// type of test case.
+
+// Integer negates don't have to reuse the input for the output, and prefer for
+// the registers to be different. So use parameter 1 and ignore parameter 0.
+
+codegenTestX64_IGNOREDxv128_v128(
+ [['i8x16.neg', `
+66 0f ef c0 pxor %xmm0, %xmm0
+66 0f f8 c1 psubb %xmm1, %xmm0`],
+ ['i16x8.neg', `
+66 0f ef c0 pxor %xmm0, %xmm0
+66 0f f9 c1 psubw %xmm1, %xmm0`],
+ ['i32x4.neg', `
+66 0f ef c0 pxor %xmm0, %xmm0
+66 0f fa c1 psubd %xmm1, %xmm0`],
+ ['i64x2.neg', `
+66 0f ef c0 pxor %xmm0, %xmm0
+66 0f fb c1 psubq %xmm1, %xmm0`]] );
+
+// Floating point negate and absolute value, and bitwise not, prefer for the
+// registers to be the same and guarantee that no move is inserted if so.
+
+codegenTestX64_v128_v128(
+ [['f32x4.neg', `66 0f ef 05 ${RIPRADDR} pxorx ${RIPR}, %xmm0`],
+ ['f64x2.neg', `66 0f ef 05 ${RIPRADDR} pxorx ${RIPR}, %xmm0`],
+ ['f32x4.abs', `66 0f db 05 ${RIPRADDR} pandx ${RIPR}, %xmm0`],
+ ['f64x2.abs', `66 0f db 05 ${RIPRADDR} pandx ${RIPR}, %xmm0`],
+ ['v128.not', `
+66 45 0f 75 ff pcmpeqw %xmm15, %xmm15
+66 41 0f ef c7 pxor %xmm15, %xmm0`]] );