A32: data processing and miscellaneous instructions / T32: 16-bit instructions
fixed bit field field the encoding fixes should be
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| cond | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | Rd | imm12 | |||||||||||||||||
xxxx001010001111xxxxxxxxxxxxxxxx
cond != 1111
if ConditionPassed() then {
assert(cond != 0b1111);
let 'd = UInt(Rd);
let imm32 : bits(32) = A32ExpandImm(imm12);
let add : bool = true;
execute_aarch32_instrs_ADR_Op_A_txt(add, d, imm32)
};
()
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| cond | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | Rd | imm12 | |||||||||||||||||
xxxx001001001111xxxxxxxxxxxxxxxx
cond != 1111
if ConditionPassed() then {
assert(cond != 0b1111);
let 'd = UInt(Rd);
let imm32 : bits(32) = A32ExpandImm(imm12);
let add : bool = false;
execute_aarch32_instrs_ADR_Op_A_txt(add, d, imm32)
};
()
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| 1 | 0 | 1 | 0 | 0 | Rd | imm8 | |||||||||
10100xxxxxxxxxxx
if ConditionPassed() then {
let 'd = UInt(Rd);
let imm32 : bits(32) = ZeroExtend(imm8 @ 0b00, 32);
let add : bool = true;
execute_aarch32_instrs_ADR_Op_A_txt(add, d, imm32)
};
()
let result : bits(32) = if add then Align(PC_read__1(), 4) + imm32 else
Align(PC_read__1(), 4) - imm32;
if d == 15 then {
ALUWritePC(result)
} else {
R_set(d) = result
}
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.