STM

T32: 16-bit instructions

fixed bit field field the encoding fixes should be

T1

1514131211109876543210
11000Rnregister_list

11000xxxxxxxxxxx

Decode Sail

if ConditionPassed() then {
    let 'n = UInt(Rn);
    let registers : bits(16) = 0b00000000 @ register_list;
    let wback : bool = true;
    if BitCount(registers) < 1 then {
        throw(Error_Unpredictable())
    };
    execute_aarch32_instrs_STM_Op_A_txt(n, registers, wback)
};
()

Operation Sail

if BitCount(registers) == 0 then {
    throw(Error_Undefined())
};
if ((wback & [registers[n]] == 0b1) & n != LowestSetBit(registers)) & ArchVersion() == 6 then {
    UnpredictableEncoding()
};
address : bits(32) = R_read(n);
GuestTransfer(address, 4 * BitCount(registers), true);
foreach (i from 0 to 14 by 1 in inc) {
    if [registers[i]] == 0b1 then {
        if ((i == n & wback) & i != LowestSetBit(registers)) & ArchVersion() == 4 then {
            MemS_set(address, 4) = R_read(n) + 4 * BitCount(registers)
        } else {
            MemS_set(address, 4) = R_read(i)
        };
        address = address + 4
    };
    ()
};
if [registers[15]] == 0b1 then {
    MemS_set(address, 4) = PCStoreValue()
};
if wback then {
    R_set(n) = R_read(n) + 4 * BitCount(registers)
};
()

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.