]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[Morello] CLRTAG, CLRPERM
authorSiddhesh Poyarekar <siddesh.poyarekar@arm.com>
Fri, 11 Sep 2020 03:48:06 +0000 (09:18 +0530)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 22:53:20 +0000 (15:53 -0700)
gas/ChangeLog:

2020-10-20  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>

* config/tc-aarch64.c (parse_perms): New function.
(parse_operands): Add PERM.
* testsuite/gas/aarch64/morello_insn-c64.d: Add tests.
* testsuite/gas/aarch64/morello_insn.d: Likewise.
* testsuite/gas/aarch64/morello_insn.s: Likewise.

include/ChangeLog:

2020-10-20  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>

* opcode/aarch64.h (aarch64_operand_class): Add PERM.
(aarch64_opnd): Add PERM.
(get_perm_bit): New function.
(aarch64_opnd_info): New member perm.

opcodes/ChangeLog:

2020-10-20  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>

* aarch64-asm.c (aarch64_ins_perm): New function.
* aarch64-asm.h (ins_perm): New function.
* aarch64-dis.c (aarch64_ext_perm): New function.
* aarch64-dis.h (ext_perm): New function.
* aarch64-opc.c (fields): New field perm.
(get_perm_str, get_perm_bit): New functions.
(aarch64_print_operand): Add PERM.
* aarch64-opc.h (aarch64_field_kind): Add perm.
* aarch64-tbl.h (QL_I2SAMEQ): New macro.
(aarch64_opcode_table): New instructions.
(AARCH64_OPERANDS): New operands.
* aarch64-asm-2.c: Regenerate.
* aarch64-dis-2.c: Regenerate.
* aarch64-opc-2.c: Regenerate.

15 files changed:
gas/ChangeLog
gas/config/tc-aarch64.c
gas/testsuite/gas/aarch64/morello_insn-c64.d
gas/testsuite/gas/aarch64/morello_insn.d
gas/testsuite/gas/aarch64/morello_insn.s
include/ChangeLog
include/opcode/aarch64.h
opcodes/ChangeLog
opcodes/aarch64-asm.c
opcodes/aarch64-asm.h
opcodes/aarch64-dis.c
opcodes/aarch64-dis.h
opcodes/aarch64-opc.c
opcodes/aarch64-opc.h
opcodes/aarch64-tbl.h

index fe5bfa7346e6895e0a277327251dec4b0018089e..f6c3c5765e0fd85a6eed8b97251a897ca4935529 100644 (file)
@@ -1,3 +1,11 @@
+2020-10-20  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>
+
+       * config/tc-aarch64.c (parse_perms): New function.
+       (parse_operands): Add PERM.
+       * testsuite/gas/aarch64/morello_insn-c64.d: Add tests.
+       * testsuite/gas/aarch64/morello_insn.d: Likewise.
+       * testsuite/gas/aarch64/morello_insn.s: Likewise.
+
 2020-10-20  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>
 
        * testsuite/gas/aarch64/morello_insn-c64.d: Add tests.
index 38732f78f8b3031e5c56fb44380fe6996cd08c24..41f9bbce4696c0c558c5051aa4641b31fe68ede3 100644 (file)
@@ -6320,6 +6320,46 @@ reg_list_valid_p (uint32_t reginfo, int accept_alternate)
   return true;
 }
 
