[llvm] 7fd2afa - [AArch64]SME2 Outer Product and Accumulate instructions

Caroline Concatto via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 06:19:30 PDT 2022


Author: Caroline Concatto
Date: 2022-11-01T13:18:48Z
New Revision: 7fd2afaf597e9b3cef64d6612fe9e7135a8811d1

URL: https://github.com/llvm/llvm-project/commit/7fd2afaf597e9b3cef64d6612fe9e7135a8811d1
DIFF: https://github.com/llvm/llvm-project/commit/7fd2afaf597e9b3cef64d6612fe9e7135a8811d1.diff

LOG: [AArch64]SME2 Outer Product and Accumulate instructions

This patch adds the assembly/disassembly for the following instructions:
  BMOPA: Bitwise exclusive NOR population count outer product and accumulate.
  BMOPS: Bitwise exclusive NOR population count outer product and subtract.

  SMOPA (2-way): Signed integer sum of outer products and accumulate.
  SMOPS (2-way): Signed integer sum of outer products and subtract.

  UMOPA (2-way): Unsigned integer sum of outer products and accumulate.
  UMOPS (2-way): Signed integer sum of outer products and accumulate.
The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

Differential Revision: https://reviews.llvm.org/D136077

Added: 
    llvm/test/MC/AArch64/SME2/bmopa-diagnostics.s
    llvm/test/MC/AArch64/SME2/bmopa.s
    llvm/test/MC/AArch64/SME2/bmops-diagnostics.s
    llvm/test/MC/AArch64/SME2/bmops.s
    llvm/test/MC/AArch64/SME2/smopa-diagnostics.s
    llvm/test/MC/AArch64/SME2/smopa.s
    llvm/test/MC/AArch64/SME2/smops-diagnostics.s
    llvm/test/MC/AArch64/SME2/smops.s
    llvm/test/MC/AArch64/SME2/umopa-diagnostics.s
    llvm/test/MC/AArch64/SME2/umopa.s
    llvm/test/MC/AArch64/SME2/umops-diagnostics.s
    llvm/test/MC/AArch64/SME2/umops.s

Modified: 
    llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
    llvm/lib/Target/AArch64/SMEInstrFormats.td
    llvm/test/MC/AArch64/SME/smopa-diagnostics.s
    llvm/test/MC/AArch64/SME/smops-diagnostics.s
    llvm/test/MC/AArch64/SME/umopa-diagnostics.s
    llvm/test/MC/AArch64/SME/umops-diagnostics.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td b/llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
index 2a4ffd055dad7..5a8149cf38500 100644
--- a/llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
+++ b/llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
@@ -53,8 +53,8 @@ let Predicates = [HasSME] in {
 // Outer products
 //===----------------------------------------------------------------------===//
 
-defm BFMOPA_MPPZZ  : sme_bf16_outer_product<0b0, "bfmopa", int_aarch64_sme_mopa_wide>;
-defm BFMOPS_MPPZZ  : sme_bf16_outer_product<0b1, "bfmops", int_aarch64_sme_mops_wide>;
+defm BFMOPA_MPPZZ  : sme_bf16_outer_product<0b000, "bfmopa", int_aarch64_sme_mopa_wide>;
+defm BFMOPS_MPPZZ  : sme_bf16_outer_product<0b001, "bfmops", int_aarch64_sme_mops_wide>;
 
 defm FMOPA_MPPZZ_S : sme_outer_product_fp32<0b0, "fmopa", int_aarch64_sme_mopa>;
 defm FMOPS_MPPZZ_S : sme_outer_product_fp32<0b1, "fmops", int_aarch64_sme_mops>;
@@ -66,8 +66,8 @@ defm FMOPS_MPPZZ_D : sme_outer_product_fp64<0b1, "fmops", int_aarch64_sme_mops>;
 }
 
 let Predicates = [HasSME] in {
-defm FMOPAL_MPPZZ  : sme_f16_outer_product<0b0, "fmopa", int_aarch64_sme_mopa_wide>;
-defm FMOPSL_MPPZZ  : sme_f16_outer_product<0b1, "fmops", int_aarch64_sme_mops_wide>;
+defm FMOPAL_MPPZZ  : sme_f16_outer_product<0b010, "fmopa", int_aarch64_sme_mopa_wide>;
+defm FMOPSL_MPPZZ  : sme_f16_outer_product<0b011, "fmops", int_aarch64_sme_mops_wide>;
 
 defm SMOPA_MPPZZ_S  : sme_int_outer_product_i32<0b000, "smopa",  int_aarch64_sme_smopa_wide>;
 defm SMOPS_MPPZZ_S  : sme_int_outer_product_i32<0b001, "smops",  int_aarch64_sme_smops_wide>;
@@ -550,8 +550,16 @@ defm UMLSLL_VG2_M2ZZ_BtoS  : sme2_mla_ll_array_vg24_single<"umlsll", 0b00110, Ma
 defm UMLSLL_VG4_M4ZZ_BtoS  : sme2_mla_ll_array_vg24_single<"umlsll", 0b01110, MatrixOp32, ZZZZ_b, ZPR4b8>;
 defm UMLSLL_VG2_M2Z2Z_BtoS : sme2_mla_ll_array_vg2_multi<"umlsll", 0b0110, MatrixOp32, ZZ_b_mul_r>;
 defm UMLSLL_VG4_M4Z4Z_BtoS : sme2_mla_ll_array_vg4_multi<"umlsll", 0b0110, MatrixOp32, ZZZZ_b_mul_r>;
-}
 
