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 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | Xm | 0 | 0 | 0 | 0 | 0 | 0 | Xn | Xd | ||||||||||||
10011010110xxxxx000000xxxxxxxxxx
if not_bool(HaveMTEExt()) then {
throw(Error_Undefined())
};
let 'd = UInt(Xd);
let 'n = UInt(Xn);
let 'm = UInt(Xm);
let setflags : bool = false;
execute_aarch64_instrs_integer_arithmetic_pointer_mcsubtracttaggedaddress(d, m, n, setflags)
operand1 : bits(64) = if n == 31 then SP_read() else X_read(n, 64);
operand2 : bits(64) = if m == 31 then SP_read() else X_read(m, 64);
let operand1 : bits(64) = SignExtend(operand1[55 .. 0], 64);
operand2 : bits(64) = SignExtend(operand2[55 .. 0], 64);
result : bits(64) = undefined;
nzcv : bits(4) = undefined;
let operand2 : bits(64) = not_vec(operand2);
(result, nzcv) = AddWithCarry(operand1, operand2, 0b1);
if setflags then {
(PSTATE.N @ PSTATE.Z @ PSTATE.C @ PSTATE.V) = nzcv
};
X_set(d, 64) = 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.