+static bool
+parse_perms (char **str, aarch64_opnd_info *info)
+{
+  char *p = *str;
+  char c;
+  aarch64_insn perms = 0;
+
+  /* Numeric value of permissions.  */
+  if (ISDIGIT (*p) || (*p == '#' && p++))
+    {
+      perms = *p - '0';
+      if (p[1] > 0 || perms > 7)
+       {
+         set_syntax_error (_("invalid permission value"));
+         return false;
+       }
+      p += 2;
+      goto out;
+    }
+
+  /* Permission specifier mnemonics r, w and x, in that order.  Do not accept
+     jumbled up sequences such as rxw, wrx, etc. and also reject duplicate
+     permissions such as rrxw.  */
+  while ((c = *p++) != '\0')
+    {
+      aarch64_insn i = get_perm_bit (c);
+      if (i > 7 || i & perms || (i - 1) & perms)
+       {
+         set_syntax_error (_("invalid permissions"));
+         return false;
+       }
+      perms |= i;
+    }
+
+out:
+  *str = p - 1;
+  info->perm = perms;
+  return true;
+}
+
 /* Generic instruction operand parser. This does no encoding and no
    semantic validation; it merely squirrels values away in the inst
    structure.  Returns TRUE or FALSE depending on whether the
@@ -7019,6 +7059,10 @@ parse_operands (char *str, const aarch64_opcode *opcode)
          }
          break;
 
+       case AARCH64_OPND_PERM:
+         po_misc_or_fail (parse_perms (&str, info));
+         break;
+
        case AARCH64_OPND_COND:
        case AARCH64_OPND_COND1:
          {
index dd6926cceb619fa839d45d71cbad2e7dcf6c19b1..f0506fc7aa7517df33f45bdc7415800ff4cb710f 100644 (file)
@@ -24,15 +24,19 @@ Disassembly of section \.text:
 .*:    c2c1d26b        mov     c11, c19
 .*:    c2c1d26b        mov     c11, c19
 .*:    c2d38561        chkss   c11, c19
+.*:    c2c1926b        clrtag  c11, c19
 .*:    c2c1d3eb        mov     c11, csp
 .*:    c2c1d3eb        mov     c11, csp
 .*:    c2df8561        chkss   c11, csp
+.*:    c2c193eb        clrtag  c11, csp
 .*:    c2c1d17f        mov     csp, c11
 .*:    c2c1d17f        mov     csp, c11
 .*:    c2cb87e1        chkss   csp, c11
+.*:    c2c1917f        clrtag  csp, c11
 .*:    c2c1d3ff        mov     csp, csp
 .*:    c2c1d3ff        mov     csp, csp
 .*:    c2df87e1        chkss   csp, csp
+.*:    c2c193ff        clrtag  csp, csp
 .*:    aa1f03e0        mov     x0, xzr
 .*:    c2c59020        cvtd    c0, x1
 .*:    c2c5d020        cvtdz   c0, x1
@@ -188,18 +192,37 @@ Disassembly of section \.text:
 .*:    c2cf5bff        alignu  csp, csp, #30
 .*:    c2c05bff        alignu  csp, csp, #0
 .*:    c2d05bff        alignu  csp, csp, #32
+.*:    c2c692f6        clrperm c22, c23, r
+.*:    c2c652f6        clrperm c22, c23, w
+.*:    c2c632f6        clrperm c22, c23, x
+.*:    c2c6b2f6        clrperm c22, c23, rx
+.*:    c2c672f6        clrperm c22, c23, wx
+.*:    c2c6d2f6        clrperm c22, c23, rw
+.*:    c2c6f2f6        clrperm c22, c23, rwx
+.*:    c2c612f6        clrperm c22, c23, #0
+.*:    c2c632f6        clrperm c22, c23, x
+.*:    c2c652f6        clrperm c22, c23, w
+.*:    c2c672f6        clrperm c22, c23, wx
+.*:    c2c692f6        clrperm c22, c23, r
+.*:    c2c6b2f6        clrperm c22, c23, rx
+.*:    c2c6d2f6        clrperm c22, c23, rw
+.*:    c2c6f2f6        clrperm c22, c23, rwx
 .*:    c2d928c7        bicflgs c7, c6, x25
 .*:    c2d9a8c7        eorflgs c7, c6, x25
 .*:    c2d968c7        orrflgs c7, c6, x25
+.*:    c2d9a0c7        clrperm c7, c6, x25
 .*:    c2d92be7        bicflgs c7, csp, x25
 .*:    c2d9abe7        eorflgs c7, csp, x25
 .*:    c2d96be7        orrflgs c7, csp, x25
+.*:    c2d9a3e7        clrperm c7, csp, x25
 .*:    c2d928df        bicflgs csp, c6, x25
 .*:    c2d9a8df        eorflgs csp, c6, x25
 .*:    c2d968df        orrflgs csp, c6, x25
+.*:    c2d9a0df        clrperm csp, c6, x25
 .*:    c2d92bff        bicflgs csp, csp, x25
 .*:    c2d9abff        eorflgs csp, csp, x25
 .*:    c2d96bff        orrflgs csp, csp, x25
+.*:    c2d9a3ff        clrperm csp, csp, x25
 .*:    c2ee99a4        subs    x4, c13, c14
 .*:    c2c4a440        blrs    c29, c2, c4
 .*:    c2c48440        brs     c29, c2, c4
index 9f451e1737f1e95af2032cffb2f87d590e29c754..61c24795e11b6353d2e88df7001cdd0cad547fae 100644 (file)
@@ -23,15 +23,19 @@ Disassembly of section \.text:
 .*:    c2c1d26b        mov     c11, c19
 .*:    c2c1d26b        mov     c11, c19
 .*:    c2d38561        chkss   c11, c19
+.*:    c2c1926b        clrtag  c11, c19
 .*:    c2c1d3eb        mov     c11, csp
 .*:    c2c1d3eb        mov     c11, csp
 .*:    c2df8561        chkss   c11, csp
+.*:    c2c193eb        clrtag  c11, csp
 .*:    c2c1d17f        mov     csp, c11
 .*:    c2c1d17f        mov     csp, c11
 .*:    c2cb87e1        chkss   csp, c11
+.*:    c2c1917f        clrtag  csp, c11
 .*:    c2c1d3ff        mov     csp, csp
 .*:    c2c1d3ff        mov     csp, csp
 .*:    c2df87e1        chkss   csp, csp
+.*:    c2c193ff        clrtag  csp, csp
 .*:    aa1f03e0        mov     x0, xzr
 .*:    c2c59020        cvtd    c0, x1
 .*:    c2c5d020        cvtdz   c0, x1
@@ -187,18 +191,37 @@ Disassembly of section \.text:
 .*:    c2cf5bff        alignu  csp, csp, #30
 .*:    c2c05bff        alignu  csp, csp, #0
 .*:    c2d05bff        alignu  csp, csp, #32
+.*:    c2c692f6        clrperm c22, c23, r
+.*:    c2c652f6        clrperm c22, c23, w
+.*:    c2c632f6        clrperm c22, c23, x
+.*:    c2c6b2f6        clrperm c22, c23, rx
+.*:    c2c672f6        clrperm c22, c23, wx
+.*:    c2c6d2f6        clrperm c22, c23, rw
+.*:    c2c6f2f6        clrperm c22, c23, rwx
+.*:    c2c612f6        clrperm c22, c23, #0
+.*:    c2c632f6        clrperm c22, c23, x
+.*:    c2c652f6        clrperm c22, c23, w
+.*:    c2c672f6        clrperm c22, c23, wx
+.*:    c2c692f6        clrperm c22, c23, r
+.*:    c2c6b2f6        clrperm c22, c23, rx
+.*:    c2c6d2f6        clrperm c22, c23, rw
+.*:    c2c6f2f6        clrperm c22, c23, rwx
 .*:    c2d928c7        bicflgs c7, c6, x25
 .*:    c2d9a8c7        eorflgs c7, c6, x25
 .*:    c2d968c7        orrflgs c7, c6, x25
+.*:    c2d9a0c7        clrperm c7, c6, x25
 .*:    c2d92be7        bicflgs c7, csp, x25
 .*:    c2d9abe7        eorflgs c7, csp, x25
 .*:    c2d96be7        orrflgs c7, csp, x25
+.*:    c2d9a3e7        clrperm c7, csp, x25
 .*:    c2d928df        bicflgs csp, c6, x25
 .*:    c2d9a8df        eorflgs csp, c6, x25
 .*:    c2d968df        orrflgs csp, c6, x25
+.*:    c2d9a0df        clrperm csp, c6, x25
 .*:    c2d92bff        bicflgs csp, csp, x25
 .*:    c2d9abff        eorflgs csp, csp, x25
 .*:    c2d96bff        orrflgs csp, csp, x25
+.*:    c2d9a3ff        clrperm csp, csp, x25
 .*:    c2ee99a4        subs    x4, c13, c14
 .*:    c2c4a440        blrs    c29, c2, c4
 .*:    c2c48440        brs     c29, c2, c4
index 71692158a9c80ca607c559a6509142c7fa8b8858..7389167b9700339a528711f2183005577b57a181 100644 (file)
@@ -22,7 +22,7 @@ morello_csp csp
 // Two operands (dn).
 
        .macro morello_cspcsp cdsp, cnsp
-         .irp op, cpy, mov, chkss
+         .irp op, cpy, mov, chkss, clrtag
            \op    \cdsp, \cnsp
          .endr
        .endm
@@ -108,10 +108,17 @@ morello_cspcspi6 csp, c16
 morello_cspcspi6 c18, csp
 morello_cspcspi6 csp, csp
 
+       .macro morello_perm cd, cn
+         .irp perm, r, w, x, rx, wx, rw, rwx, #0, #1, #2, #3, #4, #5, #6, #7
+           clrperm   \cd, \cn, \perm
+         .endr
+       .endm
+morello_perm c22, c23
+
 // Three operands (dnm)
 
        .macro morello_cspcspx cdsp, cnsp, xm
-         .irp op, bicflgs, eorflgs, orrflgs
+         .irp op, bicflgs, eorflgs, orrflgs, clrperm
            \op   \cdsp, \cnsp, \xm
          .endr
        .endm
index 5a04de89041172345704d9cce29b9e9f860017e2..279e1c5378571b90e8b119918a3a1bde5d7bf072 100644 (file)
@@ -1,3 +1,10 @@
+2020-10-20  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>
+
+       * opcode/aarch64.h (aarch64_operand_class): Add PERM.
+       (aarch64_opnd): Add PERM.
+       (get_perm_bit): New function.
+       (aarch64_opnd_info): New member perm.
+
 2020-10-20  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>
 
        * opcode/aarch64.h (aarch64_opnd): Add CST_REG, Cam_SP
index ab4cb09f54787effb55d92c2bd3e58c20390310e..9a08d40389caf3654b244fbd4907431b6d980ed3 100644 (file)
@@ -237,6 +237,7 @@ enum aarch64_operand_class
   AARCH64_OPND_CLASS_SYSTEM,
   AARCH64_OPND_CLASS_COND,
   AARCH64_OPND_CLASS_CAP_REG,
+  AARCH64_OPND_CLASS_PERM,
 };
 
 /* Operand code that helps both parsing and coding.
@@ -521,6 +522,7 @@ enum aarch64_opnd
                                   BRS/BLRS.  */
   AARCH64_OPND_A64C_AIMM,      /* Add immediate for A64C ADD/SUB.  */
   AARCH64_OPND_A64C_IMM8,      /* IMM8 for BICFLGS.  */
