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 |
| sf | 1 | 1 | 0 | 1 | 0 | 1 | 1 | shift | 0 | Rm | imm6 | Rn | Rd | ||||||||||||||||||
| op | S | ||||||||||||||||||||||||||||||
x1101011xx0xxxxxxxxxxxxxxxxxxxxx
let 'd = UInt(Rd);
let 'n = UInt(Rn);
let 'm = UInt(Rm);
let 'datasize = if sf == 0b1 then 64 else 32;
let sub_op : bool = op == 0b1;
let setflags : bool = S == 0b1;
if shift == 0b11 then {
throw(Error_Undefined())
};
if sf == 0b0 & [imm6[5]] == 0b1 then {
throw(Error_Undefined())
};
let shift_type : ShiftType = DecodeShift(shift);
let 'shift_amount = UInt(imm6);
execute_aarch64_instrs_integer_arithmetic_add_sub_shiftedreg(d, datasize, m, n, setflags, shift_amount, shift_type, sub_op)
result : bits('datasize) = undefined;
let operand1 : bits('datasize) = X_read(n, datasize);
operand2 : bits('datasize) = ShiftReg(m, shift_type, shift_amount, datasize);
nzcv : bits(4) = undefined;
carry_in : bits(1) = undefined;
if sub_op then {
operand2 = not_vec(operand2);
carry_in = 0b1
} else {
carry_in = 0b0
};
(result, nzcv) = AddWithCarry(operand1, operand2, carry_in);
if setflags then {
(PSTATE.N @ PSTATE.Z @ PSTATE.C @ PSTATE.V) = nzcv
};
X_set(d, datasize) = 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.