Skip to content

Commit

Permalink
Add f16 and f128 as simd types in GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jul 8, 2024
1 parent 4941e13 commit 1e2722d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/rustc_codegen_gcc/src/intrinsic/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,10 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
let (elem_ty_str, elem_ty) = if let ty::Float(f) = in_elem.kind() {
let elem_ty = bx.cx.type_float_from_ty(*f);
match f.bit_width() {
16 => ("h", elem_ty),
32 => ("f", elem_ty),
64 => ("", elem_ty),
128 => ("q", elem_ty),
_ => {
return_error!(InvalidMonomorphization::FloatingPointVector {
span,
Expand Down Expand Up @@ -816,7 +818,9 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
let (_, element_ty0) = arg_tys[0].simd_size_and_type(bx.tcx());
let (_, element_ty1) = arg_tys[1].simd_size_and_type(bx.tcx());
let (pointer_count, underlying_ty) = match *element_ty1.kind() {
ty::RawPtr(p_ty, _) if p_ty == in_elem => (ptr_count(element_ty1), non_ptr(element_ty1)),
ty::RawPtr(p_ty, _) if p_ty == in_elem => {
(ptr_count(element_ty1), non_ptr(element_ty1))
}
_ => {
require!(
false,
Expand Down

0 comments on commit 1e2722d

Please sign in to comment.