Add x86 encoding for SIMD icmp eq
Also adds a predicate for matching the `eq` IntCC code (TODO this should be replaced by something more general)
This commit is contained in:
35
cranelift/filetests/filetests/isa/x86/icmp-compile.clif
Normal file
35
cranelift/filetests/filetests/isa/x86/icmp-compile.clif
Normal file
@@ -0,0 +1,35 @@
|
||||
test binemit
|
||||
set enable_simd
|
||||
target x86_64 skylake
|
||||
|
||||
function %icmp_i8x16() {
|
||||
ebb0:
|
||||
[-, %xmm3] v0 = vconst.i8x16 0x00 ; bin: 66 0f ef db
|
||||
[-, %xmm4] v1 = vconst.i8x16 0xffffffffffffffffffffffffffffffff ; bin: 66 0f 74 e4
|
||||
[-, %xmm3] v2 = icmp eq v0, v1 ; bin: 66 0f 74 dc
|
||||
return
|
||||
}
|
||||
|
||||
function %icmp_i16x8() {
|
||||
ebb0:
|
||||
[-, %xmm0] v0 = vconst.i16x8 0x00
|
||||
[-, %xmm7] v1 = vconst.i16x8 0xffffffffffffffffffffffffffffffff
|
||||
[-, %xmm0] v2 = icmp eq v0, v1 ; bin: 66 0f 75 c7
|
||||
return
|
||||
}
|
||||
|
||||
function %icmp_i32x4() {
|
||||
ebb0:
|
||||
[-, %xmm0] v0 = vconst.i32x4 0x00
|
||||
[-, %xmm4] v1 = vconst.i32x4 0xffffffffffffffffffffffffffffffff
|
||||
[-, %xmm0] v2 = icmp eq v0, v1 ; bin: 66 0f 76 c4
|
||||
return
|
||||
}
|
||||
|
||||
function %icmp_i64x2() {
|
||||
ebb0:
|
||||
[-, %xmm0] v0 = vconst.i64x2 0x00
|
||||
[-, %xmm1] v1 = vconst.i64x2 0xffffffffffffffffffffffffffffffff
|
||||
[-, %xmm0] v2 = icmp eq v0, v1 ; bin: 66 0f 38 29 c1
|
||||
return
|
||||
}
|
||||
24
cranelift/filetests/filetests/isa/x86/icmp-run.clif
Normal file
24
cranelift/filetests/filetests/isa/x86/icmp-run.clif
Normal file
@@ -0,0 +1,24 @@
|
||||
test run
|
||||
set enable_simd
|
||||
|
||||
function %run_icmp_i8x16() -> b8 {
|
||||
ebb0:
|
||||
v0 = vconst.i8x16 0x00
|
||||
v1 = vconst.i8x16 0x00
|
||||
v2 = icmp eq v0, v1
|
||||
v3 = extractlane v2, 0
|
||||
return v3
|
||||
}
|
||||
|
||||
; run
|
||||
|
||||
function %run_icmp_i64x2() -> b64 {
|
||||
ebb0:
|
||||
v0 = vconst.i64x2 0xffffffffffffffffffffffffffffffff
|
||||
v1 = vconst.i64x2 0xffffffffffffffffffffffffffffffff
|
||||
v2 = icmp eq v0, v1
|
||||
v3 = extractlane v2, 1
|
||||
return v3
|
||||
}
|
||||
|
||||
; run
|
||||
Reference in New Issue
Block a user