Skip to content

Commit eb4720d

Browse files
committed
Fix review comments
1 parent ad0810b commit eb4720d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/tools/miri/src/shims/aarch64.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
4646

4747
for lane_idx in 0..lane_count {
4848
let src = if lane_idx < (lane_count / 2) { &left } else { &right };
49-
#[allow(clippy::arithmetic_side_effects)]
50-
let src_idx = lane_idx % (lane_count / 2);
49+
let src_idx = lane_idx.strict_rem(lane_count / 2);
5150

52-
#[allow(clippy::arithmetic_side_effects)]
53-
let lhs_lane = this.read_immediate(&this.project_index(src, src_idx * 2)?)?;
54-
#[allow(clippy::arithmetic_side_effects)]
55-
let rhs_lane =
56-
this.read_immediate(&this.project_index(src, src_idx * 2 + 1)?)?;
51+
let lhs_lane =
52+
this.read_immediate(&this.project_index(src, src_idx.strict_mul(2))?)?;
53+
let rhs_lane = this.read_immediate(
54+
&this.project_index(src, src_idx.strict_mul(2).strict_add(1))?,
55+
)?;
5756

57+
// Compute `if lhs > rhs { lhs } else { rhs }`, i.e., `max`.
5858
let res_lane = if this
5959
.binary_op(BinOp::Gt, &lhs_lane, &rhs_lane)?
6060
.to_scalar()

0 commit comments

Comments
 (0)