cranelift: Port bitselect over to ISLE on x64
This commit is contained in:
@@ -2,6 +2,87 @@ test compile
|
||||
set enable_simd
|
||||
target x86_64 skylake
|
||||
|
||||
function %band_f32x4(f32x4, f32x4) -> f32x4 {
|
||||
block0(v0: f32x4, v1: f32x4):
|
||||
v2 = band v0, v1
|
||||
return v2
|
||||
}
|
||||
; check: andps
|
||||
; not: andpd
|
||||
; not: pand
|
||||
|
||||
function %band_f64x2(f64x2, f64x2) -> f64x2 {
|
||||
block0(v0: f64x2, v1: f64x2):
|
||||
v2 = band v0, v1
|
||||
return v2
|
||||
}
|
||||
; check: andpd
|
||||
; not: andps
|
||||
; not: pand
|
||||
|
||||
function %band_i32x4(i32x4, i32x4) -> i32x4 {
|
||||
block0(v0: i32x4, v1: i32x4):
|
||||
v2 = band v0, v1
|
||||
return v2
|
||||
}
|
||||
; check: pand
|
||||
; not: andps
|
||||
; not: andpd
|
||||
|
||||
function %bor_f32x4(f32x4, f32x4) -> f32x4 {
|
||||
block0(v0: f32x4, v1: f32x4):
|
||||
v2 = bor v0, v1
|
||||
return v2
|
||||
}
|
||||
; check: orps
|
||||
; not: orpd
|
||||
; not: por
|
||||
|
||||
function %bor_f64x2(f64x2, f64x2) -> f64x2 {
|
||||
block0(v0: f64x2, v1: f64x2):
|
||||
v2 = bor v0, v1
|
||||
return v2
|
||||
}
|
||||
; check: orpd
|
||||
; not: orps
|
||||
; not: por
|
||||
|
||||
function %bor_i32x4(i32x4, i32x4) -> i32x4 {
|
||||
block0(v0: i32x4, v1: i32x4):
|
||||
v2 = bor v0, v1
|
||||
return v2
|
||||
}
|
||||
; check: por
|
||||
; not: orps
|
||||
; not: orpd
|
||||
|
||||
function %bxor_f32x4(f32x4, f32x4) -> f32x4 {
|
||||
block0(v0: f32x4, v1: f32x4):
|
||||
v2 = bxor v0, v1
|
||||
return v2
|
||||
}
|
||||
; check: xorps
|
||||
; not: xorpd
|
||||
; not: pxor
|
||||
|
||||
function %bxor_f64x2(f64x2, f64x2) -> f64x2 {
|
||||
block0(v0: f64x2, v1: f64x2):
|
||||
v2 = bxor v0, v1
|
||||
return v2
|
||||
}
|
||||
; check: xorpd
|
||||
; not: xorps
|
||||
; not: pxor
|
||||
|
||||
function %bxor_i32x4(i32x4, i32x4) -> i32x4 {
|
||||
block0(v0: i32x4, v1: i32x4):
|
||||
v2 = bxor v0, v1
|
||||
return v2
|
||||
}
|
||||
; check: pxor
|
||||
; not: xorps
|
||||
; not: xorpd
|
||||
|
||||
function %bitselect_i16x8() -> i16x8 {
|
||||
block0:
|
||||
v0 = vconst.i16x8 [0 0 0 0 0 0 0 0]
|
||||
|
||||
13
cranelift/filetests/filetests/isa/x64/simd-bitwise-run.clif
Normal file
13
cranelift/filetests/filetests/isa/x64/simd-bitwise-run.clif
Normal file
@@ -0,0 +1,13 @@
|
||||
test run
|
||||
set enable_simd
|
||||
target x86_64 skylake
|
||||
|
||||
function %bitselect_i32x4(i32x4, i32x4, i32x4) -> i32x4 {
|
||||
block0(v0: i32x4, v1: i32x4, v2: i32x4):
|
||||
v3 = bitselect v0, v1, v2
|
||||
return v3
|
||||
}
|
||||
; run: %bitselect_i32x4(0x00000000000000000000000000000000, 0x11111111111111111111111111111111, 0x00000000000000000000000000000000) == 0x00000000000000000000000000000000
|
||||
; run: %bitselect_i32x4(0x11111111111111111111111111111111, 0x11111111111111111111111111111111, 0x00000000000000000000000000000000) == 0x11111111111111111111111111111111
|
||||
; run: %bitselect_i32x4(0x01010011000011110000000011111111, 0x11111111111111111111111111111111, 0x00000000000000000000000000000000) == 0x01010011000011110000000011111111
|
||||
; run: %bitselect_i32x4(0x00000000000000001111111111111111, 0x00000000000000000000000000000000, 0x11111111111111111111111111111111) == 0x11111111111111110000000000000000
|
||||
Reference in New Issue
Block a user