LDR (literal)

T32: 16-bit instructions

fixed bit field field the encoding fixes should be

T1

1514131211109876543210
01001Rtimm8

01001xxxxxxxxxxx

Decode Sail

if ConditionPassed() then {
    let 't = UInt(Rt);
    let imm32 : bits(32) = ZeroExtend(imm8 @ 0b00, 32);
    let add : bool = true;
    execute_aarch32_instrs_LDR_l_Op_A_txt(add, imm32, t)
};
()

Operation Sail

let base : bits(32) = Align(PC_read__1(), 4);
let address : bits(32) = if add then base + imm32 else base - imm32;
if t != 15 then {
    AArch32_SetLSInstructionSyndrome(4, false, t, false)
};
let data : bits(32) = MemU_read(address, 4);
if t == 15 then {
    if address[1 .. 0] == 0b00 then {
        LoadWritePC(data)
    } else {
        throw(Error_Unpredictable())
    }
} else {
    R_set(t) = data
}

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.