Debian Codegraph @

js/src/jit-test/tests/wasm/simd/cmp-x64-ion-codegen.js

raw
1 // |jit-test| skip-if: !wasmSimdEnabled() || !hasDisassembler() || wasmCompileMode() != "ion" || !getBuildConfiguration("x64") || getBuildConfiguration("simulator"); include:codegen-x64-test.js
2
3 // Test that there are no extraneous moves or fixups for various SIMD comparison
4 // operations. See README-codegen.md for general information about this type of
5 // test case.
6
7 // Inputs (xmm0, xmm1)
8
9 codegenTestX64_v128xv128_v128(
10 [['i8x16.gt_s', `66 0f 64 c1 pcmpgtb %xmm1, %xmm0`],
11 ['i16x8.gt_s', `66 0f 65 c1 pcmpgtw %xmm1, %xmm0`],
12 ['i32x4.gt_s', `66 0f 66 c1 pcmpgtd %xmm1, %xmm0`],
13 ['i8x16.le_s', `
14 66 0f 64 c1 pcmpgtb %xmm1, %xmm0
15 66 45 0f 75 ff pcmpeqw %xmm15, %xmm15
16 66 41 0f ef c7 pxor %xmm15, %xmm0
17 `],
18 ['i16x8.le_s', `
19 66 0f 65 c1 pcmpgtw %xmm1, %xmm0
20 66 45 0f 75 ff pcmpeqw %xmm15, %xmm15
21 66 41 0f ef c7 pxor %xmm15, %xmm0
22 `],
23 ['i32x4.le_s', `
24 66 0f 66 c1 pcmpgtd %xmm1, %xmm0
25 66 45 0f 75 ff pcmpeqw %xmm15, %xmm15
26 66 41 0f ef c7 pxor %xmm15, %xmm0
27 `],
28 ['i8x16.eq', `66 0f 74 c1 pcmpeqb %xmm1, %xmm0`],
29 ['i16x8.eq', `66 0f 75 c1 pcmpeqw %xmm1, %xmm0`],
30 ['i32x4.eq', `66 0f 76 c1 pcmpeqd %xmm1, %xmm0`],
31 ['i8x16.ne', `
32 66 0f 74 c1 pcmpeqb %xmm1, %xmm0
33 66 45 0f 75 ff pcmpeqw %xmm15, %xmm15
34 66 41 0f ef c7 pxor %xmm15, %xmm0
35 `],
36 ['i16x8.ne', `
37 66 0f 75 c1 pcmpeqw %xmm1, %xmm0
38 66 45 0f 75 ff pcmpeqw %xmm15, %xmm15
39 66 41 0f ef c7 pxor %xmm15, %xmm0
40 `],
41 ['i32x4.ne', `
42 66 0f 76 c1 pcmpeqd %xmm1, %xmm0
43 66 45 0f 75 ff pcmpeqw %xmm15, %xmm15
44 66 41 0f ef c7 pxor %xmm15, %xmm0
45 `],
46 ['f32x4.eq', `0f c2 c1 00 cmpps \\$0x00, %xmm1, %xmm0`],
47 ['f32x4.ne', `0f c2 c1 04 cmpps \\$0x04, %xmm1, %xmm0`],
48 ['f32x4.lt', `0f c2 c1 01 cmpps \\$0x01, %xmm1, %xmm0`],
49 ['f32x4.le', `0f c2 c1 02 cmpps \\$0x02, %xmm1, %xmm0`],
50 ['f64x2.eq', `66 0f c2 c1 00 cmppd \\$0x00, %xmm1, %xmm0`],
51 ['f64x2.ne', `66 0f c2 c1 04 cmppd \\$0x04, %xmm1, %xmm0`],
52 ['f64x2.lt', `66 0f c2 c1 01 cmppd \\$0x01, %xmm1, %xmm0`],
53 ['f64x2.le', `66 0f c2 c1 02 cmppd \\$0x02, %xmm1, %xmm0`]] );
54
55 // Inputs (xmm1, xmm0) because the operation reverses its arguments.
56
57 codegenTestX64_v128xv128_v128_reversed(
58 [['i8x16.ge_s', `
59 66 0f 64 c1 pcmpgtb %xmm1, %xmm0
60 66 45 0f 75 ff pcmpeqw %xmm15, %xmm15
61 66 41 0f ef c7 pxor %xmm15, %xmm0`],
62 ['i16x8.ge_s',
63 `
64 66 0f 65 c1 pcmpgtw %xmm1, %xmm0
65 66 45 0f 75 ff pcmpeqw %xmm15, %xmm15
66 66 41 0f ef c7 pxor %xmm15, %xmm0`],
67 ['i32x4.ge_s', `
68 66 0f 66 c1 pcmpgtd %xmm1, %xmm0
69 66 45 0f 75 ff pcmpeqw %xmm15, %xmm15
70 66 41 0f ef c7 pxor %xmm15, %xmm0`],
71 ['i8x16.lt_s', `66 0f 64 c1 pcmpgtb %xmm1, %xmm0`],
72 ['i16x8.lt_s', `66 0f 65 c1 pcmpgtw %xmm1, %xmm0`],
73 ['i32x4.lt_s', `66 0f 66 c1 pcmpgtd %xmm1, %xmm0`],
74 ['f32x4.gt', `0f c2 c1 01 cmpps \\$0x01, %xmm1, %xmm0`],
75 ['f32x4.ge', `0f c2 c1 02 cmpps \\$0x02, %xmm1, %xmm0`],
76 ['f64x2.gt', `66 0f c2 c1 01 cmppd \\$0x01, %xmm1, %xmm0`],
77 ['f64x2.ge', `66 0f c2 c1 02 cmppd \\$0x02, %xmm1, %xmm0`]] );