shift-x64-ion-codegen.js (1255B)
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 for a constant integer SIMD shift 4 // that can reuse its input for its output. See README-codegen.md for general 5 // information about this type of test case. 6 // 7 // There are test cases here for all codegen cases that include a potential move 8 // to set up the operation, but not for all shift operations in general. 9 10 codegenTestX64_v128xLITERAL_v128( 11 [['i8x16.shl', '(i32.const 2)', ` 12 paddb %xmm0, %xmm0 13 paddb %xmm0, %xmm0`], 14 ['i16x8.shl', '(i32.const 2)', `psllw \\$0x02, %xmm0`], 15 ['i32x4.shl', '(i32.const 2)', `pslld \\$0x02, %xmm0`], 16 ['i64x2.shl', '(i32.const 2)', `psllq \\$0x02, %xmm0`], 17 ['i8x16.shr_u', '(i32.const 2)', ` 18 pandx ${RIPR}, %xmm0 19 psrlw \\$0x02, %xmm0`], 20 ['i16x8.shr_s', '(i32.const 2)', `psraw \\$0x02, %xmm0`], 21 ['i16x8.shr_u', '(i32.const 2)', `psrlw \\$0x02, %xmm0`], 22 ['i32x4.shr_s', '(i32.const 2)', `psrad \\$0x02, %xmm0`], 23 ['i32x4.shr_u', '(i32.const 2)', `psrld \\$0x02, %xmm0`], 24 ['i64x2.shr_u', '(i32.const 2)', `psrlq \\$0x02, %xmm0`]] );