RSB (register-shifted register)

A32: data processing and miscellaneous instructions

fixed bit field field the encoding fixes should be

A1

313029282726252423222120191817161514131211109876543210
cond0000011SRnRdRs0stype1Rm

xxxx0000011xxxxxxxxxxxxx0xx1xxxx
cond != 1111

Decode Sail

if ConditionPassed() then {
    assert(cond != 0b1111);
    let 'd = UInt(Rd);
    let 'n = UInt(Rn);
    let 'm = UInt(Rm);
    let 's = UInt(Rs);
    let setflags : bool = S == 0b1;
    let shift_t : SRType = DecodeRegShift(stype);
    if ((d == 15 | n == 15) | m == 15) | s == 15 then {
        throw(Error_Unpredictable())
    };
    execute_aarch32_instrs_RSB_rr_Op_A_txt(d, m, n, s, setflags, shift_t)
};
()

Operation Sail

nzcv : bits(4) = undefined;
result : bits(32) = undefined;
let 'shift_n = UInt(R_read(s)[7 .. 0]);
let shifted : bits(32) = Shift(R_read(m), shift_t, shift_n, PSTATE.C);
(result, nzcv) = AddWithCarry(not_vec(R_read(n)), shifted, 0b1);
R_set(d) = result;
if setflags then {
    (PSTATE.N @ PSTATE.Z @ PSTATE.C @ PSTATE.V) = nzcv
};
()

Made from ScarletNX's Sail at 166ad3910f80. sail-arm's definitions are Arm's ASL in Sail (BSD 3-Clause Clear, license); ScarletNX's fixups are GPL-3.0-or-later.