mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
bitcast only non-pointer-like-element simd vectors, handle others like other aggregate types
This commit is contained in:
@@ -286,7 +286,14 @@ gb_internal lbValue lb_emit_transmute(lbProcedure *p, lbValue value, Type *t) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_simd_vector_bitcastable = false;
|
||||||
if (is_type_simd_vector(src) && is_type_simd_vector(dst)) {
|
if (is_type_simd_vector(src) && is_type_simd_vector(dst)) {
|
||||||
|
if (!is_type_internally_pointer_like(src->SimdVector.elem) && !is_type_internally_pointer_like(dst->SimdVector.elem)) {
|
||||||
|
is_simd_vector_bitcastable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_simd_vector_bitcastable) {
|
||||||
res.value = LLVMBuildBitCast(p->builder, value.value, lb_type(p->module, t), "");
|
res.value = LLVMBuildBitCast(p->builder, value.value, lb_type(p->module, t), "");
|
||||||
return res;
|
return res;
|
||||||
} else if (is_type_array_like(src) && (is_type_simd_vector(dst) || is_type_integer_128bit(dst))) {
|
} else if (is_type_array_like(src) && (is_type_simd_vector(dst) || is_type_integer_128bit(dst))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user