+  AARCH64_OPND_PERM,           /* 3-bit capability permission for e.g. CLRPERM.  */
 };
 
 /* Qualifier constrains an operand.  It either specifies a variant of an
@@ -1136,6 +1138,9 @@ extern const aarch64_cond aarch64_conds[16];
 
 const aarch64_cond* get_cond_from_value (aarch64_insn value);
 const aarch64_cond* get_inverted_cond (const aarch64_cond *cond);
+
+/* Capability permissions.  */
+aarch64_insn get_perm_bit (const char p);
 \f
 /* Structure representing an operand.  */
 
@@ -1213,6 +1218,7 @@ struct aarch64_opnd_info
        } za_tile_vector;
 
       const aarch64_cond *cond;
+      aarch64_insn perm;
       /* The encoding of the PSTATE field.  */
       aarch64_insn pstatefield;
       const aarch64_sys_ins_reg *sysins_op;
index 0a7c587a39fd9c9e4f27f047a3e4b416225b2ec6..7c76f936d558e4757c934b14a810506bdcc84cdc 100644 (file)
@@ -1,3 +1,20 @@
+2020-10-20  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>
+
+       * aarch64-asm.c (aarch64_ins_perm): New function.
+       * aarch64-asm.h (ins_perm): New function.
+       * aarch64-dis.c (aarch64_ext_perm): New function.
+       * aarch64-dis.h (ext_perm): New function.
+       * aarch64-opc.c (fields): New field perm.
+       (get_perm_str, get_perm_bit): New functions.
+       (aarch64_print_operand): Add PERM.
+       * aarch64-opc.h (aarch64_field_kind): Add perm.
+       * aarch64-tbl.h (QL_I2SAMEQ): New macro.
+       (aarch64_opcode_table): New instructions.
+       (AARCH64_OPERANDS): New operands.
+       * aarch64-asm-2.c: Regenerate.
+       * aarch64-dis-2.c: Regenerate.
+       * aarch64-opc-2.c: Regenerate.
+
 2020-10-20  Siddhesh Poyarekar  <siddesh.poyarekar@arm.com>
 
        * aarch64-tbl.h (QL2_A64C_X_CA, QL2_A64C_CA_X, QL2_A64C_X_X,
index 1a9a2bdf39d04316ce7554cf846d6e5ad3d41a86..94680526a691895dccbb8603fcd91ab42167d36d 100644 (file)
@@ -795,6 +795,18 @@ aarch64_ins_cond (const aarch64_operand *self ATTRIBUTE_UNUSED,
   return true;
 }
 
+/* Encode the permission operand for e.g. CLRPERM, <Cd>, <Cn>, <perm>.  */
+bool
+aarch64_ins_perm (const aarch64_operand *self ATTRIBUTE_UNUSED,
+                 const aarch64_opnd_info *info, aarch64_insn *code,
+                 const aarch64_inst *inst ATTRIBUTE_UNUSED,
+                 aarch64_operand_error *errors ATTRIBUTE_UNUSED)
+{
+  /* perm */
+  insert_field (FLD_perm, code, info->perm, 0);
+  return true;
+}
+
 /* Encode the system register operand for e.g. MRS <Xt>, <systemreg>.  */
 bool
 aarch64_ins_sysreg (const aarch64_operand *self ATTRIBUTE_UNUSED,
index eaa89cc3ce7b9d9498af9428ee091bae94a84943..75bc93294a0acefbd3ad7cc64bf5800b8ec86b3f 100644 (file)
@@ -66,6 +66,7 @@ AARCH64_DECL_OPD_INSERTER (ins_addr_simm10);
 AARCH64_DECL_OPD_INSERTER (ins_addr_uimm12);
 AARCH64_DECL_OPD_INSERTER (ins_simd_addr_post);
 AARCH64_DECL_OPD_INSERTER (ins_cond);
+AARCH64_DECL_OPD_INSERTER (ins_perm);
 AARCH64_DECL_OPD_INSERTER (ins_sysreg);
 AARCH64_DECL_OPD_INSERTER (ins_pstatefield);
 AARCH64_DECL_OPD_INSERTER (ins_sysins_op);
index 3f02c02ce5a94b731d4a5633b3266ec6f95933ba..e36a35dce7926fcf8095005d17a9d0002c0270a3 100644 (file)
@@ -1250,6 +1250,18 @@ aarch64_ext_cond (const aarch64_operand *self ATTRIBUTE_UNUSED,
   return true;
 }
 
+/* Decode the permission operand for e.g. CLRPERM <Cd>, <Cn>, <perm>.  */
+bool
+aarch64_ext_perm (const aarch64_operand *self ATTRIBUTE_UNUSED,
+                 aarch64_opnd_info *info,
+                 aarch64_insn code, const aarch64_inst *inst ATTRIBUTE_UNUSED,
+                 aarch64_operand_error *errors ATTRIBUTE_UNUSED)
+{
+  /* perm */
+  info->perm = extract_field (FLD_perm, code, 0);
+  return true;
+}
+
 /* Decode the system register operand for e.g. MRS <Xt>, <systemreg>.  */
 bool
 aarch64_ext_sysreg (const aarch64_operand *self ATTRIBUTE_UNUSED,
index 551c5369fa3b91e913a9d28290ce740f9770e5f0..fe827ab03f849ebdc1df449b03c949f6c47eef19 100644 (file)
@@ -90,6 +90,7 @@ AARCH64_DECL_OPD_EXTRACTOR (ext_addr_simm10);
 AARCH64_DECL_OPD_EXTRACTOR (ext_addr_uimm12);
 AARCH64_DECL_OPD_EXTRACTOR (ext_simd_addr_post);
 AARCH64_DECL_OPD_EXTRACTOR (ext_cond);
+AARCH64_DECL_OPD_EXTRACTOR (ext_perm);
 AARCH64_DECL_OPD_EXTRACTOR (ext_sysreg);
 AARCH64_DECL_OPD_EXTRACTOR (ext_pstatefield);
 AARCH64_DECL_OPD_EXTRACTOR (ext_sysins_op);
index 365345c1db17d8848b624c45c28259686bc2332e..850e8c1f9abaf3e42fd76db3b2a25db02cb99443 100644 (file)
@@ -354,6 +354,7 @@ const aarch64_field fields[] =
                   type instructions.  */
     { 22,  1 },        /* a64c_shift_ai: Shift bit in immediate ADD/SUB.  */
     { 13,  8 },        /* a64c_imm8: BICFLGS imm8.  */
+    { 13,  3 },        /* perm: permission specifier in clrperm.  */
 };
 
 enum aarch64_operand_class
@@ -410,6 +411,47 @@ get_inverted_cond (const aarch64_cond *cond)
   return &aarch64_conds[cond->value ^ 0x1];
 }
 
+/* Return a permission string in OUT.  OUT needs to be at least 4 bytes wide.  */
+static void
+get_perm_str (aarch64_insn perm, char *out)
+{
+  int i = 0;
+  assert (perm < 8);
+
+  /* XXX 0x0 is a valid permission, i.e. no permissions at all.  The
+     reference however deems the value to be RESERVED.  */
+  if (perm == 0)
+    {
+      out[i++] = '#';
+      out[i++] = '0';
+    }
+
+  if (perm & 4)
+    out[i++] = 'r';
+  if (perm & 2)
+    out[i++] = 'w';
+  if (perm & 1)
+    out[i++] = 'x';
+
+  out [i] = '\0';
+}
+
+aarch64_insn
+get_perm_bit (char p)
+{
+  switch (p)
+    {
+    case 'r':
+      return 4;
+    case 'w':
+      return 2;
+    case 'x':
+      return 1;
+    }
+
+  return 8;
+}
+
 /* Table describing the operand extension/shifting operators; indexed by
    enum aarch64_modifier_kind.
 
@@ -3731,6 +3773,14 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc,
       snprintf (buf, size, "#0x%x", (unsigned int)opnd->imm.value);
       break;
 
+    case AARCH64_OPND_PERM:
+       {
+         char perm[4];
+         get_perm_str (opnd->perm, perm);
+         snprintf (buf, size, "%s", perm);
+       }
+      break;
+
     case AARCH64_OPND_COND:
     case AARCH64_OPND_COND1:
       snprintf (buf, size, "%s", opnd->cond->names[0]);
index 4febb55472140dd51ab6fb23abde8f0453367333..fe30b7e1a72871d6be1c6034af29b521888a1100 100644 (file)
@@ -177,6 +177,7 @@ enum aarch64_field_kind
   FLD_Cat2,
   FLD_a64c_shift_ai,
   FLD_a64c_imm8,
+  FLD_perm,
 };
 
 /* Field description.  */
index f999ef63f42762b1d0418e6eda478b8bd0119541..ce494db4cdc93e35b747120389b1dbb54ba11c32 100644 (file)
   QLF2(X,X),                   \
 }
 
