about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-04-18 10:30:37 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-04-18 10:30:44 +0000
commit49bfa1aaf5f7e68079e6ed9b0d23dacebf38bac9 (patch)
treed1b7b31a5a27812dad80f8c400da2464193df4c8
parentc8c87421a5ef753edc27066a571fd0afcc066a6d (diff)
downloadrust-49bfa1aaf5f7e68079e6ed9b0d23dacebf38bac9.tar.gz
rust-49bfa1aaf5f7e68079e6ed9b0d23dacebf38bac9.zip
Fix simd_insert_dyn and simd_extract_dyn intrinsics with non-pointer sized indices
-rw-r--r--src/value_and_place.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/value_and_place.rs b/src/value_and_place.rs
index 9fd71cd6f77..4874a4ad9e0 100644
--- a/src/value_and_place.rs
+++ b/src/value_and_place.rs
@@ -309,6 +309,7 @@ impl<'tcx> CValue<'tcx> {
         match self.0 {
             CValueInner::ByVal(_) | CValueInner::ByValPair(_, _) => unreachable!(),
             CValueInner::ByRef(ptr, None) => {
+                let lane_idx = clif_intcast(fx, lane_idx, fx.pointer_type, false);
                 let field_offset = fx.bcx.ins().imul_imm(lane_idx, lane_layout.size.bytes() as i64);
                 let field_ptr = ptr.offset_value(fx, field_offset);
                 CValue::by_ref(field_ptr, lane_layout)
@@ -823,6 +824,7 @@ impl<'tcx> CPlace<'tcx> {
             CPlaceInner::Var(_, _) => unreachable!(),
             CPlaceInner::VarPair(_, _, _) => unreachable!(),
             CPlaceInner::Addr(ptr, None) => {
+                let lane_idx = clif_intcast(fx, lane_idx, fx.pointer_type, false);
                 let field_offset = fx
                     .bcx
                     .ins()