+defm BMOPA_MPPZZ_S : sme2_bfp_mopx_tile<"bmopa", 0b100>;
+defm BMOPS_MPPZZ_S : sme2_bfp_mopx_tile<"bmops", 0b101>;
+
+defm SMOPA_MPPZZ_HtoS : sme2_int_mopx_tile<"smopa", 0b000>;
+defm SMOPS_MPPZZ_HtoS : sme2_int_mopx_tile<"smops", 0b001>;
+
+defm UMOPA_MPPZZ_HtoS : sme2_int_mopx_tile<"umopa", 0b100>;
+defm UMOPS_MPPZZ_HtoS : sme2_int_mopx_tile<"umops", 0b101>;
+}
 
 let Predicates = [HasSME2, HasSMEI16I64] in {
 defm ADD_VG2_M2ZZ_D  : sme2_dot_mla_add_sub_array_vg24_single<"add", 0b1011010, MatrixOp64, ZZ_d, ZPR4b64>;

diff  --git a/llvm/lib/Target/AArch64/SMEInstrFormats.td b/llvm/lib/Target/AArch64/SMEInstrFormats.td
index 9ebdd621aed5e..98f1c861a5c26 100644
--- a/llvm/lib/Target/AArch64/SMEInstrFormats.td
+++ b/llvm/lib/Target/AArch64/SMEInstrFormats.td
@@ -87,7 +87,7 @@ multiclass sme_outer_product_fp64<bit S, string mnemonic, SDPatternOperator op>
             (!cast<Instruction>(NAME # _PSEUDO) timm32_0_7:$tile, $pn, $pm, $zn, $zm)>;
 }
 
-class sme_int_outer_product_inst<bit u0, bit u1, bit S, bit sz,
+class sme_int_outer_product_inst<bits<3> opc, bit sz, bit sme2,
                                  MatrixTileOperand za_ty, ZPRRegOp zpr_ty,
                                  string mnemonic>
     : I<(outs za_ty:$ZAda),
@@ -100,23 +100,23 @@ class sme_int_outer_product_inst<bit u0, bit u1, bit S, bit sz,
   bits<3> Pn;
   bits<5> Zn;
   let Inst{31-25} = 0b1010000;
-  let Inst{24}    = u0;
+  let Inst{24}    = opc{2}; // u0
   let Inst{23}    = 0b1;
   let Inst{22}    = sz;
-  let Inst{21}    = u1;
+  let Inst{21}    = opc{1}; // u1
   let Inst{20-16} = Zm;
   let Inst{15-13} = Pm;
   let Inst{12-10} = Pn;
   let Inst{9-5}   = Zn;
-  let Inst{4}     = S;
-  let Inst{3}     = 0b0;
+  let Inst{4}     = opc{0};  //S;
+  let Inst{3}     = sme2;
 
   let Constraints = "$ZAda = $_ZAda";
 }
 
 multiclass sme_int_outer_product_i32<bits<3> opc, string mnemonic,
                                      SDPatternOperator op> {
-  def NAME : sme_int_outer_product_inst<opc{2}, opc{1}, opc{0}, 0b0, TileOp32,
+  def NAME : sme_int_outer_product_inst<opc, 0b0, 0b0,  TileOp32,
                                         ZPR8, mnemonic> {
     bits<2> ZAda;
     let Inst{1-0} = ZAda;
@@ -132,7 +132,7 @@ multiclass sme_int_outer_product_i32<bits<3> opc, string mnemonic,
 
 multiclass sme_int_outer_product_i64<bits<3> opc, string mnemonic,
                                      SDPatternOperator op> {
-  def NAME : sme_int_outer_product_inst<opc{2}, opc{1}, opc{0}, 0b1, TileOp64,
+  def NAME : sme_int_outer_product_inst<opc, 0b1, 0b0, TileOp64,
                                         ZPR16, mnemonic> {
     bits<3> ZAda;
     let Inst{2-0} = ZAda;
@@ -145,9 +145,9 @@ multiclass sme_int_outer_product_i64<bits<3> opc, string mnemonic,
             (!cast<Instruction>(NAME # _PSEUDO) timm32_0_7:$tile, $pn, $pm, $zn, $zm)>;
 }
 
-class sme_outer_product_widening_inst<bit op, bit S, string mnemonic>
+class sme_outer_product_widening_inst<bits<3> opc, ZPRRegOp zpr_ty, string mnemonic>
     : I<(outs TileOp32:$ZAda),
-        (ins  TileOp32:$_ZAda, PPR3bAny:$Pn, PPR3bAny:$Pm, ZPR16:$Zn, ZPR16:$Zm),
+        (ins  TileOp32:$_ZAda, PPR3bAny:$Pn, PPR3bAny:$Pm, zpr_ty:$Zn, zpr_ty:$Zm),
         mnemonic, "\t$ZAda, $Pn/m, $Pm/m, $Zn, $Zm",
         "", []>,
       Sched<[]> {
@@ -156,21 +156,24 @@ class sme_outer_product_widening_inst<bit op, bit S, string mnemonic>
   bits<3> Pn;
   bits<5> Zn;
   bits<2> ZAda;
-  let Inst{31-22} = 0b1000000110;
-  let Inst{21}    = op;
+  let Inst{31-25} = 0b1000000;
+  let Inst{24}    = !if(opc{2}, 0, 1);
+  let Inst{23-22} = 0b10;
+  let Inst{21}    = opc{1};
   let Inst{20-16} = Zm;
   let Inst{15-13} = Pm;
   let Inst{12-10} = Pn;
   let Inst{9-5}   = Zn;
-  let Inst{4}     = S;
-  let Inst{3-2}   = 0b00;
+  let Inst{4}     = opc{0};
+  let Inst{3}     = opc{2};
+  let Inst{2}     = 0b0;
   let Inst{1-0}   = ZAda;
 
   let Constraints = "$ZAda = $_ZAda";
 }
 
-multiclass sme_bf16_outer_product<bit S, string mnemonic, SDPatternOperator op> {
-  def NAME : sme_outer_product_widening_inst<0b0, S, mnemonic>;
+multiclass sme_bf16_outer_product<bits<3> opc, string mnemonic, SDPatternOperator op> {
+  def NAME : sme_outer_product_widening_inst<opc, ZPR16, mnemonic>;
 
   def NAME # _PSEUDO : sme_outer_product_pseudo<ZPR16>;
 
@@ -179,8 +182,8 @@ multiclass sme_bf16_outer_product<bit S, string mnemonic, SDPatternOperator op>
             (!cast<Instruction>(NAME # _PSEUDO) timm32_0_3:$tile, $pn, $pm, $zn, $zm)>;
 }
 
-multiclass sme_f16_outer_product<bit S, string mnemonic, SDPatternOperator op> {
-  def NAME : sme_outer_product_widening_inst<0b1, S, mnemonic>;
+multiclass sme_f16_outer_product<bits<3> opc, string mnemonic, SDPatternOperator op> {
+  def NAME : sme_outer_product_widening_inst<opc, ZPR16, mnemonic>;
 
   def NAME # _PSEUDO : sme_outer_product_pseudo<ZPR16>;
 
@@ -2361,3 +2364,18 @@ multiclass sme2_mla_ll_array_vg4_multi<string mnemonic, bits<4> op,
   def : InstAlias<mnemonic # "\t$ZAda[$Rv, $imm], $Zn, $Zm",
                  (!cast<Instruction>(NAME) matrix_ty:$ZAda, MatrixIndexGPR32Op8_11:$Rv, uimm1s4range:$imm, vector_ty:$Zn, vector_ty:$Zm), 0>;
 }
+
+//===----------------------------------------------------------------------===//
+// SME2 Outer Product and Accumulate
+
+multiclass sme2_int_mopx_tile<string mnemonic, bits<3> op> {
+  def NAME : sme_int_outer_product_inst<op, 0b0, 0b1, TileOp32, ZPR16, mnemonic> {
+    bits<2> ZAda;
+    let Inst{1-0} = ZAda;
+    let Inst{2}   = 0b0;
+  }
+}
+
+multiclass  sme2_bfp_mopx_tile<string mnemonic, bits<3> op> {
+  def NAME : sme_outer_product_widening_inst<op, ZPR32, mnemonic>;
+}

diff  --git a/llvm/test/MC/AArch64/SME/smopa-diagnostics.s b/llvm/test/MC/AArch64/SME/smopa-diagnostics.s
index 435e6cb4b1650..02ef1eb58aeb8 100644
--- a/llvm/test/MC/AArch64/SME/smopa-diagnostics.s
+++ b/llvm/test/MC/AArch64/SME/smopa-diagnostics.s
@@ -67,7 +67,7 @@ smopa za0.d, p0/m, p0/z, z0.h, z0.h
 // expected: .s => .b, .d => .h
 
 smopa za0.s, p0/m, p0/m, z0.h, z0.b
-// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
 // CHECK-NEXT: smopa za0.s, p0/m, p0/m, z0.h, z0.b
 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
 

diff  --git a/llvm/test/MC/AArch64/SME/smops-diagnostics.s b/llvm/test/MC/AArch64/SME/smops-diagnostics.s
index 5d10a33aeb8ed..ef927dc1e98ff 100644
--- a/llvm/test/MC/AArch64/SME/smops-diagnostics.s
+++ b/llvm/test/MC/AArch64/SME/smops-diagnostics.s
@@ -67,7 +67,7 @@ smops za0.d, p0/m, p0/z, z0.h, z0.h
 // expected: .s => .b, .d => .h
 
 smops za0.s, p0/m, p0/m, z0.h, z0.b
-// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
 // CHECK-NEXT: smops za0.s, p0/m, p0/m, z0.h, z0.b
 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
 

diff  --git a/llvm/test/MC/AArch64/SME/umopa-diagnostics.s b/llvm/test/MC/AArch64/SME/umopa-diagnostics.s
index f39b52e1015a2..dc636bcdb483d 100644
--- a/llvm/test/MC/AArch64/SME/umopa-diagnostics.s
+++ b/llvm/test/MC/AArch64/SME/umopa-diagnostics.s
@@ -67,7 +67,7 @@ umopa za0.d, p0/m, p0/z, z0.h, z0.h
 // expected: .s => .b, .d => .h
 
 umopa za0.s, p0/m, p0/m, z0.h, z0.b
-// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
 // CHECK-NEXT: umopa za0.s, p0/m, p0/m, z0.h, z0.b
 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
 

diff  --git a/llvm/test/MC/AArch64/SME/umops-diagnostics.s b/llvm/test/MC/AArch64/SME/umops-diagnostics.s
index c72358607ffa7..6f23027f62a2e 100644
--- a/llvm/test/MC/AArch64/SME/umops-diagnostics.s
+++ b/llvm/test/MC/AArch64/SME/umops-diagnostics.s
@@ -67,7 +67,7 @@ umops za0.d, p0/m, p0/z, z0.h, z0.h
 // expected: .s => .b, .d => .h
 
 umops za0.s, p0/m, p0/m, z0.h, z0.b
-// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
 // CHECK-NEXT: umops za0.s, p0/m, p0/m, z0.h, z0.b
 // CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
 

diff  --git a/llvm/test/MC/AArch64/SME2/bmopa-diagnostics.s b/llvm/test/MC/AArch64/SME2/bmopa-diagnostics.s
new file mode 100644
index 0000000000000..59a47d58dba1d
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/bmopa-diagnostics.s
@@ -0,0 +1,35 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 2>&1 < %s | FileCheck %s
+
+// --------------------------------------------------------------------------//
+// Invalid tile
+
+bmopa za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: bmopa za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid predicate
+
+bmopa za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: bmopa za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+bmopa za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
+// CHECK-NEXT: bmopa za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid suffixes
+
+bmopa za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za[0-3].s
+// CHECK-NEXT: bmopa za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+bmopa za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

diff  --git a/llvm/test/MC/AArch64/SME2/bmopa.s b/llvm/test/MC/AArch64/SME2/bmopa.s
new file mode 100644
index 0000000000000..3aaeae3dfbe56
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/bmopa.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=+sme2 - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=-sme2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -mattr=+sme2 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
+bmopa   za0.s, p0/m, p0/m, z0.s, z0.s  // 10000000-10000000-00000000-00001000
+// CHECK-INST: bmopa   za0.s, p0/m, p0/m, z0.s, z0.s
+// CHECK-ENCODING: [0x08,0x00,0x80,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 80800008 <unknown>
+
+bmopa   za1.s, p5/m, p2/m, z10.s, z21.s  // 10000000-10010101-01010101-01001001
+// CHECK-INST: bmopa   za1.s, p5/m, p2/m, z10.s, z21.s
+// CHECK-ENCODING: [0x49,0x55,0x95,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 80955549 <unknown>
+
+bmopa   za3.s, p3/m, p7/m, z13.s, z8.s  // 10000000-10001000-11101101-10101011
+// CHECK-INST: bmopa   za3.s, p3/m, p7/m, z13.s, z8.s
+// CHECK-ENCODING: [0xab,0xed,0x88,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 8088edab <unknown>
+
+bmopa   za3.s, p7/m, p7/m, z31.s, z31.s  // 10000000-10011111-11111111-11101011
+// CHECK-INST: bmopa   za3.s, p7/m, p7/m, z31.s, z31.s
+// CHECK-ENCODING: [0xeb,0xff,0x9f,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 809fffeb <unknown>
+
+bmopa   za1.s, p3/m, p0/m, z17.s, z16.s  // 10000000-10010000-00001110-00101001
+// CHECK-INST: bmopa   za1.s, p3/m, p0/m, z17.s, z16.s
+// CHECK-ENCODING: [0x29,0x0e,0x90,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 80900e29 <unknown>
+
+bmopa   za1.s, p1/m, p4/m, z1.s, z30.s  // 10000000-10011110-10000100-00101001
+// CHECK-INST: bmopa   za1.s, p1/m, p4/m, z1.s, z30.s
+// CHECK-ENCODING: [0x29,0x84,0x9e,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 809e8429 <unknown>
+
+bmopa   za0.s, p5/m, p2/m, z19.s, z20.s  // 10000000-10010100-01010110-01101000
+// CHECK-INST: bmopa   za0.s, p5/m, p2/m, z19.s, z20.s
+// CHECK-ENCODING: [0x68,0x56,0x94,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 80945668 <unknown>
+
+bmopa   za0.s, p6/m, p0/m, z12.s, z2.s  // 10000000-10000010-00011001-10001000
+// CHECK-INST: bmopa   za0.s, p6/m, p0/m, z12.s, z2.s
+// CHECK-ENCODING: [0x88,0x19,0x82,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 80821988 <unknown>
+
+bmopa   za1.s, p2/m, p6/m, z1.s, z26.s  // 10000000-10011010-11001000-00101001
+// CHECK-INST: bmopa   za1.s, p2/m, p6/m, z1.s, z26.s
+// CHECK-ENCODING: [0x29,0xc8,0x9a,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 809ac829 <unknown>
+
+bmopa   za1.s, p2/m, p0/m, z22.s, z30.s  // 10000000-10011110-00001010-11001001
+// CHECK-INST: bmopa   za1.s, p2/m, p0/m, z22.s, z30.s
+// CHECK-ENCODING: [0xc9,0x0a,0x9e,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 809e0ac9 <unknown>
+
+bmopa   za2.s, p5/m, p7/m, z9.s, z1.s  // 10000000-10000001-11110101-00101010
+// CHECK-INST: bmopa   za2.s, p5/m, p7/m, z9.s, z1.s
+// CHECK-ENCODING: [0x2a,0xf5,0x81,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 8081f52a <unknown>
+
+bmopa   za3.s, p2/m, p5/m, z12.s, z11.s  // 10000000-10001011-10101001-10001011
+// CHECK-INST: bmopa   za3.s, p2/m, p5/m, z12.s, z11.s
+// CHECK-ENCODING: [0x8b,0xa9,0x8b,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 808ba98b <unknown>
+

diff  --git a/llvm/test/MC/AArch64/SME2/bmops-diagnostics.s b/llvm/test/MC/AArch64/SME2/bmops-diagnostics.s
new file mode 100644
index 0000000000000..e6842e185d8a4
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/bmops-diagnostics.s
@@ -0,0 +1,35 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 2>&1 < %s | FileCheck %s
+
+// --------------------------------------------------------------------------//
+// Invalid tile
+
+bmops za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: bmops za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid predicate
+
+bmops za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: bmops za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+bmops za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
+// CHECK-NEXT: bmops za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid suffixes
+
+bmops za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za[0-3].s
+// CHECK-NEXT: bmops za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+bmops za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

diff  --git a/llvm/test/MC/AArch64/SME2/bmops.s b/llvm/test/MC/AArch64/SME2/bmops.s
new file mode 100644
index 0000000000000..d292f0031b805
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/bmops.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=+sme2 - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=-sme2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -mattr=+sme2 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
+bmops   za0.s, p0/m, p0/m, z0.s, z0.s  // 10000000-10000000-00000000-00011000
+// CHECK-INST: bmops   za0.s, p0/m, p0/m, z0.s, z0.s
+// CHECK-ENCODING: [0x18,0x00,0x80,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 80800018 <unknown>
+
+bmops   za1.s, p5/m, p2/m, z10.s, z21.s  // 10000000-10010101-01010101-01011001
+// CHECK-INST: bmops   za1.s, p5/m, p2/m, z10.s, z21.s
+// CHECK-ENCODING: [0x59,0x55,0x95,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 80955559 <unknown>
+
+bmops   za3.s, p3/m, p7/m, z13.s, z8.s  // 10000000-10001000-11101101-10111011
+// CHECK-INST: bmops   za3.s, p3/m, p7/m, z13.s, z8.s
+// CHECK-ENCODING: [0xbb,0xed,0x88,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 8088edbb <unknown>
+
+bmops   za3.s, p7/m, p7/m, z31.s, z31.s  // 10000000-10011111-11111111-11111011
+// CHECK-INST: bmops   za3.s, p7/m, p7/m, z31.s, z31.s
+// CHECK-ENCODING: [0xfb,0xff,0x9f,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 809ffffb <unknown>
+
+bmops   za1.s, p3/m, p0/m, z17.s, z16.s  // 10000000-10010000-00001110-00111001
+// CHECK-INST: bmops   za1.s, p3/m, p0/m, z17.s, z16.s
+// CHECK-ENCODING: [0x39,0x0e,0x90,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 80900e39 <unknown>
+
+bmops   za1.s, p1/m, p4/m, z1.s, z30.s  // 10000000-10011110-10000100-00111001
+// CHECK-INST: bmops   za1.s, p1/m, p4/m, z1.s, z30.s
+// CHECK-ENCODING: [0x39,0x84,0x9e,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 809e8439 <unknown>
+
+bmops   za0.s, p5/m, p2/m, z19.s, z20.s  // 10000000-10010100-01010110-01111000
+// CHECK-INST: bmops   za0.s, p5/m, p2/m, z19.s, z20.s
+// CHECK-ENCODING: [0x78,0x56,0x94,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 80945678 <unknown>
+
+bmops   za0.s, p6/m, p0/m, z12.s, z2.s  // 10000000-10000010-00011001-10011000
+// CHECK-INST: bmops   za0.s, p6/m, p0/m, z12.s, z2.s
+// CHECK-ENCODING: [0x98,0x19,0x82,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 80821998 <unknown>
+
+bmops   za1.s, p2/m, p6/m, z1.s, z26.s  // 10000000-10011010-11001000-00111001
+// CHECK-INST: bmops   za1.s, p2/m, p6/m, z1.s, z26.s
+// CHECK-ENCODING: [0x39,0xc8,0x9a,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 809ac839 <unknown>
+
+bmops   za1.s, p2/m, p0/m, z22.s, z30.s  // 10000000-10011110-00001010-11011001
+// CHECK-INST: bmops   za1.s, p2/m, p0/m, z22.s, z30.s
+// CHECK-ENCODING: [0xd9,0x0a,0x9e,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 809e0ad9 <unknown>
+
+bmops   za2.s, p5/m, p7/m, z9.s, z1.s  // 10000000-10000001-11110101-00111010
+// CHECK-INST: bmops   za2.s, p5/m, p7/m, z9.s, z1.s
+// CHECK-ENCODING: [0x3a,0xf5,0x81,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 8081f53a <unknown>
+
+bmops   za3.s, p2/m, p5/m, z12.s, z11.s  // 10000000-10001011-10101001-10011011
+// CHECK-INST: bmops   za3.s, p2/m, p5/m, z12.s, z11.s
+// CHECK-ENCODING: [0x9b,0xa9,0x8b,0x80]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: 808ba99b <unknown>
+

diff  --git a/llvm/test/MC/AArch64/SME2/smopa-diagnostics.s b/llvm/test/MC/AArch64/SME2/smopa-diagnostics.s
new file mode 100644
index 0000000000000..50103ab0ab043
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/smopa-diagnostics.s
@@ -0,0 +1,35 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 2>&1 < %s | FileCheck %s
+
+// --------------------------------------------------------------------------//
+// Invalid tile
+
+smopa za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: smopa za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid predicate
+
+smopa za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: smopa za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+smopa za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
+// CHECK-NEXT: smopa za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid suffixes
+
+smopa za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za[0-3].s
+// CHECK-NEXT: smopa za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+smopa za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

diff  --git a/llvm/test/MC/AArch64/SME2/smopa.s b/llvm/test/MC/AArch64/SME2/smopa.s
new file mode 100644
index 0000000000000..ef2292f42d09b
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/smopa.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=+sme2 - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=-sme2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -mattr=+sme2 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
+smopa   za0.s, p0/m, p0/m, z0.h, z0.h  // 10100000-10000000-00000000-00001000
+// CHECK-INST: smopa   za0.s, p0/m, p0/m, z0.h, z0.h
+// CHECK-ENCODING: [0x08,0x00,0x80,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a0800008 <unknown>
+
+smopa   za1.s, p5/m, p2/m, z10.h, z21.h  // 10100000-10010101-01010101-01001001
+// CHECK-INST: smopa   za1.s, p5/m, p2/m, z10.h, z21.h
+// CHECK-ENCODING: [0x49,0x55,0x95,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a0955549 <unknown>
+
+smopa   za3.s, p3/m, p7/m, z13.h, z8.h  // 10100000-10001000-11101101-10101011
+// CHECK-INST: smopa   za3.s, p3/m, p7/m, z13.h, z8.h
+// CHECK-ENCODING: [0xab,0xed,0x88,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a088edab <unknown>
+
+smopa   za3.s, p7/m, p7/m, z31.h, z31.h  // 10100000-10011111-11111111-11101011
+// CHECK-INST: smopa   za3.s, p7/m, p7/m, z31.h, z31.h
+// CHECK-ENCODING: [0xeb,0xff,0x9f,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a09fffeb <unknown>
+
+smopa   za1.s, p3/m, p0/m, z17.h, z16.h  // 10100000-10010000-00001110-00101001
+// CHECK-INST: smopa   za1.s, p3/m, p0/m, z17.h, z16.h
+// CHECK-ENCODING: [0x29,0x0e,0x90,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a0900e29 <unknown>
+
+smopa   za1.s, p1/m, p4/m, z1.h, z30.h  // 10100000-10011110-10000100-00101001
+// CHECK-INST: smopa   za1.s, p1/m, p4/m, z1.h, z30.h
+// CHECK-ENCODING: [0x29,0x84,0x9e,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a09e8429 <unknown>
+
+smopa   za0.s, p5/m, p2/m, z19.h, z20.h  // 10100000-10010100-01010110-01101000
+// CHECK-INST: smopa   za0.s, p5/m, p2/m, z19.h, z20.h
+// CHECK-ENCODING: [0x68,0x56,0x94,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a0945668 <unknown>
+
+smopa   za0.s, p6/m, p0/m, z12.h, z2.h  // 10100000-10000010-00011001-10001000
+// CHECK-INST: smopa   za0.s, p6/m, p0/m, z12.h, z2.h
+// CHECK-ENCODING: [0x88,0x19,0x82,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a0821988 <unknown>
+
+smopa   za1.s, p2/m, p6/m, z1.h, z26.h  // 10100000-10011010-11001000-00101001
+// CHECK-INST: smopa   za1.s, p2/m, p6/m, z1.h, z26.h
+// CHECK-ENCODING: [0x29,0xc8,0x9a,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a09ac829 <unknown>
+
+smopa   za1.s, p2/m, p0/m, z22.h, z30.h  // 10100000-10011110-00001010-11001001
+// CHECK-INST: smopa   za1.s, p2/m, p0/m, z22.h, z30.h
+// CHECK-ENCODING: [0xc9,0x0a,0x9e,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a09e0ac9 <unknown>
+
+smopa   za2.s, p5/m, p7/m, z9.h, z1.h  // 10100000-10000001-11110101-00101010
+// CHECK-INST: smopa   za2.s, p5/m, p7/m, z9.h, z1.h
+// CHECK-ENCODING: [0x2a,0xf5,0x81,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a081f52a <unknown>
+
+smopa   za3.s, p2/m, p5/m, z12.h, z11.h  // 10100000-10001011-10101001-10001011
+// CHECK-INST: smopa   za3.s, p2/m, p5/m, z12.h, z11.h
+// CHECK-ENCODING: [0x8b,0xa9,0x8b,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a08ba98b <unknown>
+

diff  --git a/llvm/test/MC/AArch64/SME2/smops-diagnostics.s b/llvm/test/MC/AArch64/SME2/smops-diagnostics.s
new file mode 100644
index 0000000000000..9fe969b0e6c68
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/smops-diagnostics.s
@@ -0,0 +1,35 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 2>&1 < %s | FileCheck %s
+
+// --------------------------------------------------------------------------//
+// Invalid tile
+
+smops za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: smops za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid predicate
+
+smops za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: smops za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+smops za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
+// CHECK-NEXT: smops za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid suffixes
+
+smops za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za[0-3].s
+// CHECK-NEXT: smops za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+smops za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

diff  --git a/llvm/test/MC/AArch64/SME2/smops.s b/llvm/test/MC/AArch64/SME2/smops.s
new file mode 100644
index 0000000000000..25a396a67ac7d
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/smops.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=+sme2 - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=-sme2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -mattr=+sme2 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
+smops   za0.s, p0/m, p0/m, z0.h, z0.h  // 10100000-10000000-00000000-00011000
+// CHECK-INST: smops   za0.s, p0/m, p0/m, z0.h, z0.h
+// CHECK-ENCODING: [0x18,0x00,0x80,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a0800018 <unknown>
+
+smops   za1.s, p5/m, p2/m, z10.h, z21.h  // 10100000-10010101-01010101-01011001
+// CHECK-INST: smops   za1.s, p5/m, p2/m, z10.h, z21.h
+// CHECK-ENCODING: [0x59,0x55,0x95,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a0955559 <unknown>
+
+smops   za3.s, p3/m, p7/m, z13.h, z8.h  // 10100000-10001000-11101101-10111011
+// CHECK-INST: smops   za3.s, p3/m, p7/m, z13.h, z8.h
+// CHECK-ENCODING: [0xbb,0xed,0x88,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a088edbb <unknown>
+
+smops   za3.s, p7/m, p7/m, z31.h, z31.h  // 10100000-10011111-11111111-11111011
+// CHECK-INST: smops   za3.s, p7/m, p7/m, z31.h, z31.h
+// CHECK-ENCODING: [0xfb,0xff,0x9f,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a09ffffb <unknown>
+
+smops   za1.s, p3/m, p0/m, z17.h, z16.h  // 10100000-10010000-00001110-00111001
+// CHECK-INST: smops   za1.s, p3/m, p0/m, z17.h, z16.h
+// CHECK-ENCODING: [0x39,0x0e,0x90,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a0900e39 <unknown>
+
+smops   za1.s, p1/m, p4/m, z1.h, z30.h  // 10100000-10011110-10000100-00111001
+// CHECK-INST: smops   za1.s, p1/m, p4/m, z1.h, z30.h
+// CHECK-ENCODING: [0x39,0x84,0x9e,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a09e8439 <unknown>
+
+smops   za0.s, p5/m, p2/m, z19.h, z20.h  // 10100000-10010100-01010110-01111000
+// CHECK-INST: smops   za0.s, p5/m, p2/m, z19.h, z20.h
+// CHECK-ENCODING: [0x78,0x56,0x94,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a0945678 <unknown>
+
+smops   za0.s, p6/m, p0/m, z12.h, z2.h  // 10100000-10000010-00011001-10011000
+// CHECK-INST: smops   za0.s, p6/m, p0/m, z12.h, z2.h
+// CHECK-ENCODING: [0x98,0x19,0x82,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a0821998 <unknown>
+
+smops   za1.s, p2/m, p6/m, z1.h, z26.h  // 10100000-10011010-11001000-00111001
+// CHECK-INST: smops   za1.s, p2/m, p6/m, z1.h, z26.h
+// CHECK-ENCODING: [0x39,0xc8,0x9a,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a09ac839 <unknown>
+
+smops   za1.s, p2/m, p0/m, z22.h, z30.h  // 10100000-10011110-00001010-11011001
+// CHECK-INST: smops   za1.s, p2/m, p0/m, z22.h, z30.h
+// CHECK-ENCODING: [0xd9,0x0a,0x9e,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a09e0ad9 <unknown>
+
+smops   za2.s, p5/m, p7/m, z9.h, z1.h  // 10100000-10000001-11110101-00111010
+// CHECK-INST: smops   za2.s, p5/m, p7/m, z9.h, z1.h
+// CHECK-ENCODING: [0x3a,0xf5,0x81,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a081f53a <unknown>
+
+smops   za3.s, p2/m, p5/m, z12.h, z11.h  // 10100000-10001011-10101001-10011011
+// CHECK-INST: smops   za3.s, p2/m, p5/m, z12.h, z11.h
+// CHECK-ENCODING: [0x9b,0xa9,0x8b,0xa0]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a08ba99b <unknown>
+

diff  --git a/llvm/test/MC/AArch64/SME2/umopa-diagnostics.s b/llvm/test/MC/AArch64/SME2/umopa-diagnostics.s
new file mode 100644
index 0000000000000..67b6f29eb727b
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/umopa-diagnostics.s
@@ -0,0 +1,35 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 2>&1 < %s | FileCheck %s
+
+// --------------------------------------------------------------------------//
+// Invalid tile
+
+umopa za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: umopa za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid predicate
+
+umopa za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: umopa za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+umopa za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
+// CHECK-NEXT: umopa za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid suffixes
+
+umopa za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za[0-3].s
+// CHECK-NEXT: umopa za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+umopa za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

diff  --git a/llvm/test/MC/AArch64/SME2/umopa.s b/llvm/test/MC/AArch64/SME2/umopa.s
new file mode 100644
index 0000000000000..37fc9fa366812
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/umopa.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=+sme2 - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=-sme2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -mattr=+sme2 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
+umopa   za0.s, p0/m, p0/m, z0.h, z0.h  // 10100001-10000000-00000000-00001000
+// CHECK-INST: umopa   za0.s, p0/m, p0/m, z0.h, z0.h
+// CHECK-ENCODING: [0x08,0x00,0x80,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a1800008 <unknown>
+
+umopa   za1.s, p5/m, p2/m, z10.h, z21.h  // 10100001-10010101-01010101-01001001
+// CHECK-INST: umopa   za1.s, p5/m, p2/m, z10.h, z21.h
+// CHECK-ENCODING: [0x49,0x55,0x95,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a1955549 <unknown>
+
+umopa   za3.s, p3/m, p7/m, z13.h, z8.h  // 10100001-10001000-11101101-10101011
+// CHECK-INST: umopa   za3.s, p3/m, p7/m, z13.h, z8.h
+// CHECK-ENCODING: [0xab,0xed,0x88,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a188edab <unknown>
+
+umopa   za3.s, p7/m, p7/m, z31.h, z31.h  // 10100001-10011111-11111111-11101011
+// CHECK-INST: umopa   za3.s, p7/m, p7/m, z31.h, z31.h
+// CHECK-ENCODING: [0xeb,0xff,0x9f,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a19fffeb <unknown>
+
+umopa   za1.s, p3/m, p0/m, z17.h, z16.h  // 10100001-10010000-00001110-00101001
+// CHECK-INST: umopa   za1.s, p3/m, p0/m, z17.h, z16.h
+// CHECK-ENCODING: [0x29,0x0e,0x90,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a1900e29 <unknown>
+
+umopa   za1.s, p1/m, p4/m, z1.h, z30.h  // 10100001-10011110-10000100-00101001
+// CHECK-INST: umopa   za1.s, p1/m, p4/m, z1.h, z30.h
+// CHECK-ENCODING: [0x29,0x84,0x9e,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a19e8429 <unknown>
+
+umopa   za0.s, p5/m, p2/m, z19.h, z20.h  // 10100001-10010100-01010110-01101000
+// CHECK-INST: umopa   za0.s, p5/m, p2/m, z19.h, z20.h
+// CHECK-ENCODING: [0x68,0x56,0x94,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a1945668 <unknown>
+
+umopa   za0.s, p6/m, p0/m, z12.h, z2.h  // 10100001-10000010-00011001-10001000
+// CHECK-INST: umopa   za0.s, p6/m, p0/m, z12.h, z2.h
+// CHECK-ENCODING: [0x88,0x19,0x82,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a1821988 <unknown>
+
+umopa   za1.s, p2/m, p6/m, z1.h, z26.h  // 10100001-10011010-11001000-00101001
+// CHECK-INST: umopa   za1.s, p2/m, p6/m, z1.h, z26.h
+// CHECK-ENCODING: [0x29,0xc8,0x9a,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a19ac829 <unknown>
+
+umopa   za1.s, p2/m, p0/m, z22.h, z30.h  // 10100001-10011110-00001010-11001001
+// CHECK-INST: umopa   za1.s, p2/m, p0/m, z22.h, z30.h
+// CHECK-ENCODING: [0xc9,0x0a,0x9e,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a19e0ac9 <unknown>
+
+umopa   za2.s, p5/m, p7/m, z9.h, z1.h  // 10100001-10000001-11110101-00101010
+// CHECK-INST: umopa   za2.s, p5/m, p7/m, z9.h, z1.h
+// CHECK-ENCODING: [0x2a,0xf5,0x81,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a181f52a <unknown>
+
+umopa   za3.s, p2/m, p5/m, z12.h, z11.h  // 10100001-10001011-10101001-10001011
+// CHECK-INST: umopa   za3.s, p2/m, p5/m, z12.h, z11.h
+// CHECK-ENCODING: [0x8b,0xa9,0x8b,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a18ba98b <unknown>
+

diff  --git a/llvm/test/MC/AArch64/SME2/umops-diagnostics.s b/llvm/test/MC/AArch64/SME2/umops-diagnostics.s
new file mode 100644
index 0000000000000..1d90740e70db4
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/umops-diagnostics.s
@@ -0,0 +1,35 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 2>&1 < %s | FileCheck %s
+
+// --------------------------------------------------------------------------//
+// Invalid tile
+
+umops za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: umops za8.s, p0/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid predicate
+
+umops za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid operand for instruction
+// CHECK-NEXT: umops za0.s, p0/z, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+umops za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid restricted predicate register, expected p0..p7 (without element suffix)
+// CHECK-NEXT: umops za0.s, p15/m, p0/m, z0.s, z0.s
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+// --------------------------------------------------------------------------//
+// Invalid suffixes
+
+umops za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid matrix operand, expected za[0-3].s
+// CHECK-NEXT: umops za0.d, p0/z, p0/m, z0.d, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:
+
+umops za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK: [[@LINE-1]]:{{[0-9]+}}: error: invalid element width
+// CHECK-NEXT: za0.s, p0/m, p0/m, z0.s, z0.d
+// CHECK-NOT: [[@LINE-1]]:{{[0-9]+}}:

diff  --git a/llvm/test/MC/AArch64/SME2/umops.s b/llvm/test/MC/AArch64/SME2/umops.s
new file mode 100644
index 0000000000000..3ce593e4a51a3
--- /dev/null
+++ b/llvm/test/MC/AArch64/SME2/umops.s
@@ -0,0 +1,86 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefix=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=+sme2 - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sme2 < %s \
+// RUN:        | llvm-objdump -d --mattr=-sme2 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sme2 < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -mattr=+sme2 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
+umops   za0.s, p0/m, p0/m, z0.h, z0.h  // 10100001-10000000-00000000-00011000
+// CHECK-INST: umops   za0.s, p0/m, p0/m, z0.h, z0.h
+// CHECK-ENCODING: [0x18,0x00,0x80,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a1800018 <unknown>
+
+umops   za1.s, p5/m, p2/m, z10.h, z21.h  // 10100001-10010101-01010101-01011001
+// CHECK-INST: umops   za1.s, p5/m, p2/m, z10.h, z21.h
+// CHECK-ENCODING: [0x59,0x55,0x95,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a1955559 <unknown>
+
+umops   za3.s, p3/m, p7/m, z13.h, z8.h  // 10100001-10001000-11101101-10111011
+// CHECK-INST: umops   za3.s, p3/m, p7/m, z13.h, z8.h
+// CHECK-ENCODING: [0xbb,0xed,0x88,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a188edbb <unknown>
+
+umops   za3.s, p7/m, p7/m, z31.h, z31.h  // 10100001-10011111-11111111-11111011
+// CHECK-INST: umops   za3.s, p7/m, p7/m, z31.h, z31.h
+// CHECK-ENCODING: [0xfb,0xff,0x9f,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a19ffffb <unknown>
+
+umops   za1.s, p3/m, p0/m, z17.h, z16.h  // 10100001-10010000-00001110-00111001
+// CHECK-INST: umops   za1.s, p3/m, p0/m, z17.h, z16.h
+// CHECK-ENCODING: [0x39,0x0e,0x90,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a1900e39 <unknown>
+
+umops   za1.s, p1/m, p4/m, z1.h, z30.h  // 10100001-10011110-10000100-00111001
+// CHECK-INST: umops   za1.s, p1/m, p4/m, z1.h, z30.h
+// CHECK-ENCODING: [0x39,0x84,0x9e,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a19e8439 <unknown>
+
+umops   za0.s, p5/m, p2/m, z19.h, z20.h  // 10100001-10010100-01010110-01111000
+// CHECK-INST: umops   za0.s, p5/m, p2/m, z19.h, z20.h
+// CHECK-ENCODING: [0x78,0x56,0x94,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a1945678 <unknown>
+
+umops   za0.s, p6/m, p0/m, z12.h, z2.h  // 10100001-10000010-00011001-10011000
+// CHECK-INST: umops   za0.s, p6/m, p0/m, z12.h, z2.h
+// CHECK-ENCODING: [0x98,0x19,0x82,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a1821998 <unknown>
+
+umops   za1.s, p2/m, p6/m, z1.h, z26.h  // 10100001-10011010-11001000-00111001
+// CHECK-INST: umops   za1.s, p2/m, p6/m, z1.h, z26.h
+// CHECK-ENCODING: [0x39,0xc8,0x9a,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a19ac839 <unknown>
+
+umops   za1.s, p2/m, p0/m, z22.h, z30.h  // 10100001-10011110-00001010-11011001
+// CHECK-INST: umops   za1.s, p2/m, p0/m, z22.h, z30.h
+// CHECK-ENCODING: [0xd9,0x0a,0x9e,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a19e0ad9 <unknown>
+
+umops   za2.s, p5/m, p7/m, z9.h, z1.h  // 10100001-10000001-11110101-00111010
+// CHECK-INST: umops   za2.s, p5/m, p7/m, z9.h, z1.h
+// CHECK-ENCODING: [0x3a,0xf5,0x81,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a181f53a <unknown>
+
+umops   za3.s, p2/m, p5/m, z12.h, z11.h  // 10100001-10001011-10101001-10011011
+// CHECK-INST: umops   za3.s, p2/m, p5/m, z12.h, z11.h
+// CHECK-ENCODING: [0x9b,0xa9,0x8b,0xa1]
+// CHECK-ERROR: instruction requires: sme2
+// CHECK-UNKNOWN: a18ba99b <unknown>
+


        


More information about the llvm-commits mailing list