Skip to content

Commit ee5bae8

Browse files
authored
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`
2 parents f56e516 + b9ca525 commit ee5bae8

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/abi/pass_mode.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<'tcx> ArgAbiExt<'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
8484
AbiParam::new(scalar_to_clif_type(tcx, scalar)),
8585
attrs
8686
)],
87-
BackendRepr::Vector { .. } => {
87+
BackendRepr::SimdVector { .. } => {
8888
let vector_ty = crate::intrinsics::clif_vector_type(tcx, self.layout);
8989
smallvec![AbiParam::new(vector_ty)]
9090
}
@@ -135,7 +135,7 @@ impl<'tcx> ArgAbiExt<'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
135135
BackendRepr::Scalar(scalar) => {
136136
(None, vec![AbiParam::new(scalar_to_clif_type(tcx, scalar))])
137137
}
138-
BackendRepr::Vector { .. } => {
138+
BackendRepr::SimdVector { .. } => {
139139
let vector_ty = crate::intrinsics::clif_vector_type(tcx, self.layout);
140140
(None, vec![AbiParam::new(vector_ty)])
141141
}

src/intrinsics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn report_atomic_type_validation_error<'tcx>(
5353

5454
pub(crate) fn clif_vector_type<'tcx>(tcx: TyCtxt<'tcx>, layout: TyAndLayout<'tcx>) -> Type {
5555
let (element, count) = match layout.backend_repr {
56-
BackendRepr::Vector { element, count } => (element, count),
56+
BackendRepr::SimdVector { element, count } => (element, count),
5757
_ => unreachable!(),
5858
};
5959

src/value_and_place.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ impl<'tcx> CValue<'tcx> {
173173
CValueInner::ByRef(ptr, None) => {
174174
let clif_ty = match layout.backend_repr {
175175
BackendRepr::Scalar(scalar) => scalar_to_clif_type(fx.tcx, scalar),
176-
BackendRepr::Vector { element, count } => scalar_to_clif_type(fx.tcx, element)
177-
.by(u32::try_from(count).unwrap())
178-
.unwrap(),
176+
BackendRepr::SimdVector { element, count } => {
177+
scalar_to_clif_type(fx.tcx, element)
178+
.by(u32::try_from(count).unwrap())
179+
.unwrap()
180+
}
179181
_ => unreachable!("{:?}", layout.ty),
180182
};
181183
let mut flags = MemFlags::new();

0 commit comments

Comments
 (0)