Add scalar_to_vector instruction
Moves scalar values in a GPR register to an FPR register
This commit is contained in:
32
cranelift/filetests/filetests/isa/x86/scalar_to_vector.clif
Normal file
32
cranelift/filetests/filetests/isa/x86/scalar_to_vector.clif
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user