Add scalar_to_vector instruction

Moves scalar values in a GPR register to an FPR register
This commit is contained in:
Andrew Brown
2019-07-11 10:50:06 -07:00
committed by Dan Gohman
parent 356e6dafe2
commit 5f0e5567c1
3 changed files with 84 additions and 3 deletions

View File

@@ -0,0 +1,32 @@
test binemit
set opt_level=best
set enable_simd
target x86_64 has_sse2=true
function %test_scalar_to_vector_b8() {
ebb0:
[-, %rax] v0 = bconst.b8 true
[-, %xmm0] v1 = scalar_to_vector.b8x16 v0 ; bin: 66 0f 6e c0
return
}
function %test_scalar_to_vector_i16() {
ebb0:
[-, %rbx] v0 = iconst.i16 42
[-, %xmm2] v1 = scalar_to_vector.i16x8 v0 ; bin: 66 0f 6e d3
return
}
function %test_scalar_to_vector_f32() {
ebb0:
[-, %rcx] v0 = f32const 0x0.42
[-, %xmm3] v1 = scalar_to_vector.f32x4 v0 ; bin: 66 0f 6e d9
return
}
function %test_scalar_to_vector_i64() {
ebb0:
[-, %rdx] v0 = iconst.i64 42
[-, %xmm7] v1 = scalar_to_vector.i64x2 v0 ; bin: 66 0f 6e fa
return
}