})
}
+ /// Converts a repr(simd) operand into an operand where `place_index` accesses the SIMD elements.
+ /// Also returns the number of elements.
+ pub fn operand_to_simd(
+ &self,
+ base: &OpTy<'tcx, M::PointerTag>,
+ ) -> InterpResult<'tcx, (MPlaceTy<'tcx, M::PointerTag>, u64)> {
+ // Basically we just transmute this place into an array following simd_size_and_type.
+ // This only works in memory, but repr(simd) types should never be immediates anyway.
+ assert!(base.layout.ty.is_simd());
+ self.mplace_to_simd(&base.assert_mem_place())
+ }
+
/// Read from a local. Will not actually access the local if reading from a ZST.
/// Will not access memory, instead an indirect `Operand` is returned.
///
self.param_env,
self.layout_of(self.subst_from_current_frame_and_normalize_erasing_regions(
place.ty(&self.frame().body.local_decls, *self.tcx).ty
- ))?,
+ )?)?,
op.layout,
));
Ok(op)
Constant(ref constant) => {
let val =
- self.subst_from_current_frame_and_normalize_erasing_regions(constant.literal);
+ self.subst_from_current_frame_and_normalize_erasing_regions(constant.literal)?;
// This can still fail:
// * During ConstProp, with `TooGeneric` or since the `requried_consts` were not all
// checked yet.