Branches, exception generating and system instructions / Data processing (register)
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 |
| 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | Z | 1 | 0 | 1 | Rn | Rd | ||||||||
110110101100000100x101xxxxxxxxxx
source_is_sp : bool = false;
let 'd = UInt(Rd);
let 'n = UInt(Rn);
if not_bool(HavePACExt()) then {
throw(Error_Undefined())
};
if Z == 0b0 then {
if n == 31 then {
source_is_sp = true
};
()
} else {
if n != 31 then {
throw(Error_Undefined())
};
()
};
execute_aarch64_instrs_integer_pac_autib_dp_1src(d, n, source_is_sp)
| 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 |
| 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | x | 1 | 1 | 1 | x | 1 | 1 | 1 | 1 | 1 |
| CRm | op2 | ||||||||||||||||||||||||||||||
1101010100000011001000x111x11111
d : {17, 30} = 17;
n : int = undefined;
source_is_sp : bool = false;
match CRm @ op2 {
0b0011110 => {
d = 30;
n = 31
},
0b0011111 => {
d = 30;
source_is_sp = true
},
0b0001110 => {
d = 17;
n = 16
},
0b0001000 => {
throw(Error_See("PACIA"))
},
0b0001010 => {
throw(Error_See("PACIB"))
},
0b0001100 => {
throw(Error_See("AUTIA"))
},
[bitzero, bitzero, bitone, bitone, bitzero, bitzero, _] => {
throw(Error_See("PACIA"))
},
[bitzero, bitzero, bitone, bitone, bitzero, bitone, _] => {
throw(Error_See("PACIB"))
},
[bitzero, bitzero, bitone, bitone, bitone, bitzero, _] => {
throw(Error_See("AUTIA"))
},
0b0000111 => {
throw(Error_See("XPACLRI"))
},
_ => {
throw(Error_See("HINT"))
}
};
let 'n = n;
let 'd = d;
assert(constraint((0 <= 'n & 'n <= 31)));
execute_aarch64_instrs_integer_pac_autib_dp_1src(d, n, source_is_sp)
let auth_then_branch : bool = false;
if HavePACExt() then {
if source_is_sp then {
X_set(d, 64) = AuthIB(X_read(d, 64), SP_read(), auth_then_branch)
} else {
X_set(d, 64) = AuthIB(X_read(d, 64), X_read(n, 64), auth_then_branch)
}
};
()
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.