Skip to content

Commit 13e7329

Browse files
Rollup merge of rust-lang#128537 - Jamesbarford:118980-const-vector, r=RalfJung,nikic
const vector passed through to codegen This allows constant vectors using a repr(simd) type to be propagated through to the backend by reusing the functionality used to do a similar thing for the simd_shuffle intrinsic rust-lang#118209 r​? RalfJung
2 parents c5172fd + 7969ae3 commit 13e7329

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/common.rs

+5
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ impl<'gcc, 'tcx> ConstMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
160160
self.context.new_struct_constructor(None, struct_type.as_type(), None, values)
161161
}
162162

163+
fn const_vector(&self, values: &[RValue<'gcc>]) -> RValue<'gcc> {
164+
let typ = self.type_vector(values[0].get_type(), values.len() as u64);
165+
self.context.new_rvalue_from_vector(None, typ, values)
166+
}
167+
163168
fn const_to_opt_uint(&self, _v: RValue<'gcc>) -> Option<u64> {
164169
// TODO(antoyo)
165170
None

0 commit comments

Comments
 (0)