POP

T32: 16-bit instructions

fixed bit field field the encoding fixes should be

T1

1514131211109876543210
1011110Pregister_list

1011110xxxxxxxxx

Decode Sail

if ConditionPassed() then {
    let registers : bits(16) = (P @ 0b0000000) @ register_list;
    let UnalignedAllowed : bool = false;
    if BitCount(registers) < 1 then {
        throw(Error_Unpredictable())
    };
    if ([registers[15]] == 0b1 & InITBlock()) & not_bool(LastInITBlock()) then {
        throw(Error_Unpredictable())
    };
    execute_aarch32_instrs_POP_Op_A_txt(UnalignedAllowed, registers)
};
()

Operation Sail

if BitCount(registers) == 0 & not_bool(GuestTransferEmpty()) then {
    throw(Error_Undefined())
};
address : bits(32) = R_read(13);
GuestTransfer(address, 4 * BitCount(registers), false);
foreach (i from 0 to 14 by 1 in inc) {
    if [registers[i]] == 0b1 then {
        R_set(i) = if UnalignedAllowed then MemU_read(address, 4) else MemA_read(address, 4);
        address = address + 4
    };
    ()
};
if [registers[15]] == 0b1 then {
    if UnalignedAllowed then {
        if address[1 .. 0] == 0b00 then {
            LoadWritePC(MemU_read(address, 4))
        } else {
            throw(Error_Unpredictable())
        }
    } else {
        LoadWritePC(MemA_read(address, 4))
    }
};
if [registers[13]] == 0b0 then {
    R_set(13) = R_read(13) + 4 * BitCount(registers)
};
if [registers[13]] == 0b1 then {
    R_set(13) = __UNKNOWN_bits(32)
};
()

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.