PACIB

Branches, exception generating and system instructions / Data processing (register)

fixed bit field field the encoding fixes should be

Integer PAC pacib data processing 1 source

313029282726252423222120191817161514131211109876543210
110110101100000100Z001RnRd

110110101100000100x001xxxxxxxxxx

Decode Sail

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_pacib_dp_1src(d, n, source_is_sp)

Integer PAC pacib hint

313029282726252423222120191817161514131211109876543210
1101010100000011001000x101x11111
CRmop2

1101010100000011001000x101x11111

Decode Sail

d : {17, 30} = 17;
n : int = undefined;
source_is_sp : bool = false;
match CRm @ op2 {
  0b0011010 => {
      d = 30;
      n = 31
  },
  0b0011011 => {
      d = 30;
      source_is_sp = true;
      if HaveBTIExt() then {
          SetBTypeCompatible(BTypeCompatible_PACIXSP())
      };
      ()
  },
  0b0001010 => {
      d = 17;
      n = 16
  },
  0b0001000 => {
      throw(Error_See("PACIA"))
  },
  0b0001100 => {
      throw(Error_See("AUTIA"))
  },
  0b0001110 => {
      throw(Error_See("AUTIB"))
  },
  [bitzero, bitzero, bitone, bitone, bitzero, bitzero, _] => {
      throw(Error_See("PACIA"))
  },
  [bitzero, bitzero, bitone, bitone, bitone, bitzero, _] => {
      throw(Error_See("AUTIA"))
  },
  [bitzero, bitzero, bitone, bitone, bitone, bitone, _] => {
      throw(Error_See("AUTIB"))
  },
  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_pacib_dp_1src(d, n, source_is_sp)

Operation Sail

if HavePACExt() then {
    if source_is_sp then {
        X_set(d, 64) = AddPACIB(X_read(d, 64), SP_read())
    } else {
        X_set(d, 64) = AddPACIB(X_read(d, 64), X_read(n, 64))
    }
};
()

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.