diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-02-21 12:46:19 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-02-21 12:46:19 +0000 |
| commit | eb4720dc8e09476d99a846b5e9f78137038e62aa (patch) | |
| tree | fda6e14825896c7c74f76aa81044fa74789e9ac1 | |
| parent | ad0810b73b0df9f727f2693391bdcb327dccf649 (diff) | |
| download | rust-eb4720dc8e09476d99a846b5e9f78137038e62aa.tar.gz rust-eb4720dc8e09476d99a846b5e9f78137038e62aa.zip | |
Fix review comments
| -rw-r--r-- | src/tools/miri/src/shims/aarch64.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tools/miri/src/shims/aarch64.rs b/src/tools/miri/src/shims/aarch64.rs index 4751064a1b9..fc6e3b303d1 100644 --- a/src/tools/miri/src/shims/aarch64.rs +++ b/src/tools/miri/src/shims/aarch64.rs @@ -46,15 +46,15 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { for lane_idx in 0..lane_count { let src = if lane_idx < (lane_count / 2) { &left } else { &right }; - #[allow(clippy::arithmetic_side_effects)] - let src_idx = lane_idx % (lane_count / 2); + let src_idx = lane_idx.strict_rem(lane_count / 2); - #[allow(clippy::arithmetic_side_effects)] - let lhs_lane = this.read_immediate(&this.project_index(src, src_idx * 2)?)?; - #[allow(clippy::arithmetic_side_effects)] - let rhs_lane = - this.read_immediate(&this.project_index(src, src_idx * 2 + 1)?)?; + let lhs_lane = + this.read_immediate(&this.project_index(src, src_idx.strict_mul(2))?)?; + let rhs_lane = this.read_immediate( + &this.project_index(src, src_idx.strict_mul(2).strict_add(1))?, + )?; + // Compute `if lhs > rhs { lhs } else { rhs }`, i.e., `max`. let res_lane = if this .binary_op(BinOp::Gt, &lhs_lane, &rhs_lane)? .to_scalar() |
