diff options
| author | Ralf Jung <post@ralfj.de> | 2025-03-03 18:18:33 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2025-04-20 12:25:27 +0200 |
| commit | 566dfd1a0d8c4afbe54ea060059b8f716456ea66 (patch) | |
| tree | e474b553c3d8f89577c9c81a5fd1d24ef8671f13 /compiler/rustc_codegen_gcc/src/intrinsic/simd.rs | |
| parent | a7fc463dd8fbeca800d4b3efc501069502cffe64 (diff) | |
| download | rust-566dfd1a0d8c4afbe54ea060059b8f716456ea66.tar.gz rust-566dfd1a0d8c4afbe54ea060059b8f716456ea66.zip | |
simd intrinsics with mask: accept unsigned integer masks
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/intrinsic/simd.rs')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/intrinsic/simd.rs | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs b/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs index 8b454ab2a42..787f4cd7d41 100644 --- a/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs +++ b/compiler/rustc_codegen_gcc/src/intrinsic/simd.rs @@ -443,9 +443,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( m_len == v_len, InvalidMonomorphization::MismatchedLengths { span, name, m_len, v_len } ); + // TODO: also support unsigned integers. match *m_elem_ty.kind() { ty::Int(_) => {} - _ => return_error!(InvalidMonomorphization::MaskType { span, name, ty: m_elem_ty }), + _ => return_error!(InvalidMonomorphization::MaskWrongElementType { + span, + name, + ty: m_elem_ty + }), } return Ok(bx.vector_select(args[0].immediate(), args[1].immediate(), args[2].immediate())); } @@ -987,19 +992,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( assert_eq!(pointer_count - 1, ptr_count(element_ty0)); assert_eq!(underlying_ty, non_ptr(element_ty0)); - // The element type of the third argument must be a signed integer type of any width: + // The element type of the third argument must be an integer type of any width: + // TODO: also support unsigned integers. let (_, element_ty2) = arg_tys[2].simd_size_and_type(bx.tcx()); match *element_ty2.kind() { ty::Int(_) => (), _ => { require!( false, - InvalidMonomorphization::ThirdArgElementType { - span, - name, - expected_element: element_ty2, - third_arg: arg_tys[2] - } + InvalidMonomorphization::MaskWrongElementType { span, name, ty: element_ty2 } ); } } @@ -1105,17 +1106,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( assert_eq!(underlying_ty, non_ptr(element_ty0)); // The element type of the third argument must be a signed integer type of any width: + // TODO: also support unsigned integers. match *element_ty2.kind() { ty::Int(_) => (), _ => { require!( false, - InvalidMonomorphization::ThirdArgElementType { - span, - name, - expected_element: element_ty2, - third_arg: arg_tys[2] - } + InvalidMonomorphization::MaskWrongElementType { span, name, ty: element_ty2 } ); } } |
