diff options
| author | Ralf Jung <post@ralfj.de> | 2024-09-11 09:12:02 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-09-13 15:26:08 +0200 |
| commit | e2bc16c101e76532420e3af7e7805071f445b2f7 (patch) | |
| tree | 1c9666851ad2a66f8d379a3f72edb2236113d1ce /compiler/rustc_const_eval/src/interpret/operand.rs | |
| parent | a5efa01895e82fa705146507d15311b29c715450 (diff) | |
| download | rust-e2bc16c101e76532420e3af7e7805071f445b2f7.tar.gz rust-e2bc16c101e76532420e3af7e7805071f445b2f7.zip | |
interpret: simplify SIMD type handling
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/operand.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/operand.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs index bb7e58b83ac..2e02d1001c8 100644 --- a/compiler/rustc_const_eval/src/interpret/operand.rs +++ b/compiler/rustc_const_eval/src/interpret/operand.rs @@ -681,30 +681,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { Ok(str) } - /// Converts a repr(simd) operand into an operand where `place_index` accesses the SIMD elements. - /// Also returns the number of elements. - /// - /// Can (but does not always) trigger UB if `op` is uninitialized. - pub fn operand_to_simd( - &self, - op: &OpTy<'tcx, M::Provenance>, - ) -> InterpResult<'tcx, (MPlaceTy<'tcx, M::Provenance>, 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!(op.layout.ty.is_simd()); - match op.as_mplace_or_imm() { - Left(mplace) => self.mplace_to_simd(&mplace), - Right(imm) => match *imm { - Immediate::Uninit => { - throw_ub!(InvalidUninitBytes(None)) - } - Immediate::Scalar(..) | Immediate::ScalarPair(..) => { - bug!("arrays/slices can never have Scalar/ScalarPair layout") - } - }, - } - } - /// Read from a local of the current frame. /// Will not access memory, instead an indirect `Operand` is returned. /// |
