RotateLeft

usse.sail

a rotate left of a word (bits 16: of its low half) by n, of the u32s (usse.c's rotate_left)

function RotateLeft(x : bits(32), by : bits(32), bits : int) -> bits(32) = {
    let n = AndT(by, UConst(bits - 1));
    let left = ShlT(x, n);
    let right = ShrT(x, ISubT(UConst(bits), n));
    let r = if IEqT(n, UConst(0)) then x else OrT(left, right);
    if bits == 16 then AndT(r, UConst(65535)) else r
}

Used by


Made from ScarletNX's Sail at 166ad3910f80. The Sail and the encodings' file are ScarletNX's (GPL-3.0-or-later); its encodings are from Vita3K's usse_translator_entry.cpp (GPL-2.0-or-later).