+#define QL_I2SAMEQ             \
+{                              \
+  QLF2(S_Q,S_Q),               \
+}
+
 /* e.g. CRC32B <Wd>, <Wn>, <Wm>.  */
 #define QL_I3SAMEW             \
 {                              \
@@ -4111,6 +4116,9 @@ const struct aarch64_opcode aarch64_opcode_table[] =
   A64C_INSN ("chksld", 0xc2c21001, 0xfffffc1f, a64c, 0, OP1 (Can_SP), QL1_A64C_CA, 0),
   A64C_INSN ("chktgd", 0xc2c23001, 0xfffffc1f, a64c, 0, OP1 (Can_SP), QL1_A64C_CA, 0),
   A64C_INSN ("chkssu", 0xc2c08800, 0xffe0fc00, a64c, 0, OP3 (Cad, Can_SP, Cam_SP), QL3_A64C_CA_CA_CA, 0),
+  A64C_INSN ("clrtag", 0xc2c19000, 0xfffffc00, a64c, 0, OP2 (Cad_SP, Can_SP), QL2_A64C_CA_CA, 0),
+  A64C_INSN ("clrperm", 0xc2c0a000, 0xffe0fc00, a64c, 0, OP3 (Cad_SP, Can_SP, Rm), QL3_A64C_CA_CA_X, 0),
+  A64C_INSN ("clrperm", 0xc2c61000, 0xffff1c00, a64c, 0, OP3 (Cad_SP, Can_SP, PERM), QL3_A64C_CA_CA_X, 0),
   A64C_INSN ("cseal", 0xc2c04400, 0xffe0fc00, a64c, 0, OP3 (Cad_SP, Can_SP, Cam_SP), QL3_A64C_CA_CA_CA, 0),
   A64C_INSN ("csel", 0xc2c00c00, 0xffe00c00, a64c, 0, OP4 (Cad, Can, Cam, COND), QL4_A64C_CSEL, 0),
   A64C_INSN ("cthi", 0xc2c0e800, 0xffe0fc00, a64c, 0, OP3 (Cad_SP, Can, Rm), QL3_A64C_CA_CA_X, 0),
@@ -6087,4 +6095,5 @@ const struct aarch64_opcode aarch64_opcode_table[] =
       F(FLD_a64c_shift_ai,FLD_imm12),                                  \
       "a 12-bit unsigned immediate with optional left shift of 12 bits")\
     Y(IMMEDIATE, imm, "A64C_IMM8", 0, F(FLD_a64c_imm8),                        \
-      "8-bit unsigned immediate")
+      "8-bit unsigned immediate")                                      \
+    Y(PERM, perm, "PERM", 0, F(), "a capability permission")