Add x86-specific shuffle instructions
This includes both PSHUFD and PSHUFB; these are necessary to legalize future SIMD instructions.
This commit is contained in:
13
cranelift/filetests/filetests/isa/x86/pshufb.clif
Normal file
13
cranelift/filetests/filetests/isa/x86/pshufb.clif
Normal file
@@ -0,0 +1,13 @@
|
||||
test binemit
|
||||
set enable_simd
|
||||
target x86_64 has_sse2=true has_ssse3=true
|
||||
|
||||
function %test_pshufb() {
|
||||
ebb0:
|
||||
[-, %rax] v0 = iconst.i8 42
|
||||
[-, %xmm0] v1 = scalar_to_vector.i8x16 v0 ; bin: 66 40 0f 6e c0
|
||||
[-, %rbx] v2 = iconst.i8 43
|
||||
[-, %xmm4] v3 = scalar_to_vector.i8x16 v2 ; bin: 66 40 0f 6e e3
|
||||
[-, %xmm0] v4 = x86_pshufb v1, v3 ; bin: 66 0f 38 00 c4
|
||||
return
|
||||
}
|
||||
11
cranelift/filetests/filetests/isa/x86/pshufd.clif
Normal file
11
cranelift/filetests/filetests/isa/x86/pshufd.clif
Normal file
@@ -0,0 +1,11 @@
|
||||
test binemit
|
||||
set enable_simd
|
||||
target x86_64 has_sse2=true
|
||||
|
||||
function %test_pshuf() {
|
||||
ebb0:
|
||||
[-, %rax] v0 = iconst.i32 42
|
||||
[-, %xmm0] v1 = scalar_to_vector.i32x4 v0 ; bin: 66 40 0f 6e c0
|
||||
[-, %xmm0] v2 = x86_pshufd v1, 0 ; bin: 66 0f 70 c0 00
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user