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:
Andrew Brown
2019-09-03 15:15:55 -07:00
parent 702155b19b
commit a3db30d97e
7 changed files with 134 additions and 0 deletions

View 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
}

View 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