1
Fork 0

Rollup merge of #126469 - RalfJung:mir-shifts, r=scottmcm

MIR Shl/Shr: the offset can be computed with rem_euclid

r? ````@scottmcm````
This commit is contained in:
Matthias Krüger 2024-06-15 10:56:41 +02:00 committed by GitHub
commit f24509aa23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 14 deletions

View file

@ -1490,7 +1490,8 @@ pub enum BinOp {
BitOr,
/// The `<<` operator (shift left)
///
/// The offset is (uniquely) determined as follows:
/// The offset is given by `RHS.rem_euclid(LHS::BITS)`.
/// In other words, it is (uniquely) determined as follows:
/// - it is "equal modulo LHS::BITS" to the RHS
/// - it is in the range `0..LHS::BITS`
Shl,
@ -1498,7 +1499,8 @@ pub enum BinOp {
ShlUnchecked,
/// The `>>` operator (shift right)
///
/// The offset is (uniquely) determined as follows:
/// The offset is given by `RHS.rem_euclid(LHS::BITS)`.
/// In other words, it is (uniquely) determined as follows:
/// - it is "equal modulo LHS::BITS" to the RHS
/// - it is in the range `0..LHS::BITS`
///