Skip to main content

shift_lsl

Function shift_lsl 

Source
pub const fn shift_lsl(value: u32, shift: u8, carry: bool) -> (u32, bool)
Expand description

LSL (logical shift left) by a register-derived amount 0..=255 (Mesen2 ShiftLsl).

shift == 0 is a documented ARM no-op: both value and carry pass through UNCHANGED (the existing carry flag is preserved, not recomputed) — every ARM shift function shares this “shift 0 changes nothing” contract, ported here via the same if shift != 0 guard the source uses rather than folding it into the arithmetic (shifting a u32 by literally 32 or more is disallowed in Rust — every branch below is guarded to never execute one).