Skip to content

Commit be0b786

Browse files
author
TheIronBorn
committed
better match intel pseudocode
1 parent a71eb28 commit be0b786

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coresimd/ppsv/api/rotates.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ macro_rules! impl_vector_rotates {
1616
const LANE_WIDTH: $elem_ty = ::mem::size_of::<$elem_ty>() as $elem_ty * 8;
1717
// Protect against undefined behavior for over-long bit shifts
1818
let n = n % LANE_WIDTH;
19-
(self << n) | (self >> ((LANE_WIDTH - n) % LANE_WIDTH))
19+
(self << n) | (self >> (LANE_WIDTH - n))
2020
}
2121

2222
/// Shifts the bits of each lane to the right by the specified amount in
@@ -31,7 +31,7 @@ macro_rules! impl_vector_rotates {
3131
const LANE_WIDTH: $elem_ty = ::mem::size_of::<$elem_ty>() as $elem_ty * 8;
3232
// Protect against undefined behavior for over-long bit shifts
3333
let n = n % LANE_WIDTH;
34-
(self >> n) | (self << ((LANE_WIDTH - n) % LANE_WIDTH))
34+
(self >> n) | (self << (LANE_WIDTH - n))
3535
}
3636
}
3737
};

0 commit comments

Comments
 (0)