File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -46,15 +46,15 @@ pub(super) trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
46
46
47
47
for lane_idx in 0 ..lane_count {
48
48
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 ) ;
51
50
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
+ ) ?;
57
56
57
+ // Compute `if lhs > rhs { lhs } else { rhs }`, i.e., `max`.
58
58
let res_lane = if this
59
59
. binary_op ( BinOp :: Gt , & lhs_lane, & rhs_lane) ?
60
60
. to_scalar ( )
You can’t perform that action at this time.
0 commit comments