mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 21:47:15 +03:00
Rollup merge of #137804 - RalfJung:backend-repr-simd-vector, r=workingjubilee
rename BackendRepr::Vector → SimdVector For many Rustaceans, "vector" does not imply "SIMD", so let's be more clear in this type that is used pervasively in the compiler. r? `@workingjubilee`
This commit is contained in:
@@ -84,7 +84,7 @@ impl<'tcx> ArgAbiExt<'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
|
||||
AbiParam::new(scalar_to_clif_type(tcx, scalar)),
|
||||
attrs
|
||||
)],
|
||||
BackendRepr::Vector { .. } => {
|
||||
BackendRepr::SimdVector { .. } => {
|
||||
let vector_ty = crate::intrinsics::clif_vector_type(tcx, self.layout);
|
||||
smallvec![AbiParam::new(vector_ty)]
|
||||
}
|
||||
@@ -135,7 +135,7 @@ fn get_abi_return(&self, tcx: TyCtxt<'tcx>) -> (Option<AbiParam>, Vec<AbiParam>)
|
||||
BackendRepr::Scalar(scalar) => {
|
||||
(None, vec![AbiParam::new(scalar_to_clif_type(tcx, scalar))])
|
||||
}
|
||||
BackendRepr::Vector { .. } => {
|
||||
BackendRepr::SimdVector { .. } => {
|
||||
let vector_ty = crate::intrinsics::clif_vector_type(tcx, self.layout);
|
||||
(None, vec![AbiParam::new(vector_ty)])
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ fn report_atomic_type_validation_error<'tcx>(
|
||||
|
||||
pub(crate) fn clif_vector_type<'tcx>(tcx: TyCtxt<'tcx>, layout: TyAndLayout<'tcx>) -> Type {
|
||||
let (element, count) = match layout.backend_repr {
|
||||
BackendRepr::Vector { element, count } => (element, count),
|
||||
BackendRepr::SimdVector { element, count } => (element, count),
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
|
||||
@@ -173,9 +173,11 @@ pub(crate) fn load_scalar(self, fx: &mut FunctionCx<'_, '_, 'tcx>) -> Value {
|
||||
CValueInner::ByRef(ptr, None) => {
|
||||
let clif_ty = match layout.backend_repr {
|
||||
BackendRepr::Scalar(scalar) => scalar_to_clif_type(fx.tcx, scalar),
|
||||
BackendRepr::Vector { element, count } => scalar_to_clif_type(fx.tcx, element)
|
||||
.by(u32::try_from(count).unwrap())
|
||||
.unwrap(),
|
||||
BackendRepr::SimdVector { element, count } => {
|
||||
scalar_to_clif_type(fx.tcx, element)
|
||||
.by(u32::try_from(count).unwrap())
|
||||
.unwrap()
|
||||
}
|
||||
_ => unreachable!("{:?}", layout.ty),
|
||||
};
|
||||
let mut flags = MemFlags::new();
|
||||
|
||||
Reference in New Issue
Block a user