Add x86-specific shuffle instructions

This includes both PSHUFD and PSHUFB; these are necessary to legalize future SIMD instructions.
This commit is contained in:
Andrew Brown
2019-07-11 13:12:25 -07:00
committed by Dan Gohman
parent 61772e9775
commit 683e7c75a3
5 changed files with 125 additions and 1 deletions

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

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