LDR (register)

T32: 16-bit instructions

fixed bit field field the encoding fixes should be

T1

1514131211109876543210
0101100RmRnRt

0101100xxxxxxxxx

Decode Sail

if ConditionPassed() then {
    shift_n : int = undefined;
    shift_t : SRType = undefined;
    let 't = UInt(Rt);
    let 'n = UInt(Rn);
    let 'm = UInt(Rm);
    (shift_t, shift_n) = (SRType_LSL, 0);
    let 'shift_n = shift_n;
    execute_aarch32_instrs_LDR_r_OpT_A_txt(m, n, shift_n, shift_t, t)
};
()

Operation Sail

let offset : bits(32) = Shift(R_read(m), shift_t, shift_n, PSTATE.C);
let offset_addr : bits(32) = R_read(n) + offset;
let address : bits(32) = offset_addr;
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.