43 lines
1.1 KiB
Plaintext
43 lines
1.1 KiB
Plaintext
test binemit
|
|
set enable_simd
|
|
target x86_64 haswell
|
|
|
|
; for insertlane, floats are legalized differently than integers and booleans; integers and
|
|
; booleans use x86_pinsr which is manually placed in the IR so that it can be binemit-tested
|
|
|
|
function %test_insertlane_b8() {
|
|
ebb0:
|
|
[-, %rax] v0 = bconst.b8 true
|
|
[-, %rbx] v1 = bconst.b8 false
|
|
[-, %xmm0] v2 = splat.b8x16 v0
|
|
[-, %xmm0] v3 = x86_pinsr v2, 10, v1 ; bin: 66 0f 3a 20 c3 0a
|
|
return
|
|
}
|
|
|
|
function %test_insertlane_i16() {
|
|
ebb0:
|
|
[-, %rax] v0 = iconst.i16 4
|
|
[-, %rbx] v1 = iconst.i16 5
|
|
[-, %xmm1] v2 = splat.i16x8 v0
|
|
[-, %xmm1] v3 = x86_pinsr v2, 4, v1 ; bin: 66 0f c4 cb 04
|
|
return
|
|
}
|
|
|
|
function %test_insertlane_i32() {
|
|
ebb0:
|
|
[-, %rax] v0 = iconst.i32 42
|
|
[-, %rbx] v1 = iconst.i32 99
|
|
[-, %xmm4] v2 = splat.i32x4 v0
|
|
[-, %xmm4] v3 = x86_pinsr v2, 2, v1 ; bin: 66 0f 3a 22 e3 02
|
|
return
|
|
}
|
|
|
|
function %test_insertlane_b64() {
|
|
ebb0:
|
|
[-, %rax] v0 = bconst.b64 true
|
|
[-, %rbx] v1 = bconst.b64 false
|
|
[-, %xmm2] v2 = splat.b64x2 v0
|
|
[-, %xmm2] v3 = x86_pinsr v2, 1, v1 ; bin: 66 48 0f 3a 22 d3 01
|
|
return
|
|
}
|