Files
wasmtime/cranelift/filetests/filetests/runtests/simd-vconst-optimized-legacy.clif
Afonso Bordado 214755c6a0 cranelift: Merge all run tests into runtests dir
With this change we now reuse tests across multiple arches.

Duplicate tests were merged into the same file where possible.
Some legacy x86 tests were left in separate files due to incompatibilities with the rest of the test suite.
2021-06-07 14:44:11 +01:00

47 lines
1.4 KiB
Plaintext

test run
set enable_simd
target x86_64 legacy
function %vconst_syntax() -> b1 {
block0:
v0 = vconst.i32x4 0x00000004_00000003_00000002_00000001 ; build constant using hexadecimal syntax
v1 = vconst.i32x4 [1 2 3 4] ; build constant using literal list syntax
; verify lane 1 matches
v2 = extractlane v0, 1
v3 = extractlane v1, 1
v4 = icmp eq v3, v2
; verify lane 1 has the correct value
v5 = icmp_imm eq v3, 2
v6 = band v4, v5
return v6
}
; run
; Since both jump tables and constants are emitted after the function body, it is important that any RIP-relative
; addressing of constants is not incorrect in the presence of jump tables. This test confirms that, even when both
; jump tables and constants are emitted, the constant addressing works correctly.
function %vconst_with_jumptables() -> b1 {
jt0 = jump_table [block0]
block10:
v10 = iconst.i64 0
br_table v10, block1, jt0
block0:
v0 = iconst.i64 100
jump block11(v0)
block1:
v1 = iconst.i64 101
jump block11(v1)
block11(v11: i64):
v12 = icmp_imm eq v11, 100 ; We should have jumped through block 0.
v13 = vconst.i32x4 [1 2 3 4]
v14 = extractlane.i32x4 v13, 1 ; Extract the second element...
v15 = icmp_imm eq v14, 2 ; ...which should be the value 2.
v16 = band v12, v15
return v16
}
; run