Add x86 implementation of extractlane instruction

This commit is contained in:
Andrew Brown
2019-07-11 15:49:28 -07:00
committed by Dan Gohman
parent 036b9aea94
commit 3fdc78174f
3 changed files with 84 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
test binemit
set enable_simd
target x86_64 haswell
function %test_extractlane_b8() {
ebb0:
[-, %rax] v0 = bconst.b8 true
[-, %xmm0] v1 = splat.b8x16 v0
[-, %rax] v2 = extractlane v1, 10 ; bin: 66 0f 3a 14 c0 0a
return
}
function %test_extractlane_i16() {
ebb0:
[-, %rax] v0 = iconst.i16 4
[-, %xmm1] v1 = splat.i16x8 v0
[-, %rax] v2 = extractlane v1, 4 ; bin: 66 0f c5 c8 04
return
}
function %test_extractlane_i32() {
ebb0:
[-, %rax] v0 = iconst.i32 42
[-, %xmm4] v1 = splat.i32x4 v0
[-, %rcx] v2 = extractlane v1, 2 ; bin: 66 0f 3a 16 e1 02
return
}
function %test_extractlane_f64() {
ebb0:
[-, %rax] v0 = f64const 0x0.0
[-, %xmm2] v1 = splat.f64x2 v0
[-, %rbx] v2 = extractlane v1, 1 ; bin: 66 48 0f 3a 16 d3 01
return
}