[llvm-branch-commits] [llvm] [AArch64][llvm] Unify AArch64 tests into a single file (2/4) (NFC) (PR #146329)

Jonathan Thackray via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 30 09:22:16 PDT 2025


https://github.com/jthackray updated https://github.com/llvm/llvm-project/pull/146329

>From 87b4d1d8656f6c67e2e95a8b6e5d58afc945b43a Mon Sep 17 00:00:00 2001
From: Jonathan Thackray <jonathan.thackray at arm.com>
Date: Wed, 25 Jun 2025 21:22:13 +0100
Subject: [PATCH 1/3] [AArch64][llvm] Unify AArch64 tests into a single file
 (1/4) (NFC)

This is a series of patches (1/4) to unify assembly/disassembly of
recent AArch64 tests into a single file. The aim is to improve
consistency, so that all instructions and system registers are
thoroughly tested, and future test cases will be in a unified format.

This patch:
 * unifies errorless .s and .txt tests into a single file
 * remove .txt tests which don't have feature requirements
 * makes the .s tests have a roundabout run line to test both encoding and assembly

Co-authored-by: Virginia Cangelosi <virginia.cangelosi at arm.com>
---
 llvm/test/MC/AArch64/armv8.9a-ats1a.s         |  26 ++-
 llvm/test/MC/AArch64/armv9.4a-ebep.s          |  38 +++-
 llvm/test/MC/AArch64/armv9.5a-e3dse.s         |  30 ++-
 llvm/test/MC/AArch64/armv9.5a-fgwte3.s        |  22 +-
 llvm/test/MC/AArch64/armv9.5a-hacdbs.s        |  30 ++-
 llvm/test/MC/AArch64/armv9.5a-hdbss.s         |  30 ++-
 llvm/test/MC/AArch64/armv9.5a-spmu2.s         |  18 +-
 llvm/test/MC/AArch64/armv9.5a-step2.s         |  22 +-
 llvm/test/MC/AArch64/armv9.6a-srmask.s        | 206 +++++++++++++-----
 .../AArch64/armv9.6a-statistical-profiling.s  |  72 ++++--
 .../test/MC/AArch64/armv9.6a-trbe-exception.s |  59 +++--
 .../Disassembler/AArch64/armv8.9a-ats1a.txt   |  10 -
 .../MC/Disassembler/AArch64/armv9.4a-ebep.txt |  13 --
 .../Disassembler/AArch64/armv9.5a-e3dse.txt   |  13 --
 .../Disassembler/AArch64/armv9.5a-fgwte3.txt  |   7 -
 .../Disassembler/AArch64/armv9.5a-hacdbs.txt  |  14 --
 .../Disassembler/AArch64/armv9.5a-hdbss.txt   |  14 --
 .../Disassembler/AArch64/armv9.5a-spmu2.txt   |   4 -
 .../Disassembler/AArch64/armv9.5a-step2.txt   |   7 -
 .../Disassembler/AArch64/armv9.6a-srmask.txt  | 101 ---------
 .../armv9.6a-statistical-profiling.txt        |  15 --
 .../AArch64/armv9.6a-trbe-exception.txt       |  15 --
 22 files changed, 439 insertions(+), 327 deletions(-)
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv8.9a-ats1a.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.4a-ebep.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.5a-e3dse.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.5a-fgwte3.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.5a-hacdbs.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.5a-hdbss.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.5a-spmu2.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.5a-step2.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.6a-srmask.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.6a-statistical-profiling.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.6a-trbe-exception.txt

diff --git a/llvm/test/MC/AArch64/armv8.9a-ats1a.s b/llvm/test/MC/AArch64/armv8.9a-ats1a.s
index a30d206639425..d61d651b804e7 100644
--- a/llvm/test/MC/AArch64/armv8.9a-ats1a.s
+++ b/llvm/test/MC/AArch64/armv8.9a-ats1a.s
@@ -1,10 +1,28 @@
-// RUN: llvm-mc -triple aarch64 -show-encoding %s | FileCheck %s
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 at s1e1a, x1
-// CHECK: at s1e1a, x1                        // encoding: [0x41,0x79,0x08,0xd5]
+// CHECK-INST: at s1e1a, x1
+// CHECK-ENCODING: encoding: [0x41,0x79,0x08,0xd5]
+// CHECK-UNKNOWN:  d5087941 at s1e1a, x1
 
 at s1e2a, x1
-// CHECK: at s1e2a, x1                        // encoding: [0x41,0x79,0x0c,0xd5]
+// CHECK-INST: at s1e2a, x1
+// CHECK-ENCODING: encoding: [0x41,0x79,0x0c,0xd5]
+// CHECK-UNKNOWN:  d50c7941 at s1e2a, x1
 
 at s1e3a, x1
-// CHECK: at s1e3a, x1                        // encoding: [0x41,0x79,0x0e,0xd5]
+// CHECK-INST: at s1e3a, x1
+// CHECK-ENCODING: encoding: [0x41,0x79,0x0e,0xd5]
+// CHECK-UNKNOWN:  d50e7941 at s1e3a, x1
diff --git a/llvm/test/MC/AArch64/armv9.4a-ebep.s b/llvm/test/MC/AArch64/armv9.4a-ebep.s
index 7e9f1115d9753..adda45f1a56e7 100644
--- a/llvm/test/MC/AArch64/armv9.4a-ebep.s
+++ b/llvm/test/MC/AArch64/armv9.4a-ebep.s
@@ -1,9 +1,39 @@
-// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 mrs x2, PM
+// CHECK-INST: mrs x2, PM
+// CHECK-ENCODING: encoding: [0x22,0x43,0x38,0xd5]
+// CHECK-UNKNOWN:  d5384322 mrs x2, PM
+mrs x3, PM
+// CHECK-INST: mrs x3, PM
+// CHECK-ENCODING: encoding: [0x23,0x43,0x38,0xd5]
+// CHECK-UNKNOWN:  d5384323 mrs x3, PM
 msr PM, x3
+// CHECK-INST: msr PM, x3
+// CHECK-ENCODING: encoding: [0x23,0x43,0x18,0xd5]
+// CHECK-UNKNOWN:  d5184323 msr PM, x3
+msr PM, x6
+// CHECK-INST: msr PM, x6
+// CHECK-ENCODING: encoding: [0x26,0x43,0x18,0xd5]
+// CHECK-UNKNOWN:  d5184326 msr PM, x6
+msr PM, #0
+// CHECK-INST: msr PM, #0
+// CHECK-ENCODING: encoding: [0x1f,0x42,0x01,0xd5]
+// CHECK-UNKNOWN:  d501421f msr PM, #0
 msr PM, #1
+// CHECK-INST: msr PM, #1
+// CHECK-ENCODING: encoding: [0x1f,0x43,0x01,0xd5]
+// CHECK-UNKNOWN:  d501431f msr PM, #1
 
-// CHECK:       mrs x2, {{pm|PM}} // encoding: [0x22,0x43,0x38,0xd5]
-// CHECK:       msr {{pm|PM}}, x3 // encoding: [0x23,0x43,0x18,0xd5]
-// CHECK:       msr {{pm|PM}}, #1 // encoding: [0x1f,0x43,0x01,0xd5]
diff --git a/llvm/test/MC/AArch64/armv9.5a-e3dse.s b/llvm/test/MC/AArch64/armv9.5a-e3dse.s
index b69d49ab4e9e5..1002ac1433178 100644
--- a/llvm/test/MC/AArch64/armv9.5a-e3dse.s
+++ b/llvm/test/MC/AArch64/armv9.5a-e3dse.s
@@ -1,13 +1,33 @@
-// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 mrs x0, VDISR_EL3
-// CHECK: mrs x0, VDISR_EL3                  // encoding: [0x20,0xc1,0x3e,0xd5]
+// CHECK-INST: mrs x0, VDISR_EL3
+// CHECK-ENCODING: encoding: [0x20,0xc1,0x3e,0xd5]
+// CHECK-UNKNOWN:  d53ec120 mrs x0, VDISR_EL3
 
 msr VDISR_EL3, x0
-// CHECK: msr VDISR_EL3, x0                  // encoding: [0x20,0xc1,0x1e,0xd5]
+// CHECK-INST: msr VDISR_EL3, x0
+// CHECK-ENCODING: encoding: [0x20,0xc1,0x1e,0xd5]
+// CHECK-UNKNOWN:  d51ec120 msr VDISR_EL3, x0
 
 mrs x0, VSESR_EL3
-// CHECK: mrs x0, VSESR_EL3                  // encoding: [0x60,0x52,0x3e,0xd5]
+// CHECK-INST: mrs x0, VSESR_EL3
+// CHECK-ENCODING: encoding: [0x60,0x52,0x3e,0xd5]
+// CHECK-UNKNOWN:  d53e5260 mrs x0, VSESR_EL3
 
 msr VSESR_EL3, x0
-// CHECK: msr VSESR_EL3, x0                  // encoding: [0x60,0x52,0x1e,0xd5]
+// CHECK-INST: msr VSESR_EL3, x0
+// CHECK-ENCODING: encoding: [0x60,0x52,0x1e,0xd5]
+// CHECK-UNKNOWN:  d51e5260 msr VSESR_EL3, x0
diff --git a/llvm/test/MC/AArch64/armv9.5a-fgwte3.s b/llvm/test/MC/AArch64/armv9.5a-fgwte3.s
index 2352bc7e1ca71..0e2976b4096d8 100644
--- a/llvm/test/MC/AArch64/armv9.5a-fgwte3.s
+++ b/llvm/test/MC/AArch64/armv9.5a-fgwte3.s
@@ -1,6 +1,22 @@
-// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 mrs x0, FGWTE3_EL3
-// CHECK: mrs x0, FGWTE3_EL3                  // encoding: [0xa0,0x11,0x3e,0xd5]
+// CHECK-INST: mrs x0, FGWTE3_EL3
+// CHECK-ENCODING: encoding: [0xa0,0x11,0x3e,0xd5]
+// CHECK-UNKNOWN:  d53e11a0 mrs x0, FGWTE3_EL3
 msr FGWTE3_EL3, x0
-// CHECK: msr FGWTE3_EL3, x0                  // encoding: [0xa0,0x11,0x1e,0xd5]
+// CHECK-INST: msr FGWTE3_EL3, x0
+// CHECK-ENCODING: encoding: [0xa0,0x11,0x1e,0xd5]
+// CHECK-UNKNOWN:  d51e11a0 msr FGWTE3_EL3, x0
diff --git a/llvm/test/MC/AArch64/armv9.5a-hacdbs.s b/llvm/test/MC/AArch64/armv9.5a-hacdbs.s
index 8ccba29beb444..44699a948013d 100644
--- a/llvm/test/MC/AArch64/armv9.5a-hacdbs.s
+++ b/llvm/test/MC/AArch64/armv9.5a-hacdbs.s
@@ -1,12 +1,32 @@
-// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 mrs x0, HACDBSBR_EL2
-// CHECK: mrs x0, HACDBSBR_EL2                  // encoding: [0x80,0x23,0x3c,0xd5]
+// CHECK-INST: mrs x0, HACDBSBR_EL2
+// CHECK-ENCODING: encoding: [0x80,0x23,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c2380 mrs x0, HACDBSBR_EL2
 msr HACDBSBR_EL2, x0
-// CHECK: msr HACDBSBR_EL2, x0                  // encoding: [0x80,0x23,0x1c,0xd5]
+// CHECK-INST: msr HACDBSBR_EL2, x0
+// CHECK-ENCODING: encoding: [0x80,0x23,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c2380 msr HACDBSBR_EL2, x0
 
 mrs x0, HACDBSCONS_EL2
-// CHECK: mrs x0, HACDBSCONS_EL2                  // encoding: [0xa0,0x23,0x3c,0xd5]
+// CHECK-INST: mrs x0, HACDBSCONS_EL2
+// CHECK-ENCODING: encoding: [0xa0,0x23,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c23a0 mrs x0, HACDBSCONS_EL2
 msr HACDBSCONS_EL2, x0
-// CHECK: msr HACDBSCONS_EL2, x0                  // encoding: [0xa0,0x23,0x1c,0xd5]
+// CHECK-INST: msr HACDBSCONS_EL2, x0
+// CHECK-ENCODING: encoding: [0xa0,0x23,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c23a0 msr HACDBSCONS_EL2, x0
 
diff --git a/llvm/test/MC/AArch64/armv9.5a-hdbss.s b/llvm/test/MC/AArch64/armv9.5a-hdbss.s
index c4505c9d70e7f..4582ed245beb9 100644
--- a/llvm/test/MC/AArch64/armv9.5a-hdbss.s
+++ b/llvm/test/MC/AArch64/armv9.5a-hdbss.s
@@ -1,12 +1,32 @@
-// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 mrs x0, HDBSSBR_EL2
-// CHECK: mrs x0, HDBSSBR_EL2                  // encoding: [0x40,0x23,0x3c,0xd5]
+// CHECK-INST: mrs x0, HDBSSBR_EL2
+// CHECK-ENCODING: encoding: [0x40,0x23,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c2340 mrs x0, HDBSSBR_EL2
 msr HDBSSBR_EL2, x0
-// CHECK: msr HDBSSBR_EL2, x0                  // encoding: [0x40,0x23,0x1c,0xd5]
+// CHECK-INST: msr HDBSSBR_EL2, x0
+// CHECK-ENCODING: encoding: [0x40,0x23,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c2340 msr HDBSSBR_EL2, x0
 
 mrs x0, HDBSSPROD_EL2
-// CHECK: mrs x0, HDBSSPROD_EL2                  // encoding: [0x60,0x23,0x3c,0xd5]
+// CHECK-INST: mrs x0, HDBSSPROD_EL2
+// CHECK-ENCODING: encoding: [0x60,0x23,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c2360 mrs x0, HDBSSPROD_EL2
 msr HDBSSPROD_EL2, x0
-// CHECK: msr HDBSSPROD_EL2, x0                  // encoding: [0x60,0x23,0x1c,0xd5]
+// CHECK-INST: msr HDBSSPROD_EL2, x0
+// CHECK-ENCODING: encoding: [0x60,0x23,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c2360 msr HDBSSPROD_EL2, x0
 
diff --git a/llvm/test/MC/AArch64/armv9.5a-spmu2.s b/llvm/test/MC/AArch64/armv9.5a-spmu2.s
index b7febdb9d248e..c476cb642faf5 100644
--- a/llvm/test/MC/AArch64/armv9.5a-spmu2.s
+++ b/llvm/test/MC/AArch64/armv9.5a-spmu2.s
@@ -1,4 +1,18 @@
-// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 msr SPMZR_EL0, x0
-// CHECK: msr SPMZR_EL0, x0                  // encoding: [0x80,0x9c,0x13,0xd5]
+// CHECK-INST: msr SPMZR_EL0, x0
+// CHECK-ENCODING: encoding: [0x80,0x9c,0x13,0xd5]
+// CHECK-UNKNOWN:  d5139c80 msr SPMZR_EL0, x0
diff --git a/llvm/test/MC/AArch64/armv9.5a-step2.s b/llvm/test/MC/AArch64/armv9.5a-step2.s
index c5f226bda3178..eda0050111db7 100644
--- a/llvm/test/MC/AArch64/armv9.5a-step2.s
+++ b/llvm/test/MC/AArch64/armv9.5a-step2.s
@@ -1,7 +1,23 @@
-// RUN: llvm-mc -triple aarch64 -show-encoding < %s | FileCheck %s
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 mrs x0, MDSTEPOP_EL1
-// CHECK: mrs x0, MDSTEPOP_EL1                  // encoding: [0x40,0x05,0x30,0xd5]
+// CHECK-INST: mrs x0, MDSTEPOP_EL1
+// CHECK-ENCODING: encoding: [0x40,0x05,0x30,0xd5]
+// CHECK-UNKNOWN:  d5300540 mrs x0, MDSTEPOP_EL1
 
 msr MDSTEPOP_EL1, x0
-// CHECK: msr MDSTEPOP_EL1, x0                  // encoding: [0x40,0x05,0x10,0xd5]
+// CHECK-INST: msr MDSTEPOP_EL1, x0
+// CHECK-ENCODING: encoding: [0x40,0x05,0x10,0xd5]
+// CHECK-UNKNOWN:  d5100540 msr MDSTEPOP_EL1, x0
diff --git a/llvm/test/MC/AArch64/armv9.6a-srmask.s b/llvm/test/MC/AArch64/armv9.6a-srmask.s
index 40f0e98494d4c..1829dc380be69 100644
--- a/llvm/test/MC/AArch64/armv9.6a-srmask.s
+++ b/llvm/test/MC/AArch64/armv9.6a-srmask.s
@@ -1,102 +1,210 @@
-// RUN: llvm-mc -triple aarch64 -show-encoding %s   | FileCheck %s
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 mrs x3, SCTLRMASK_EL1
-// CHECK: mrs	x3, SCTLRMASK_EL1               // encoding: [0x03,0x14,0x38,0xd5]
+// CHECK-INST: mrs x3, SCTLRMASK_EL1
+// CHECK-ENCODING: encoding: [0x03,0x14,0x38,0xd5]
+// CHECK-UNKNOWN:  d5381403 mrs x3, SCTLRMASK_EL1
 mrs x3, SCTLRMASK_EL2
-// CHECK: mrs	x3, SCTLRMASK_EL2               // encoding: [0x03,0x14,0x3c,0xd5]
+// CHECK-INST: mrs x3, SCTLRMASK_EL2
+// CHECK-ENCODING: encoding: [0x03,0x14,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c1403 mrs x3, SCTLRMASK_EL2
 mrs x3, SCTLRMASK_EL12
-// CHECK: mrs	x3, SCTLRMASK_EL12              // encoding: [0x03,0x14,0x3d,0xd5]
+// CHECK-INST: mrs x3, SCTLRMASK_EL12
+// CHECK-ENCODING: encoding: [0x03,0x14,0x3d,0xd5]
+// CHECK-UNKNOWN:  d53d1403 mrs x3, SCTLRMASK_EL12
 mrs x3, CPACRMASK_EL1
-// CHECK: mrs	x3, CPACRMASK_EL1               // encoding: [0x43,0x14,0x38,0xd5]
+// CHECK-INST: mrs x3, CPACRMASK_EL1
+// CHECK-ENCODING: encoding: [0x43,0x14,0x38,0xd5]
+// CHECK-UNKNOWN:  d5381443 mrs x3, CPACRMASK_EL1
 mrs x3, CPTRMASK_EL2
-// CHECK: mrs	x3, CPTRMASK_EL2                // encoding: [0x43,0x14,0x3c,0xd5]
+// CHECK-INST: mrs x3, CPTRMASK_EL2
+// CHECK-ENCODING: encoding: [0x43,0x14,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c1443 mrs x3, CPTRMASK_EL2
 mrs x3, CPACRMASK_EL12
-// CHECK: mrs	x3, CPACRMASK_EL12              // encoding: [0x43,0x14,0x3d,0xd5]
+// CHECK-INST: mrs x3, CPACRMASK_EL12
+// CHECK-ENCODING: encoding: [0x43,0x14,0x3d,0xd5]
+// CHECK-UNKNOWN:  d53d1443 mrs x3, CPACRMASK_EL12
 mrs x3, SCTLR2MASK_EL1
-// CHECK: mrs	x3, SCTLR2MASK_EL1              // encoding: [0x63,0x14,0x38,0xd5]
+// CHECK-INST: mrs x3, SCTLR2MASK_EL1
+// CHECK-ENCODING: encoding: [0x63,0x14,0x38,0xd5]
+// CHECK-UNKNOWN:  d5381463 mrs x3, SCTLR2MASK_EL1
 mrs x3, SCTLR2MASK_EL2
-// CHECK: mrs	x3, SCTLR2MASK_EL2              // encoding: [0x63,0x14,0x3c,0xd5]
+// CHECK-INST: mrs x3, SCTLR2MASK_EL2
+// CHECK-ENCODING: encoding: [0x63,0x14,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c1463 mrs x3, SCTLR2MASK_EL2
 mrs x3, SCTLR2MASK_EL12
-// CHECK: mrs	x3, SCTLR2MASK_EL12             // encoding: [0x63,0x14,0x3d,0xd5]
+// CHECK-INST: mrs x3, SCTLR2MASK_EL12
+// CHECK-ENCODING: encoding: [0x63,0x14,0x3d,0xd5]
+// CHECK-UNKNOWN:  d53d1463 mrs x3, SCTLR2MASK_EL12
 mrs x3, CPACRALIAS_EL1
-// CHECK: mrs	x3, CPACRALIAS_EL1              // encoding: [0x83,0x14,0x38,0xd5]
+// CHECK-INST: mrs x3, CPACRALIAS_EL1
+// CHECK-ENCODING: encoding: [0x83,0x14,0x38,0xd5]
+// CHECK-UNKNOWN:  d5381483 mrs x3, CPACRALIAS_EL1
 mrs x3, SCTLRALIAS_EL1
-// CHECK: mrs	x3, SCTLRALIAS_EL1              // encoding: [0xc3,0x14,0x38,0xd5]
+// CHECK-INST: mrs x3, SCTLRALIAS_EL1
+// CHECK-ENCODING: encoding: [0xc3,0x14,0x38,0xd5]
+// CHECK-UNKNOWN:  d53814c3 mrs x3, SCTLRALIAS_EL1
 mrs x3, SCTLR2ALIAS_EL1
-// CHECK: mrs	x3, SCTLR2ALIAS_EL1             // encoding: [0xe3,0x14,0x38,0xd5]
+// CHECK-INST: mrs x3, SCTLR2ALIAS_EL1
+// CHECK-ENCODING: encoding: [0xe3,0x14,0x38,0xd5]
+// CHECK-UNKNOWN:  d53814e3 mrs x3, SCTLR2ALIAS_EL1
 mrs x3, TCRMASK_EL1
-// CHECK: mrs	x3, TCRMASK_EL1                 // encoding: [0x43,0x27,0x38,0xd5]
+// CHECK-INST: mrs x3, TCRMASK_EL1
+// CHECK-ENCODING: encoding: [0x43,0x27,0x38,0xd5]
+// CHECK-UNKNOWN:  d5382743 mrs x3, TCRMASK_EL1
 mrs x3, TCRMASK_EL2
-// CHECK: mrs	x3, TCRMASK_EL2                 // encoding: [0x43,0x27,0x3c,0xd5]
+// CHECK-INST: mrs x3, TCRMASK_EL2
+// CHECK-ENCODING: encoding: [0x43,0x27,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c2743 mrs x3, TCRMASK_EL2
 mrs x3, TCRMASK_EL12
-// CHECK: mrs	x3, TCRMASK_EL12                // encoding: [0x43,0x27,0x3d,0xd5]
+// CHECK-INST: mrs x3, TCRMASK_EL12
+// CHECK-ENCODING: encoding: [0x43,0x27,0x3d,0xd5]
+// CHECK-UNKNOWN:  d53d2743 mrs x3, TCRMASK_EL12
 mrs x3, TCR2MASK_EL1
-// CHECK: mrs	x3, TCR2MASK_EL1                // encoding: [0x63,0x27,0x38,0xd5]
+// CHECK-INST: mrs x3, TCR2MASK_EL1
+// CHECK-ENCODING: encoding: [0x63,0x27,0x38,0xd5]
+// CHECK-UNKNOWN:  d5382763 mrs x3, TCR2MASK_EL1
 mrs x3, TCR2MASK_EL2
-// CHECK: mrs	x3, TCR2MASK_EL2                // encoding: [0x63,0x27,0x3c,0xd5]
+// CHECK-INST: mrs x3, TCR2MASK_EL2
+// CHECK-ENCODING: encoding: [0x63,0x27,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c2763 mrs x3, TCR2MASK_EL2
 mrs x3, TCR2MASK_EL12
-// CHECK: mrs	x3, TCR2MASK_EL12               // encoding: [0x63,0x27,0x3d,0xd5]
+// CHECK-INST: mrs x3, TCR2MASK_EL12
+// CHECK-ENCODING: encoding: [0x63,0x27,0x3d,0xd5]
+// CHECK-UNKNOWN:  d53d2763 mrs x3, TCR2MASK_EL12
 mrs x3, TCRALIAS_EL1
-// CHECK: mrs	x3, TCRALIAS_EL1                // encoding: [0xc3,0x27,0x38,0xd5]
+// CHECK-INST: mrs x3, TCRALIAS_EL1
+// CHECK-ENCODING: encoding: [0xc3,0x27,0x38,0xd5]
+// CHECK-UNKNOWN:  d53827c3 mrs x3, TCRALIAS_EL1
 mrs x3, TCR2ALIAS_EL1
-// CHECK: mrs	x3, TCR2ALIAS_EL1               // encoding: [0xe3,0x27,0x38,0xd5]
+// CHECK-INST: mrs x3, TCR2ALIAS_EL1
+// CHECK-ENCODING: encoding: [0xe3,0x27,0x38,0xd5]
+// CHECK-UNKNOWN:  d53827e3 mrs x3, TCR2ALIAS_EL1
 mrs x3, ACTLRMASK_EL1
-// CHECK: mrs	x3, ACTLRMASK_EL1               // encoding: [0x23,0x14,0x38,0xd5]
+// CHECK-INST: mrs x3, ACTLRMASK_EL1
+// CHECK-ENCODING: encoding: [0x23,0x14,0x38,0xd5]
+// CHECK-UNKNOWN:  d5381423 mrs x3, ACTLRMASK_EL1
 mrs x3, ACTLRMASK_EL2
-// CHECK: mrs	x3, ACTLRMASK_EL2               // encoding: [0x23,0x14,0x3c,0xd5]
+// CHECK-INST: mrs x3, ACTLRMASK_EL2
+// CHECK-ENCODING: encoding: [0x23,0x14,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c1423 mrs x3, ACTLRMASK_EL2
 mrs x3, ACTLRMASK_EL12
-// CHECK: mrs	x3, ACTLRMASK_EL12              // encoding: [0x23,0x14,0x3d,0xd5]
+// CHECK-INST: mrs x3, ACTLRMASK_EL12
+// CHECK-ENCODING: encoding: [0x23,0x14,0x3d,0xd5]
+// CHECK-UNKNOWN:  d53d1423 mrs x3, ACTLRMASK_EL12
 mrs x3, ACTLRALIAS_EL1
-// CHECK: mrs	x3, ACTLRALIAS_EL1              // encoding: [0xa3,0x14,0x38,0xd5]
+// CHECK-INST: mrs x3, ACTLRALIAS_EL1
+// CHECK-ENCODING: encoding: [0xa3,0x14,0x38,0xd5]
+// CHECK-UNKNOWN:  d53814a3 mrs x3, ACTLRALIAS_EL1
 
 msr SCTLRMASK_EL1, x3
-// CHECK: msr	SCTLRMASK_EL1, x3               // encoding: [0x03,0x14,0x18,0xd5]
+// CHECK-INST: msr SCTLRMASK_EL1, x3
+// CHECK-ENCODING: encoding: [0x03,0x14,0x18,0xd5]
+// CHECK-UNKNOWN:  d5181403 msr SCTLRMASK_EL1, x3
 msr SCTLRMASK_EL2, x3
-// CHECK: msr	SCTLRMASK_EL2, x3               // encoding: [0x03,0x14,0x1c,0xd5]
+// CHECK-INST: msr SCTLRMASK_EL2, x3
+// CHECK-ENCODING: encoding: [0x03,0x14,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c1403 msr SCTLRMASK_EL2, x3
 msr SCTLRMASK_EL12, x3
-// CHECK: msr	SCTLRMASK_EL12, x3              // encoding: [0x03,0x14,0x1d,0xd5]
+// CHECK-INST: msr SCTLRMASK_EL12, x3
+// CHECK-ENCODING: encoding: [0x03,0x14,0x1d,0xd5]
+// CHECK-UNKNOWN:  d51d1403 msr SCTLRMASK_EL12, x3
 msr CPACRMASK_EL1, x3
-// CHECK: msr	CPACRMASK_EL1, x3               // encoding: [0x43,0x14,0x18,0xd5]
+// CHECK-INST: msr CPACRMASK_EL1, x3
+// CHECK-ENCODING: encoding: [0x43,0x14,0x18,0xd5]
+// CHECK-UNKNOWN:  d5181443 msr CPACRMASK_EL1, x3
 msr CPTRMASK_EL2, x3
-// CHECK: msr	CPTRMASK_EL2, x3                // encoding: [0x43,0x14,0x1c,0xd5]
+// CHECK-INST: msr CPTRMASK_EL2, x3
+// CHECK-ENCODING: encoding: [0x43,0x14,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c1443 msr CPTRMASK_EL2, x3
 msr CPACRMASK_EL12, x3
-// CHECK: msr	CPACRMASK_EL12, x3              // encoding: [0x43,0x14,0x1d,0xd5]
+// CHECK-INST: msr CPACRMASK_EL12, x3
+// CHECK-ENCODING: encoding: [0x43,0x14,0x1d,0xd5]
+// CHECK-UNKNOWN:  d51d1443 msr CPACRMASK_EL12, x3
 msr SCTLR2MASK_EL1, x3
-// CHECK: msr	SCTLR2MASK_EL1, x3              // encoding: [0x63,0x14,0x18,0xd5]
+// CHECK-INST: msr SCTLR2MASK_EL1, x3
+// CHECK-ENCODING: encoding: [0x63,0x14,0x18,0xd5]
+// CHECK-UNKNOWN:  d5181463 msr SCTLR2MASK_EL1, x3
 msr SCTLR2MASK_EL2, x3
-// CHECK: msr	SCTLR2MASK_EL2, x3              // encoding: [0x63,0x14,0x1c,0xd5]
+// CHECK-INST: msr SCTLR2MASK_EL2, x3
+// CHECK-ENCODING: encoding: [0x63,0x14,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c1463 msr SCTLR2MASK_EL2, x3
 msr SCTLR2MASK_EL12, x3
-// CHECK: msr	SCTLR2MASK_EL12, x3             // encoding: [0x63,0x14,0x1d,0xd5]
+// CHECK-INST: msr SCTLR2MASK_EL12, x3
+// CHECK-ENCODING: encoding: [0x63,0x14,0x1d,0xd5]
+// CHECK-UNKNOWN:  d51d1463 msr SCTLR2MASK_EL12, x3
 msr CPACRALIAS_EL1, x3
-// CHECK: msr	CPACRALIAS_EL1, x3              // encoding: [0x83,0x14,0x18,0xd5]
+// CHECK-INST: msr CPACRALIAS_EL1, x3
+// CHECK-ENCODING: encoding: [0x83,0x14,0x18,0xd5]
+// CHECK-UNKNOWN:  d5181483 msr CPACRALIAS_EL1, x3
 msr SCTLRALIAS_EL1, x3
-// CHECK: msr	SCTLRALIAS_EL1, x3              // encoding: [0xc3,0x14,0x18,0xd5]
+// CHECK-INST: msr SCTLRALIAS_EL1, x3
+// CHECK-ENCODING: encoding: [0xc3,0x14,0x18,0xd5]
+// CHECK-UNKNOWN:  d51814c3 msr SCTLRALIAS_EL1, x3
 msr SCTLR2ALIAS_EL1, x3
-// CHECK: msr	SCTLR2ALIAS_EL1, x3             // encoding: [0xe3,0x14,0x18,0xd5]
+// CHECK-INST: msr SCTLR2ALIAS_EL1, x3
+// CHECK-ENCODING: encoding: [0xe3,0x14,0x18,0xd5]
+// CHECK-UNKNOWN:  d51814e3 msr SCTLR2ALIAS_EL1, x3
 msr TCRMASK_EL1, x3
-// CHECK: msr	TCRMASK_EL1, x3                 // encoding: [0x43,0x27,0x18,0xd5]
+// CHECK-INST: msr TCRMASK_EL1, x3
+// CHECK-ENCODING: encoding: [0x43,0x27,0x18,0xd5]
+// CHECK-UNKNOWN:  d5182743 msr TCRMASK_EL1, x3
 msr TCRMASK_EL2, x3
-// CHECK: msr	TCRMASK_EL2, x3                 // encoding: [0x43,0x27,0x1c,0xd5]
+// CHECK-INST: msr TCRMASK_EL2, x3
+// CHECK-ENCODING: encoding: [0x43,0x27,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c2743 msr TCRMASK_EL2, x3
 msr TCRMASK_EL12, x3
-// CHECK: msr	TCRMASK_EL12, x3                // encoding: [0x43,0x27,0x1d,0xd5]
+// CHECK-INST: msr TCRMASK_EL12, x3
+// CHECK-ENCODING: encoding: [0x43,0x27,0x1d,0xd5]
+// CHECK-UNKNOWN:  d51d2743 msr TCRMASK_EL12, x3
 msr TCR2MASK_EL1, x3
-// CHECK: msr	TCR2MASK_EL1, x3                // encoding: [0x63,0x27,0x18,0xd5]
+// CHECK-INST: msr TCR2MASK_EL1, x3
+// CHECK-ENCODING: encoding: [0x63,0x27,0x18,0xd5]
+// CHECK-UNKNOWN:  d5182763 msr TCR2MASK_EL1, x3
 msr TCR2MASK_EL2, x3
-// CHECK: msr	TCR2MASK_EL2, x3                // encoding: [0x63,0x27,0x1c,0xd5]
+// CHECK-INST: msr TCR2MASK_EL2, x3
+// CHECK-ENCODING: encoding: [0x63,0x27,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c2763 msr TCR2MASK_EL2, x3
 msr TCR2MASK_EL12, x3
-// CHECK: msr	TCR2MASK_EL12, x3               // encoding: [0x63,0x27,0x1d,0xd5]
+// CHECK-INST: msr TCR2MASK_EL12, x3
+// CHECK-ENCODING: encoding: [0x63,0x27,0x1d,0xd5]
+// CHECK-UNKNOWN:  d51d2763 msr TCR2MASK_EL12, x3
 msr TCRALIAS_EL1, x3
-// CHECK: msr	TCRALIAS_EL1, x3                // encoding: [0xc3,0x27,0x18,0xd5]
+// CHECK-INST: msr TCRALIAS_EL1, x3
+// CHECK-ENCODING: encoding: [0xc3,0x27,0x18,0xd5]
+// CHECK-UNKNOWN:  d51827c3 msr TCRALIAS_EL1, x3
 msr TCR2ALIAS_EL1, x3
-// CHECK: msr	TCR2ALIAS_EL1, x3               // encoding: [0xe3,0x27,0x18,0xd5]
+// CHECK-INST: msr TCR2ALIAS_EL1, x3
+// CHECK-ENCODING: encoding: [0xe3,0x27,0x18,0xd5]
+// CHECK-UNKNOWN:  d51827e3 msr TCR2ALIAS_EL1, x3
 msr ACTLRMASK_EL1, x3
-// CHECK: msr	ACTLRMASK_EL1, x3               // encoding: [0x23,0x14,0x18,0xd5]
+// CHECK-INST: msr ACTLRMASK_EL1, x3
+// CHECK-ENCODING: encoding: [0x23,0x14,0x18,0xd5]
+// CHECK-UNKNOWN:  d5181423 msr ACTLRMASK_EL1, x3
 msr ACTLRMASK_EL2, x3
-// CHECK: msr	ACTLRMASK_EL2, x3               // encoding: [0x23,0x14,0x1c,0xd5]
+// CHECK-INST: msr ACTLRMASK_EL2, x3
+// CHECK-ENCODING: encoding: [0x23,0x14,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c1423 msr ACTLRMASK_EL2, x3
 msr ACTLRMASK_EL12, x3
-// CHECK: msr	ACTLRMASK_EL12, x3              // encoding: [0x23,0x14,0x1d,0xd5]
+// CHECK-INST: msr ACTLRMASK_EL12, x3
+// CHECK-ENCODING: encoding: [0x23,0x14,0x1d,0xd5]
+// CHECK-UNKNOWN:  d51d1423 msr ACTLRMASK_EL12, x3
 msr ACTLRALIAS_EL1, x3
-// CHECK: msr	ACTLRALIAS_EL1, x3              // encoding: [0xa3,0x14,0x18,0xd5]
+// CHECK-INST: msr ACTLRALIAS_EL1, x3
+// CHECK-ENCODING: encoding: [0xa3,0x14,0x18,0xd5]
+// CHECK-UNKNOWN:  d51814a3 msr ACTLRALIAS_EL1, x3
 
 
 
diff --git a/llvm/test/MC/AArch64/armv9.6a-statistical-profiling.s b/llvm/test/MC/AArch64/armv9.6a-statistical-profiling.s
index 2314c414d4d96..554a5ea1dc350 100644
--- a/llvm/test/MC/AArch64/armv9.6a-statistical-profiling.s
+++ b/llvm/test/MC/AArch64/armv9.6a-statistical-profiling.s
@@ -1,19 +1,53 @@
-// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding     < %s 2> %t | FileCheck %s
-
-  msr pmbmar_el1, x0
-  msr pmbsr_el12, x0
-  msr pmbsr_el2, x0
-  msr pmbsr_el3, x0
-// CHECK:     msr PMBMAR_EL1, x0          // encoding: [0xa0,0x9a,0x18,0xd5]
-// CHECK:     msr PMBSR_EL12, x0          // encoding: [0x60,0x9a,0x1d,0xd5]
-// CHECK:     msr PMBSR_EL2, x0           // encoding: [0x60,0x9a,0x1c,0xd5]
-// CHECK:     msr PMBSR_EL3, x0           // encoding: [0x60,0x9a,0x1e,0xd5]
-
-  mrs x0, pmbmar_el1
-  mrs x0, pmbsr_el12
-  mrs x0, pmbsr_el2
-  mrs x0, pmbsr_el3
-// CHECK:    mrs x0, PMBMAR_EL1          // encoding: [0xa0,0x9a,0x38,0xd5]
-// CHECK:    mrs x0, PMBSR_EL12          // encoding: [0x60,0x9a,0x3d,0xd5]
-// CHECK:    mrs x0, PMBSR_EL2           // encoding: [0x60,0x9a,0x3c,0xd5]
-// CHECK:    mrs x0, PMBSR_EL3           // encoding: [0x60,0x9a,0x3e,0xd5]
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
+
+msr pmbmar_el1, x0
+// CHECK-INST: msr PMBMAR_EL1, x0
+// CHECK-ENCODING: encoding: [0xa0,0x9a,0x18,0xd5]
+// CHECK-UNKNOWN:  d5189aa0 msr PMBMAR_EL1, x0
+
+msr pmbsr_el12, x0
+// CHECK-INST: msr PMBSR_EL12, x0
+// CHECK-ENCODING: encoding: [0x60,0x9a,0x1d,0xd5]
+// CHECK-UNKNOWN:  d51d9a60 msr PMBSR_EL12, x0
+
+msr pmbsr_el2, x0
+// CHECK-INST: msr PMBSR_EL2, x0
+// CHECK-ENCODING: encoding: [0x60,0x9a,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c9a60 msr PMBSR_EL2, x0
+
+msr pmbsr_el3, x0
+// CHECK-INST: msr PMBSR_EL3, x0
+// CHECK-ENCODING: encoding: [0x60,0x9a,0x1e,0xd5]
+// CHECK-UNKNOWN:  d51e9a60 msr PMBSR_EL3, x0
+
+mrs x0, pmbmar_el1
+// CHECK-INST: mrs x0, PMBMAR_EL1
+// CHECK-ENCODING: encoding: [0xa0,0x9a,0x38,0xd5]
+// CHECK-UNKNOWN:  d5389aa0 mrs x0, PMBMAR_EL1
+
+mrs x0, pmbsr_el12
+// CHECK-INST: mrs x0, PMBSR_EL12
+// CHECK-ENCODING: encoding: [0x60,0x9a,0x3d,0xd5]
+// CHECK-UNKNOWN:  d53d9a60 mrs x0, PMBSR_EL12
+
+mrs x0, pmbsr_el2
+// CHECK-INST: mrs x0, PMBSR_EL2
+// CHECK-ENCODING: encoding: [0x60,0x9a,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c9a60 mrs x0, PMBSR_EL2
+
+mrs x0, pmbsr_el3
+// CHECK-INST: mrs x0, PMBSR_EL3
+// CHECK-ENCODING: encoding: [0x60,0x9a,0x3e,0xd5]
+// CHECK-UNKNOWN:  d53e9a60 mrs x0, PMBSR_EL3
diff --git a/llvm/test/MC/AArch64/armv9.6a-trbe-exception.s b/llvm/test/MC/AArch64/armv9.6a-trbe-exception.s
index a8ba7c442e4ce..fe127b3197c97 100644
--- a/llvm/test/MC/AArch64/armv9.6a-trbe-exception.s
+++ b/llvm/test/MC/AArch64/armv9.6a-trbe-exception.s
@@ -1,15 +1,44 @@
-// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding      < %s 2> %t | FileCheck %s
-
-  msr trbsr_el12, x0
-  msr trbsr_el2, x0
-  msr trbsr_el3, x0
-// CHECK:     msr TRBSR_EL12, x0          // encoding: [0x60,0x9b,0x1d,0xd5]
-// CHECK:     msr TRBSR_EL2, x0           // encoding: [0x60,0x9b,0x1c,0xd5]
-// CHECK:     msr TRBSR_EL3, x0           // encoding: [0x60,0x9b,0x1e,0xd5]
-
-  mrs x0, trbsr_el12
-  mrs x0, trbsr_el2
-  mrs x0, trbsr_el3
-// CHECK:    mrs x0, TRBSR_EL12          // encoding: [0x60,0x9b,0x3d,0xd5]
-// CHECK:    mrs x0, TRBSR_EL2           // encoding: [0x60,0x9b,0x3c,0xd5]
-// CHECK:    mrs x0, TRBSR_EL3           // encoding: [0x60,0x9b,0x3e,0xd5]
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
+
+msr trbsr_el12, x0
+// CHECK-INST: msr TRBSR_EL12, x0
+// CHECK-ENCODING: encoding: [0x60,0x9b,0x1d,0xd5]
+// CHECK-UNKNOWN:  d51d9b60 msr TRBSR_EL12, x0
+
+msr trbsr_el2, x0
+// CHECK-INST: msr TRBSR_EL2, x0
+// CHECK-ENCODING: encoding: [0x60,0x9b,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c9b60 msr TRBSR_EL2, x0
+
+msr trbsr_el3, x0
+// CHECK-INST: msr TRBSR_EL3, x0
+// CHECK-ENCODING: encoding: [0x60,0x9b,0x1e,0xd5]
+// CHECK-UNKNOWN:  d51e9b60 msr TRBSR_EL3, x0
+
+
+mrs x0, trbsr_el12
+// CHECK-INST: mrs x0, TRBSR_EL12
+// CHECK-ENCODING: encoding: [0x60,0x9b,0x3d,0xd5]
+// CHECK-UNKNOWN:  d53d9b60 mrs x0, TRBSR_EL12
+
+mrs x0, trbsr_el2
+// CHECK-INST: mrs x0, TRBSR_EL2
+// CHECK-ENCODING: encoding: [0x60,0x9b,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c9b60 mrs x0, TRBSR_EL2
+
+mrs x0, trbsr_el3
+// CHECK-INST: mrs x0, TRBSR_EL3
+// CHECK-ENCODING: encoding: [0x60,0x9b,0x3e,0xd5]
+// CHECK-UNKNOWN:  d53e9b60 mrs x0, TRBSR_EL3
diff --git a/llvm/test/MC/Disassembler/AArch64/armv8.9a-ats1a.txt b/llvm/test/MC/Disassembler/AArch64/armv8.9a-ats1a.txt
deleted file mode 100644
index 03aca5e916db0..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv8.9a-ats1a.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# RUN: llvm-mc -triple=aarch64 -disassemble %s | FileCheck %s
-
-[0x41,0x79,0x08,0xd5]
-# CHECK: at s1e1a, x1
-
-[0x41,0x79,0x0c,0xd5]
-# CHECK: at s1e2a, x1
-
-[0x41,0x79,0x0e,0xd5]
-# CHECK: at s1e3a, x1
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.4a-ebep.txt b/llvm/test/MC/Disassembler/AArch64/armv9.4a-ebep.txt
deleted file mode 100644
index aa9c95fb2082b..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.4a-ebep.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-# RUN: llvm-mc -triple=aarch64 -disassemble %s | FileCheck %s
-
-[0x23,0x43,0x38,0xd5]
-# CHECK:  mrs x3, PM
-
-[0x26,0x43,0x18,0xd5]
-# CHECK:  msr PM, x6
-
-[0x1f,0x42,0x01,0xd5]
-# CHECK:  msr PM, #0
-
-[0x1f,0x43,0x01,0xd5]
-# CHECK:  msr PM, #1
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.5a-e3dse.txt b/llvm/test/MC/Disassembler/AArch64/armv9.5a-e3dse.txt
deleted file mode 100644
index d2476dbf876d4..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.5a-e3dse.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-# RUN: llvm-mc -triple aarch64 -disassemble < %s | FileCheck %s
-
-[0x20,0xc1,0x3e,0xd5]
-# CHECK: mrs x0, VDISR_EL3
-
-[0x20,0xc1,0x1e,0xd5]
-# CHECK: msr VDISR_EL3, x0
-
-[0x60,0x52,0x3e,0xd5]
-# CHECK: mrs x0, VSESR_EL3
-
-[0x60,0x52,0x1e,0xd5]
-# CHECK: msr VSESR_EL3, x0
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.5a-fgwte3.txt b/llvm/test/MC/Disassembler/AArch64/armv9.5a-fgwte3.txt
deleted file mode 100644
index f7e355a700af0..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.5a-fgwte3.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-# RUN: llvm-mc -triple aarch64 -disassemble < %s | FileCheck %s
-
-[0xa0,0x11,0x3e,0xd5]
-# CHECK: mrs x0, FGWTE3_EL3
-
-[0xa0,0x11,0x1e,0xd5]
-# CHECK: msr FGWTE3_EL3, x0
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.5a-hacdbs.txt b/llvm/test/MC/Disassembler/AArch64/armv9.5a-hacdbs.txt
deleted file mode 100644
index d9be7e5ba4432..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.5a-hacdbs.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-# RUN: llvm-mc -triple aarch64 -disassemble < %s | FileCheck %s
-
-[0x80,0x23,0x3c,0xd5]
-# CHECK: mrs x0, HACDBSBR_EL2
-
-[0x80,0x23,0x1c,0xd5]
-# CHECK: msr HACDBSBR_EL2, x0
-
-[0xa0,0x23,0x3c,0xd5]
-# CHECK: mrs x0, HACDBSCONS_EL2
-
-[0xa0,0x23,0x1c,0xd5]
-# CHECK: msr HACDBSCONS_EL2, x0
-
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.5a-hdbss.txt b/llvm/test/MC/Disassembler/AArch64/armv9.5a-hdbss.txt
deleted file mode 100644
index 999f322548f46..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.5a-hdbss.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-# RUN: llvm-mc -triple aarch64 -disassemble < %s | FileCheck %s
-
-[0x40,0x23,0x3c,0xd5]
-# CHECK: mrs x0, HDBSSBR_EL2
-
-[0x40,0x23,0x1c,0xd5]
-# CHECK: msr HDBSSBR_EL2, x0
-
-[0x60,0x23,0x3c,0xd5]
-# CHECK: mrs x0, HDBSSPROD_EL2
-
-[0x60,0x23,0x1c,0xd5]
-# CHECK: msr HDBSSPROD_EL2, x0
-
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.5a-spmu2.txt b/llvm/test/MC/Disassembler/AArch64/armv9.5a-spmu2.txt
deleted file mode 100644
index 9d4fa1b1a078a..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.5a-spmu2.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# RUN: llvm-mc -triple aarch64 -disassemble < %s | FileCheck %s
-
-[0x80,0x9c,0x13,0xd5]
-# CHECK: msr SPMZR_EL0, x0
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.5a-step2.txt b/llvm/test/MC/Disassembler/AArch64/armv9.5a-step2.txt
deleted file mode 100644
index 473c16d096012..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.5a-step2.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-# RUN: llvm-mc -triple aarch64 -disassemble < %s | FileCheck %s
-
-[0x40,0x05,0x30,0xd5]
-# CHECK: mrs x0, MDSTEPOP_EL1
-
-[0x40,0x05,0x10,0xd5]
-# CHECK: msr MDSTEPOP_EL1, x0
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.6a-srmask.txt b/llvm/test/MC/Disassembler/AArch64/armv9.6a-srmask.txt
deleted file mode 100644
index 30d0a60321881..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.6a-srmask.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
-# RUN: llvm-mc -triple aarch64 -disassemble < %s 2> %t | FileCheck %s
-
-[0x03,0x14,0x38,0xd5]
-[0x03,0x14,0x3c,0xd5]
-[0x03,0x14,0x3d,0xd5]
-[0x43,0x14,0x38,0xd5]
-[0x43,0x14,0x3c,0xd5]
-[0x43,0x14,0x3d,0xd5]
-[0x63,0x14,0x38,0xd5]
-[0x63,0x14,0x3c,0xd5]
-[0x63,0x14,0x3d,0xd5]
-[0x83,0x14,0x38,0xd5]
-[0xc3,0x14,0x38,0xd5]
-[0xe3,0x14,0x38,0xd5]
-[0x43,0x27,0x38,0xd5]
-[0x43,0x27,0x3c,0xd5]
-[0x43,0x27,0x3d,0xd5]
-[0x63,0x27,0x38,0xd5]
-[0x63,0x27,0x3c,0xd5]
-[0x63,0x27,0x3d,0xd5]
-[0xc3,0x27,0x38,0xd5]
-[0xe3,0x27,0x38,0xd5]
-[0x23,0x14,0x38,0xd5]
-[0x23,0x14,0x3c,0xd5]
-[0x23,0x14,0x3d,0xd5]
-[0xa3,0x14,0x38,0xd5]
-
-[0x03,0x14,0x18,0xd5]
-[0x03,0x14,0x1c,0xd5]
-[0x03,0x14,0x1d,0xd5]
-[0x43,0x14,0x18,0xd5]
-[0x43,0x14,0x1c,0xd5]
-[0x43,0x14,0x1d,0xd5]
-[0x63,0x14,0x18,0xd5]
-[0x63,0x14,0x1c,0xd5]
-[0x63,0x14,0x1d,0xd5]
-[0x83,0x14,0x18,0xd5]
-[0xc3,0x14,0x18,0xd5]
-[0xe3,0x14,0x18,0xd5]
-[0x43,0x27,0x18,0xd5]
-[0x43,0x27,0x1c,0xd5]
-[0x43,0x27,0x1d,0xd5]
-[0x63,0x27,0x18,0xd5]
-[0x63,0x27,0x1c,0xd5]
-[0x63,0x27,0x1d,0xd5]
-[0xc3,0x27,0x18,0xd5]
-[0xe3,0x27,0x18,0xd5]
-[0x23,0x14,0x18,0xd5]
-[0x23,0x14,0x1c,0xd5]
-[0x23,0x14,0x1d,0xd5]
-[0xa3,0x14,0x18,0xd5]
-
-# CHECK:      	mrs	x3, SCTLRMASK_EL1
-# CHECK-NEXT: 	mrs	x3, SCTLRMASK_EL2
-# CHECK-NEXT: 	mrs	x3, SCTLRMASK_EL12
-# CHECK-NEXT: 	mrs	x3, CPACRMASK_EL1
-# CHECK-NEXT: 	mrs	x3, CPTRMASK_EL2
-# CHECK-NEXT: 	mrs	x3, CPACRMASK_EL12
-# CHECK-NEXT: 	mrs	x3, SCTLR2MASK_EL1
-# CHECK-NEXT: 	mrs	x3, SCTLR2MASK_EL2
-# CHECK-NEXT: 	mrs	x3, SCTLR2MASK_EL12
-# CHECK-NEXT: 	mrs	x3, CPACRALIAS_EL1
-# CHECK-NEXT: 	mrs	x3, SCTLRALIAS_EL1
-# CHECK-NEXT: 	mrs	x3, SCTLR2ALIAS_EL1
-# CHECK-NEXT: 	mrs	x3, TCRMASK_EL1
-# CHECK-NEXT: 	mrs	x3, TCRMASK_EL2
-# CHECK-NEXT: 	mrs	x3, TCRMASK_EL12
-# CHECK-NEXT: 	mrs	x3, TCR2MASK_EL1
-# CHECK-NEXT: 	mrs	x3, TCR2MASK_EL2
-# CHECK-NEXT: 	mrs	x3, TCR2MASK_EL12
-# CHECK-NEXT: 	mrs	x3, TCRALIAS_EL1
-# CHECK-NEXT: 	mrs	x3, TCR2ALIAS_EL1
-# CHECK-NEXT: 	mrs	x3, ACTLRMASK_EL1
-# CHECK-NEXT: 	mrs	x3, ACTLRMASK_EL2
-# CHECK-NEXT: 	mrs	x3, ACTLRMASK_EL12
-# CHECK-NEXT: 	mrs	x3, ACTLRALIAS_EL1
-# CHECK-NEXT: 	msr	SCTLRMASK_EL1, x3
-# CHECK-NEXT: 	msr	SCTLRMASK_EL2, x3
-# CHECK-NEXT: 	msr	SCTLRMASK_EL12, x3
-# CHECK-NEXT: 	msr	CPACRMASK_EL1, x3
-# CHECK-NEXT: 	msr	CPTRMASK_EL2, x3
-# CHECK-NEXT: 	msr	CPACRMASK_EL12, x3
-# CHECK-NEXT: 	msr	SCTLR2MASK_EL1, x3
-# CHECK-NEXT: 	msr	SCTLR2MASK_EL2, x3
-# CHECK-NEXT: 	msr	SCTLR2MASK_EL12, x3
-# CHECK-NEXT: 	msr	CPACRALIAS_EL1, x3
-# CHECK-NEXT: 	msr	SCTLRALIAS_EL1, x3
-# CHECK-NEXT: 	msr	SCTLR2ALIAS_EL1, x3
-# CHECK-NEXT: 	msr	TCRMASK_EL1, x3
-# CHECK-NEXT: 	msr	TCRMASK_EL2, x3
-# CHECK-NEXT: 	msr	TCRMASK_EL12, x3
-# CHECK-NEXT: 	msr	TCR2MASK_EL1, x3
-# CHECK-NEXT: 	msr	TCR2MASK_EL2, x3
-# CHECK-NEXT: 	msr	TCR2MASK_EL12, x3
-# CHECK-NEXT: 	msr	TCRALIAS_EL1, x3
-# CHECK-NEXT: 	msr	TCR2ALIAS_EL1, x3
-# CHECK-NEXT: 	msr	ACTLRMASK_EL1, x3
-# CHECK-NEXT: 	msr	ACTLRMASK_EL2, x3
-# CHECK-NEXT: 	msr	ACTLRMASK_EL12, x3
-# CHECK-NEXT: 	msr	ACTLRALIAS_EL1, x3
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.6a-statistical-profiling.txt b/llvm/test/MC/Disassembler/AArch64/armv9.6a-statistical-profiling.txt
deleted file mode 100644
index 446e2f0eb05c4..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.6a-statistical-profiling.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-# RUN: llvm-mc -triple aarch64 -disassemble < %s | FileCheck %s
-
-[0x60,0x9a,0x1d,0xd5]
-# CHECK: msr PMBSR_EL12, x0
-[0x60,0x9a,0x1c,0xd5]
-# CHECK: msr PMBSR_EL2, x0
-[0x60,0x9a,0x1e,0xd5]
-# CHECK: msr PMBSR_EL3, x0
-
-[0x60,0x9a,0x3d,0xd5]
-# CHECK: mrs x0, PMBSR_EL12
-[0x60,0x9a,0x3c,0xd5]
-# CHECK: mrs x0, PMBSR_EL2
-[0x60,0x9a,0x3e,0xd5]
-# CHECK: mrs x0, PMBSR_EL3
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.6a-trbe-exception.txt b/llvm/test/MC/Disassembler/AArch64/armv9.6a-trbe-exception.txt
deleted file mode 100644
index 4b39e107538d9..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.6a-trbe-exception.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-# RUN: llvm-mc -triple aarch64 -disassemble < %s | FileCheck %s
-
-[0x60,0x9b,0x1d,0xd5]
-# CHECK: msr TRBSR_EL12, x0
-[0x60,0x9b,0x1c,0xd5]
-# CHECK: msr TRBSR_EL2, x0
-[0x60,0x9b,0x1e,0xd5]
-# CHECK: msr TRBSR_EL3, x0
-
-[0x60,0x9b,0x3d,0xd5]
-# CHECK: mrs x0, TRBSR_EL12
-[0x60,0x9b,0x3c,0xd5]
-# CHECK: mrs x0, TRBSR_EL2
-[0x60,0x9b,0x3e,0xd5]
-# CHECK: mrs x0, TRBSR_EL3

>From 1531a861441588a306446c6f65aae1d1a1d5cfa8 Mon Sep 17 00:00:00 2001
From: Jonathan Thackray <jonathan.thackray at arm.com>
Date: Wed, 25 Jun 2025 21:22:43 +0100
Subject: [PATCH 2/3] [AArch64][llvm] Unify AArch64 tests into a single file
 (2/4) (NFC)

This is a series of patches (2/4) to unify assembly/disassembly of
recent AArch64 tests into a single file. The aim is to improve
consistency, so that all instructions and system registers are
thoroughly tested, and future test cases will be in a unified format.

This patch:
 * removes .txt tests which have only one feature required
 * makes the .s tests have a roundabout run line to test both encoding and assembly
 * creates diagnostic tests when needed
 * fixes naming convention of tests

Co-authored-by: Virginia Cangelosi <virginia.cangelosi at arm.com>
---
 llvm/test/MC/AArch64/armv9.2a-mec.s           | 172 ++++++++++-----
 llvm/test/MC/AArch64/armv9.4-lse128.s         |  98 ---------
 llvm/test/MC/AArch64/armv9.4a-gcs.s           | 198 +++++++++++++-----
 .../MC/AArch64/armv9.4a-lse128-diagnostics.s  |  17 ++
 llvm/test/MC/AArch64/armv9.4a-lse128.s        | 138 ++++++++++++
 llvm/test/MC/AArch64/armv9.5a-cpa.s           |  89 +++++---
 .../MC/AArch64/armv9.6a-mpam-diagnostics.s    |   5 +
 llvm/test/MC/AArch64/armv9.6a-mpam.s          |  80 +++++--
 .../MC/Disassembler/AArch64/armv9.4a-gcs.txt  |  90 --------
 .../Disassembler/AArch64/armv9.4a-lse128.txt  |  98 ---------
 .../MC/Disassembler/AArch64/armv9.5a-cpa.txt  |  42 ----
 .../MC/Disassembler/AArch64/armv9.6a-mpam.txt |  50 -----
 .../MC/Disassembler/AArch64/armv9a-mec.txt    |  54 -----
 13 files changed, 541 insertions(+), 590 deletions(-)
 delete mode 100644 llvm/test/MC/AArch64/armv9.4-lse128.s
 create mode 100644 llvm/test/MC/AArch64/armv9.4a-lse128-diagnostics.s
 create mode 100644 llvm/test/MC/AArch64/armv9.4a-lse128.s
 create mode 100644 llvm/test/MC/AArch64/armv9.6a-mpam-diagnostics.s
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.4a-gcs.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.4a-lse128.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.5a-cpa.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9.6a-mpam.txt
 delete mode 100644 llvm/test/MC/Disassembler/AArch64/armv9a-mec.txt

diff --git a/llvm/test/MC/AArch64/armv9.2a-mec.s b/llvm/test/MC/AArch64/armv9.2a-mec.s
index 42e4bf732086e..c747886f7ec3b 100644
--- a/llvm/test/MC/AArch64/armv9.2a-mec.s
+++ b/llvm/test/MC/AArch64/armv9.2a-mec.s
@@ -1,55 +1,117 @@
-// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=+mec < %s | FileCheck %s
-// RUN: not llvm-mc -triple aarch64-none-linux-gnu < %s 2>&1 | FileCheck --check-prefix=CHECK-NO-MEC %s
-
-          mrs x0, MECIDR_EL2
-// CHECK: mrs   x0, MECIDR_EL2       // encoding: [0xe0,0xa8,0x3c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
-          mrs x0, MECID_P0_EL2
-// CHECK: mrs   x0, MECID_P0_EL2      // encoding: [0x00,0xa8,0x3c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
-          mrs x0, MECID_A0_EL2
-// CHECK: mrs   x0, MECID_A0_EL2      // encoding: [0x20,0xa8,0x3c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
-          mrs x0, MECID_P1_EL2
-// CHECK: mrs   x0, MECID_P1_EL2      // encoding: [0x40,0xa8,0x3c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
-          mrs x0, MECID_A1_EL2
-// CHECK: mrs   x0, MECID_A1_EL2      // encoding: [0x60,0xa8,0x3c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
-          mrs x0, VMECID_P_EL2
-// CHECK: mrs   x0, VMECID_P_EL2     // encoding: [0x00,0xa9,0x3c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
-          mrs x0, VMECID_A_EL2
-// CHECK: mrs   x0, VMECID_A_EL2     // encoding: [0x20,0xa9,0x3c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
-          mrs x0, MECID_RL_A_EL3
-// CHECK: mrs   x0, MECID_RL_A_EL3   // encoding: [0x20,0xaa,0x3e,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:19: error: expected readable system register
-          msr MECID_P0_EL2,    x0
-// CHECK: msr   MECID_P0_EL2, x0      // encoding: [0x00,0xa8,0x1c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
-          msr MECID_A0_EL2,    x0
-// CHECK: msr   MECID_A0_EL2, x0      // encoding: [0x20,0xa8,0x1c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
-          msr MECID_P1_EL2,    x0
-// CHECK: msr   MECID_P1_EL2, x0      // encoding: [0x40,0xa8,0x1c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
-          msr MECID_A1_EL2,    x0
-// CHECK: msr   MECID_A1_EL2, x0      // encoding: [0x60,0xa8,0x1c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
-          msr VMECID_P_EL2,   x0
-// CHECK: msr   VMECID_P_EL2, x0     // encoding: [0x00,0xa9,0x1c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
-          msr VMECID_A_EL2,   x0
-// CHECK: msr   VMECID_A_EL2, x0     // encoding: [0x20,0xa9,0x1c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
-          msr MECID_RL_A_EL3, x0
-// CHECK: msr   MECID_RL_A_EL3, x0   // encoding: [0x20,0xaa,0x1e,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:15: error: expected writable system register or pstate
-
-          dc cigdpae, x0
-// CHECK: dc cigdpae, x0             // encoding: [0xe0,0x7e,0x0c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:14: error: DC CIGDPAE requires: mec
-          dc cipae, x0
-// CHECK: dc cipae, x0               // encoding: [0x00,0x7e,0x0c,0xd5]
-// CHECK-NO-MEC: [[@LINE-2]]:14: error: DC CIPAE requires: mec
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+mec < %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-prefixes=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+mec < %s \
+// RUN:        | llvm-objdump -d --mattr=+mec --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+mec < %s \
+// RUN:   | llvm-objdump -d --mattr=-mec --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+mec < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -mattr=+mec -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
+
+mrs x0, MECIDR_EL2
+// CHECK-INST: mrs x0, MECIDR_EL2
+// CHECK-ENCODING: encoding: [0xe0,0xa8,0x3c,0xd5]
+// CHECK-ERROR: error: expected readable system register
+// CHECK-UNKNOWN:  d53ca8e0 mrs x0, S3_4_C10_C8_7
+
+mrs x0, MECID_P0_EL2
+// CHECK-INST: mrs x0, MECID_P0_EL2
+// CHECK-ENCODING: encoding: [0x00,0xa8,0x3c,0xd5]
+// CHECK-ERROR: error: expected readable system register
+// CHECK-UNKNOWN:  d53ca800 mrs x0, S3_4_C10_C8_0
+
+mrs x0, MECID_A0_EL2
+// CHECK-INST: mrs x0, MECID_A0_EL2
+// CHECK-ENCODING: encoding: [0x20,0xa8,0x3c,0xd5]
+// CHECK-ERROR: error: expected readable system register
+// CHECK-UNKNOWN:  d53ca820 mrs x0, S3_4_C10_C8_1
+
+mrs x0, MECID_P1_EL2
+// CHECK-INST: mrs x0, MECID_P1_EL2
+// CHECK-ENCODING: encoding: [0x40,0xa8,0x3c,0xd5]
+// CHECK-ERROR: error: expected readable system register
+// CHECK-UNKNOWN:  d53ca840 mrs x0, S3_4_C10_C8_2
+
+mrs x0, MECID_A1_EL2
+// CHECK-INST: mrs x0, MECID_A1_EL2
+// CHECK-ENCODING: encoding: [0x60,0xa8,0x3c,0xd5]
+// CHECK-ERROR: error: expected readable system register
+// CHECK-UNKNOWN:  d53ca860 mrs x0, S3_4_C10_C8_3
+
+mrs x0, VMECID_P_EL2
+// CHECK-INST: mrs x0, VMECID_P_EL2
+// CHECK-ENCODING: encoding: [0x00,0xa9,0x3c,0xd5]
+// CHECK-ERROR: error: expected readable system register
+// CHECK-UNKNOWN:  d53ca900 mrs x0, S3_4_C10_C9_0
+
+mrs x0, VMECID_A_EL2
+// CHECK-INST: mrs x0, VMECID_A_EL2
+// CHECK-ENCODING: encoding: [0x20,0xa9,0x3c,0xd5]
+// CHECK-ERROR: error: expected readable system register
+// CHECK-UNKNOWN:  d53ca920 mrs x0, S3_4_C10_C9_1
+
+mrs x0, MECID_RL_A_EL3
+// CHECK-INST: mrs x0, MECID_RL_A_EL3
+// CHECK-ENCODING: encoding: [0x20,0xaa,0x3e,0xd5]
+// CHECK-ERROR: error: expected readable system register
+// CHECK-UNKNOWN:  d53eaa20 mrs x0, S3_6_C10_C10_1
+
+msr MECID_P0_EL2,    x0
+// CHECK-INST: msr MECID_P0_EL2, x0
+// CHECK-ENCODING: encoding: [0x00,0xa8,0x1c,0xd5]
+// CHECK-ERROR: error: expected writable system register or pstate
+// CHECK-UNKNOWN:  d51ca800 msr S3_4_C10_C8_0, x0
+
+msr MECID_A0_EL2,    x0
+// CHECK-INST: msr MECID_A0_EL2, x0
+// CHECK-ENCODING: encoding: [0x20,0xa8,0x1c,0xd5]
+// CHECK-ERROR: error: expected writable system register or pstate
+// CHECK-UNKNOWN:  d51ca820 msr S3_4_C10_C8_1, x0
+
+msr MECID_P1_EL2,    x0
+// CHECK-INST: msr MECID_P1_EL2, x0
+// CHECK-ENCODING: encoding: [0x40,0xa8,0x1c,0xd5]
+// CHECK-ERROR: error: expected writable system register or pstate
+// CHECK-UNKNOWN:  d51ca840 msr S3_4_C10_C8_2, x0
+
+msr MECID_A1_EL2,    x0
+// CHECK-INST: msr MECID_A1_EL2, x0
+// CHECK-ENCODING: encoding: [0x60,0xa8,0x1c,0xd5]
+// CHECK-ERROR: error: expected writable system register or pstate
+// CHECK-UNKNOWN:  d51ca860 msr S3_4_C10_C8_3, x0
+
+msr VMECID_P_EL2,   x0
+// CHECK-INST: msr VMECID_P_EL2, x0
+// CHECK-ENCODING: encoding: [0x00,0xa9,0x1c,0xd5]
+// CHECK-ERROR: error: expected writable system register or pstate
+// CHECK-UNKNOWN:  d51ca900 msr S3_4_C10_C9_0, x0
+
+msr VMECID_A_EL2,   x0
+// CHECK-INST: msr VMECID_A_EL2, x0
+// CHECK-ENCODING: encoding: [0x20,0xa9,0x1c,0xd5]
+// CHECK-ERROR: error: expected writable system register or pstate
+// CHECK-UNKNOWN:  d51ca920 msr S3_4_C10_C9_1, x0
+
+msr MECID_RL_A_EL3, x0
+// CHECK-INST: msr MECID_RL_A_EL3, x0
+// CHECK-ENCODING: encoding: [0x20,0xaa,0x1e,0xd5]
+// CHECK-ERROR: error: expected writable system register or pstate
+// CHECK-UNKNOWN:  d51eaa20 msr S3_6_C10_C10_1, x0
+
+dc cigdpae, x0
+// CHECK-INST: dc cigdpae, x0
+// CHECK-ENCODING: encoding: [0xe0,0x7e,0x0c,0xd5]
+// CHECK-ERROR: :[[@LINE-3]]:4: error: DC CIGDPAE requires: mec
+// CHECK-UNKNOWN:  d50c7ee0 sys #4, c7, c14, #7, x0
+
+dc cipae, x0
+// CHECK-INST: dc cipae, x0
+// CHECK-ENCODING: encoding: [0x00,0x7e,0x0c,0xd5]
+// CHECK-ERROR: :[[@LINE-3]]:4: error: DC CIPAE requires: mec
+// CHECK-UNKNOWN:  d50c7e00 sys #4, c7, c14, #0, x0
diff --git a/llvm/test/MC/AArch64/armv9.4-lse128.s b/llvm/test/MC/AArch64/armv9.4-lse128.s
deleted file mode 100644
index a639278ec8263..0000000000000
--- a/llvm/test/MC/AArch64/armv9.4-lse128.s
+++ /dev/null
@@ -1,98 +0,0 @@
-// RUN: not llvm-mc -triple aarch64 -show-encoding -mattr +lse128 %s 2>%t | FileCheck %s
-// RUN: FileCheck %s --input-file=%t --check-prefix=ERROR-INVALID-OP
-// RUN: not llvm-mc -triple aarch64 -show-encoding %s 2>&1 | FileCheck --check-prefix=ERROR-NO-LSE128 %s
-
-ldclrp   x1, x2, [x11]
-// CHECK: ldclrp x1, x2, [x11]                   // encoding: [0x61,0x11,0x22,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldclrp   x21, x22, [sp]
-// CHECK: ldclrp x21, x22, [sp]                  // encoding: [0xf5,0x13,0x36,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldclrpa  x1, x2, [x11]
-// CHECK: ldclrpa x1, x2, [x11]                   // encoding: [0x61,0x11,0xa2,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldclrpa  x21, x22, [sp]
-// CHECK: ldclrpa x21, x22, [sp]                  // encoding: [0xf5,0x13,0xb6,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldclrpal x1, x2, [x11]
-// CHECK: ldclrpal x1, x2, [x11]                   // encoding: [0x61,0x11,0xe2,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldclrpal x21, x22, [sp]
-// CHECK: ldclrpal x21, x22, [sp]                  // encoding: [0xf5,0x13,0xf6,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldclrpl  x1, x2, [x11]
-// CHECK: ldclrpl x1, x2, [x11]                   // encoding: [0x61,0x11,0x62,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldclrpl  x21, x22, [sp]
-// CHECK: ldclrpl x21, x22, [sp]                  // encoding: [0xf5,0x13,0x76,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldclrpl  x22, xzr, [sp]
-// ERROR-INVALID-OP: [[@LINE-1]]:15: error: invalid operand for instruction
-// ERROR-NO-LSE128: error: invalid operand for instruction
-ldclrpl  xzr, x22, [sp]
-// ERROR-INVALID-OP: [[@LINE-1]]:10: error: invalid operand for instruction
-// ERROR-NO-LSE128: error: invalid operand for instruction
-
-ldsetp   x1, x2, [x11]
-// CHECK: ldsetp x1, x2, [x11]                   // encoding: [0x61,0x31,0x22,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldsetp   x21, x22, [sp]
-// CHECK: ldsetp x21, x22, [sp]                  // encoding: [0xf5,0x33,0x36,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldsetpa  x1, x2, [x11]
-// CHECK: ldsetpa x1, x2, [x11]                   // encoding: [0x61,0x31,0xa2,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldsetpa  x21, x22, [sp]
-// CHECK: ldsetpa x21, x22, [sp]                  // encoding: [0xf5,0x33,0xb6,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldsetpal x1, x2, [x11]
-// CHECK: ldsetpal x1, x2, [x11]                   // encoding: [0x61,0x31,0xe2,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldsetpal x21, x22, [sp]
-// CHECK: ldsetpal x21, x22, [sp]                  // encoding: [0xf5,0x33,0xf6,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldsetpl  x1, x2, [x11]
-// CHECK: ldsetpl x1, x2, [x11]                   // encoding: [0x61,0x31,0x62,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldsetpl  x21, x22, [sp]
-// CHECK: ldsetpl x21, x22, [sp]                  // encoding: [0xf5,0x33,0x76,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-ldsetpl  x22, xzr, [sp]
-// ERROR-INVALID-OP: [[@LINE-1]]:15: error: invalid operand for instruction
-// ERROR-NO-LSE128: error: invalid operand for instruction
-ldsetpl  xzr, x22, [sp]
-// ERROR-INVALID-OP: [[@LINE-1]]:10: error: invalid operand for instruction
-// ERROR-NO-LSE128: error: invalid operand for instruction
-
-
-swpp     x1, x2, [x11]
-// CHECK: swpp x1, x2, [x11]                   // encoding: [0x61,0x81,0x22,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-swpp     x21, x22, [sp]
-// CHECK: swpp x21, x22, [sp]                  // encoding: [0xf5,0x83,0x36,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-swppa    x1, x2, [x11]
-// CHECK: swppa x1, x2, [x11]                   // encoding: [0x61,0x81,0xa2,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-swppa    x21, x22, [sp]
-// CHECK: swppa x21, x22, [sp]                  // encoding: [0xf5,0x83,0xb6,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-swppal   x1, x2, [x11]
-// CHECK: swppal x1, x2, [x11]                   // encoding: [0x61,0x81,0xe2,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-swppal   x21, x22, [sp]
-// CHECK: swppal x21, x22, [sp]                  // encoding: [0xf5,0x83,0xf6,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-swppl    x1, x2, [x11]
-// CHECK: swppl x1, x2, [x11]                   // encoding: [0x61,0x81,0x62,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-swppl    x21, x22, [sp]
-// CHECK: swppl x21, x22, [sp]                  // encoding: [0xf5,0x83,0x76,0x19]
-// ERROR-NO-LSE128: [[@LINE-2]]:1: error: instruction requires: lse128
-swppl    x22, xzr, [sp]
-// ERROR-INVALID-OP: [[@LINE-1]]:15: error: invalid operand for instruction
-// ERROR-NO-LSE128: error: invalid operand for instruction
-swppl    xzr, x22, [sp]
-// ERROR-INVALID-OP: [[@LINE-1]]:10: error: invalid operand for instruction
-// ERROR-NO-LSE128: error: invalid operand for instruction
-
diff --git a/llvm/test/MC/AArch64/armv9.4a-gcs.s b/llvm/test/MC/AArch64/armv9.4a-gcs.s
index b4af9b5dcb10c..d6ac23dc2174d 100644
--- a/llvm/test/MC/AArch64/armv9.4a-gcs.s
+++ b/llvm/test/MC/AArch64/armv9.4a-gcs.s
@@ -1,115 +1,203 @@
-// RUN: llvm-mc -triple aarch64 -mattr +gcs -show-encoding %s | FileCheck %s
-// RUN: not llvm-mc -triple aarch64 -show-encoding %s 2>%t | FileCheck %s --check-prefix=NO-GCS
-// RUN: FileCheck --check-prefix=ERROR-NO-GCS %s < %t
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+gcs < %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-prefixes=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+gcs < %s \
+// RUN:        | llvm-objdump -d --mattr=+gcs --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+gcs < %s \
+// RUN:   | llvm-objdump -d --mattr=-gcs --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+gcs < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -mattr=+gcs -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 msr GCSCR_EL1, x0
+// CHECK-INST: msr GCSCR_EL1, x0
+// CHECK-ENCODING: encoding: [0x00,0x25,0x18,0xd5]
+// CHECK-UNKNOWN:  d5182500 msr GCSCR_EL1, x0
+
 mrs x1, GCSCR_EL1
-// CHECK: msr     GCSCR_EL1, x0                   // encoding: [0x00,0x25,0x18,0xd5]
-// CHECK: mrs     x1, GCSCR_EL1                   // encoding: [0x01,0x25,0x38,0xd5]
+// CHECK-INST: mrs x1, GCSCR_EL1
+// CHECK-ENCODING: encoding: [0x01,0x25,0x38,0xd5]
+// CHECK-UNKNOWN:  d5382501 mrs x1, GCSCR_EL1
 
 msr GCSPR_EL1, x2
+// CHECK-INST: msr GCSPR_EL1, x2
+// CHECK-ENCODING: encoding: [0x22,0x25,0x18,0xd5]
+// CHECK-UNKNOWN:  d5182522 msr GCSPR_EL1, x2
+
 mrs x3, GCSPR_EL1
-// CHECK: msr     GCSPR_EL1, x2                   // encoding: [0x22,0x25,0x18,0xd5]
-// CHECK: mrs     x3, GCSPR_EL1                   // encoding: [0x23,0x25,0x38,0xd5]
+// CHECK-INST: mrs x3, GCSPR_EL1
+// CHECK-ENCODING: encoding: [0x23,0x25,0x38,0xd5]
+// CHECK-UNKNOWN:  d5382523 mrs x3, GCSPR_EL1
 
 msr GCSCRE0_EL1, x4
+// CHECK-INST: msr GCSCRE0_EL1, x4
+// CHECK-ENCODING: encoding: [0x44,0x25,0x18,0xd5]
+// CHECK-UNKNOWN:  d5182544 msr GCSCRE0_EL1, x4
+
 mrs x5, GCSCRE0_EL1
-// CHECK: msr     GCSCRE0_EL1, x4                 // encoding: [0x44,0x25,0x18,0xd5]
-// CHECK: mrs     x5, GCSCRE0_EL1                 // encoding: [0x45,0x25,0x38,0xd5]
+// CHECK-INST: mrs x5, GCSCRE0_EL1
+// CHECK-ENCODING: encoding: [0x45,0x25,0x38,0xd5]
+// CHECK-UNKNOWN:  d5382545 mrs x5, GCSCRE0_EL1
 
 msr GCSPR_EL0, x6
+// CHECK-INST: msr GCSPR_EL0, x6
+// CHECK-ENCODING: encoding: [0x26,0x25,0x1b,0xd5]
+// CHECK-UNKNOWN:  d51b2526 msr GCSPR_EL0, x6
+
 mrs x7, GCSPR_EL0
-// CHECK: msr     GCSPR_EL0, x6                   // encoding: [0x26,0x25,0x1b,0xd5]
-// CHECK: mrs     x7, GCSPR_EL0                   // encoding: [0x27,0x25,0x3b,0xd5]
+// CHECK-INST: mrs x7, GCSPR_EL0
+// CHECK-ENCODING: encoding: [0x27,0x25,0x3b,0xd5]
+// CHECK-UNKNOWN:  d53b2527 mrs x7, GCSPR_EL0
 
 msr GCSCR_EL2, x10
+// CHECK-INST: msr GCSCR_EL2, x10
+// CHECK-ENCODING: encoding: [0x0a,0x25,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c250a msr GCSCR_EL2, x10
+
 mrs x11, GCSCR_EL2
-// CHECK: msr     GCSCR_EL2, x10                  // encoding: [0x0a,0x25,0x1c,0xd5]
-// CHECK: mrs     x11, GCSCR_EL2                  // encoding: [0x0b,0x25,0x3c,0xd5]
+// CHECK-INST: mrs x11, GCSCR_EL2
+// CHECK-ENCODING: encoding: [0x0b,0x25,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c250b mrs x11, GCSCR_EL2
 
 msr GCSPR_EL2, x12
+// CHECK-INST: msr GCSPR_EL2, x12
+// CHECK-ENCODING: encoding: [0x2c,0x25,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51c252c msr GCSPR_EL2, x12
+
 mrs x13, GCSPR_EL2
-// CHECK: msr     GCSPR_EL2, x12                  // encoding: [0x2c,0x25,0x1c,0xd5]
-// CHECK: mrs     x13, GCSPR_EL2                  // encoding: [0x2d,0x25,0x3c,0xd5]
+// CHECK-INST: mrs x13, GCSPR_EL2
+// CHECK-ENCODING: encoding: [0x2d,0x25,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53c252d mrs x13, GCSPR_EL2
 
 msr GCSCR_EL12, x14
+// CHECK-INST: msr GCSCR_EL12, x14
+// CHECK-ENCODING: encoding: [0x0e,0x25,0x1d,0xd5]
+// CHECK-UNKNOWN:  d51d250e msr GCSCR_EL12, x14
+
 mrs x15, GCSCR_EL12
-// CHECK: msr     GCSCR_EL12, x14                 // encoding: [0x0e,0x25,0x1d,0xd5]
-// CHECK: mrs     x15, GCSCR_EL12                 // encoding: [0x0f,0x25,0x3d,0xd5]
+// CHECK-INST: mrs x15, GCSCR_EL12
+// CHECK-ENCODING: encoding: [0x0f,0x25,0x3d,0xd5]
+// CHECK-UNKNOWN:  d53d250f mrs x15, GCSCR_EL12
 
 msr GCSPR_EL12, x16
+// CHECK-INST: msr GCSPR_EL12, x16
+// CHECK-ENCODING: encoding: [0x30,0x25,0x1d,0xd5]
+// CHECK-UNKNOWN:  d51d2530 msr GCSPR_EL12, x16
+
 mrs x17, GCSPR_EL12
-// CHECK: msr     GCSPR_EL12, x16                 // encoding: [0x30,0x25,0x1d,0xd5]
-// CHECK: mrs     x17, GCSPR_EL12                 // encoding: [0x31,0x25,0x3d,0xd5]
+// CHECK-INST: mrs x17, GCSPR_EL12
+// CHECK-ENCODING: encoding: [0x31,0x25,0x3d,0xd5]
+// CHECK-UNKNOWN:  d53d2531 mrs x17, GCSPR_EL12
 
 msr GCSCR_EL3, x18
+// CHECK-INST: msr GCSCR_EL3, x18
+// CHECK-ENCODING: encoding: [0x12,0x25,0x1e,0xd5]
+// CHECK-UNKNOWN:  d51e2512 msr GCSCR_EL3, x18
+
 mrs x19, GCSCR_EL3
-// CHECK: msr     GCSCR_EL3, x18                  // encoding: [0x12,0x25,0x1e,0xd5]
-// CHECK: mrs     x19, GCSCR_EL3                  // encoding: [0x13,0x25,0x3e,0xd5]
+// CHECK-INST: mrs x19, GCSCR_EL3
+// CHECK-ENCODING: encoding: [0x13,0x25,0x3e,0xd5]
+// CHECK-UNKNOWN:  d53e2513 mrs x19, GCSCR_EL3
 
 msr GCSPR_EL3, x20
+// CHECK-INST: msr GCSPR_EL3, x20
+// CHECK-ENCODING: encoding: [0x34,0x25,0x1e,0xd5]
+// CHECK-UNKNOWN:  d51e2534 msr GCSPR_EL3, x20
+
 mrs x21, GCSPR_EL3
-// CHECK: msr     GCSPR_EL3, x20                  // encoding: [0x34,0x25,0x1e,0xd5]
-// CHECK: mrs     x21, GCSPR_EL3                  // encoding: [0x35,0x25,0x3e,0xd5]
+// CHECK-INST: mrs x21, GCSPR_EL3
+// CHECK-ENCODING: encoding: [0x35,0x25,0x3e,0xd5]
+// CHECK-UNKNOWN:  d53e2535 mrs x21, GCSPR_EL3
 
 gcsss1 x21
-// CHECK: gcsss1  x21                        // encoding: [0x55,0x77,0x0b,0xd5]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcsss1 x21
+// CHECK-ENCODING: encoding: [0x55,0x77,0x0b,0xd5]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d50b7755 sys #3, c7, c7, #2, x21
 
 gcsss2 x22
-// CHECK: gcsss2  x22                        // encoding: [0x76,0x77,0x2b,0xd5]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcsss2 x22
+// CHECK-ENCODING: encoding: [0x76,0x77,0x2b,0xd5]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d52b7776 sysl x22, #3, c7, c7, #3
 
 gcspushm x25
-// CHECK: gcspushm x25                       // encoding: [0x19,0x77,0x0b,0xd5]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcspushm x25
+// CHECK-ENCODING: encoding: [0x19,0x77,0x0b,0xd5]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d50b7719 sys #3, c7, c7, #0, x25
 
 gcspopm
-// CHECK: gcspopm                             // encoding: [0x3f,0x77,0x2b,0xd5]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcspopm
+// CHECK-ENCODING: encoding: [0x3f,0x77,0x2b,0xd5]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d52b773f sysl xzr, #3, c7, c7, #1
 
 gcspopm xzr
-// CHECK: gcspopm                            // encoding: [0x3f,0x77,0x2b,0xd5]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcspopm
+// CHECK-ENCODING: encoding: [0x3f,0x77,0x2b,0xd5]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d52b773f sysl xzr, #3, c7, c7, #1
 
 gcspopm x25
-// CHECK: gcspopm  x25                        // encoding: [0x39,0x77,0x2b,0xd5]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcspopm x25
+// CHECK-ENCODING: encoding: [0x39,0x77,0x2b,0xd5]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d52b7739 sysl x25, #3, c7, c7, #1
 
 gcsb dsync
-// CHECK: gcsb    dsync                           // encoding: [0x7f,0x22,0x03,0xd5]
-// ERROR-NO-GCS-NOT: [[@LINE-2]]:1: error: instruction requires: gcs
-// NO-GCS: hint #19                              // encoding: [0x7f,0x22,0x03,0xd5]
+// CHECK-INST: gcsb dsync
+// CHECK-ENCODING: encoding: [0x7f,0x22,0x03,0xd5]
+// CHECK-UNKNOWN:  d503227f hint #19
 
 hint #19
-// CHECK: gcsb    dsync                           // encoding: [0x7f,0x22,0x03,0xd5]
-// ERROR-NO-GCS-NOT: [[@LINE-2]]:1: error: instruction requires: gcs
-// NO-GCS: hint #19                              // encoding: [0x7f,0x22,0x03,0xd5]
+// CHECK-INST: gcsb dsync
+// CHECK-ENCODING: encoding: [0x7f,0x22,0x03,0xd5]
+// CHECK-UNKNOWN:  d503227f hint #19
 
 gcsstr x26, [x27]
-// CHECK: gcsstr x26, [x27]                        // encoding: [0x7a,0x0f,0x1f,0xd9]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcsstr x26, [x27]
+// CHECK-ENCODING: encoding: [0x7a,0x0f,0x1f,0xd9]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d91f0f7a <unknown>
 
 gcsstr x26, [sp]
-// CHECK: gcsstr x26, [sp]                         // encoding: [0xfa,0x0f,0x1f,0xd9]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcsstr x26, [sp]
+// CHECK-ENCODING: encoding: [0xfa,0x0f,0x1f,0xd9]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d91f0ffa <unknown>
 
 gcssttr x26, [x27]
-// CHECK: gcssttr x26, [x27]                       // encoding: [0x7a,0x1f,0x1f,0xd9]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcssttr x26, [x27]
+// CHECK-ENCODING: encoding: [0x7a,0x1f,0x1f,0xd9]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d91f1f7a <unknown>
 
 gcssttr x26, [sp]
-// CHECK: gcssttr x26, [sp]                        // encoding: [0xfa,0x1f,0x1f,0xd9]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcssttr x26, [sp]
+// CHECK-ENCODING: encoding: [0xfa,0x1f,0x1f,0xd9]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d91f1ffa <unknown>
 
 gcspushx
-// CHECK: gcspushx                          // encoding: [0x9f,0x77,0x08,0xd5]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcspushx
+// CHECK-ENCODING: encoding: [0x9f,0x77,0x08,0xd5]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d508779f sys #0, c7, c7, #4
 
 gcspopcx
-// CHECK: gcspopcx                          // encoding: [0xbf,0x77,0x08,0xd5]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcspopcx
+// CHECK-ENCODING: encoding: [0xbf,0x77,0x08,0xd5]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d50877bf sys #0, c7, c7, #5
 
 gcspopx
-// CHECK: gcspopx                           // encoding: [0xdf,0x77,0x08,0xd5]
-// ERROR-NO-GCS: [[@LINE-2]]:1: error: instruction requires: gcs
+// CHECK-INST: gcspopx
+// CHECK-ENCODING: encoding: [0xdf,0x77,0x08,0xd5]
+// CHECK-ERROR: error: instruction requires: gcs
+// CHECK-UNKNOWN:  d50877df sys #0, c7, c7, #6
diff --git a/llvm/test/MC/AArch64/armv9.4a-lse128-diagnostics.s b/llvm/test/MC/AArch64/armv9.4a-lse128-diagnostics.s
new file mode 100644
index 0000000000000..3ff3a98088f1e
--- /dev/null
+++ b/llvm/test/MC/AArch64/armv9.4a-lse128-diagnostics.s
@@ -0,0 +1,17 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ERROR
+
+ldclrpl  x22, xzr, [sp]
+// CHECK-ERROR: error: invalid operand for instruction
+ldclrpl  xzr, x22, [sp]
+// CHECK-ERROR: error: invalid operand for instruction
+
+ldsetpl  x22, xzr, [sp]
+// CHECK-ERROR: error: invalid operand for instruction
+ldsetpl  xzr, x22, [sp]
+// CHECK-ERROR: error: invalid operand for instruction
+
+swppl    x22, xzr, [sp]
+// CHECK-ERROR: error: invalid operand for instruction
+swppl    xzr, x22, [sp]
+// CHECK-ERROR: error: invalid operand for instruction
diff --git a/llvm/test/MC/AArch64/armv9.4a-lse128.s b/llvm/test/MC/AArch64/armv9.4a-lse128.s
new file mode 100644
index 0000000000000..856ca19164a75
--- /dev/null
+++ b/llvm/test/MC/AArch64/armv9.4a-lse128.s
@@ -0,0 +1,138 @@
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+lse128 < %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-prefixes=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+lse128 < %s \
+// RUN:        | llvm-objdump -d --mattr=+lse128 - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+lse128 < %s \
+// RUN:   | llvm-objdump -d --mattr=-lse128 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+lse128 < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -mattr=+lse128 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
+
+ldclrp   x1, x2, [x11]
+// CHECK-INST: ldclrp x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x11,0x22,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19221161 <unknown>
+ldclrp   x21, x22, [sp]
+// CHECK-INST: ldclrp x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x13,0x36,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  193613f5 <unknown>
+ldclrpa  x1, x2, [x11]
+// CHECK-INST: ldclrpa x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x11,0xa2,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19a21161 <unknown>
+ldclrpa  x21, x22, [sp]
+// CHECK-INST: ldclrpa x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x13,0xb6,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19b613f5 <unknown>
+ldclrpal x1, x2, [x11]
+// CHECK-INST: ldclrpal x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x11,0xe2,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19e21161 <unknown>
+ldclrpal x21, x22, [sp]
+// CHECK-INST: ldclrpal x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x13,0xf6,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19f613f5 <unknown>
+ldclrpl  x1, x2, [x11]
+// CHECK-INST: ldclrpl x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x11,0x62,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19621161 <unknown>
+ldclrpl  x21, x22, [sp]
+// CHECK-INST: ldclrpl x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x13,0x76,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  197613f5 <unknown>
+
+ldsetp   x1, x2, [x11]
+// CHECK-INST: ldsetp x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x31,0x22,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19223161 <unknown>
+ldsetp   x21, x22, [sp]
+// CHECK-INST: ldsetp x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x33,0x36,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  193633f5 <unknown>
+ldsetpa  x1, x2, [x11]
+// CHECK-INST: ldsetpa x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x31,0xa2,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19a23161 <unknown>
+ldsetpa  x21, x22, [sp]
+// CHECK-INST: ldsetpa x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x33,0xb6,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19b633f5 <unknown>
+ldsetpal x1, x2, [x11]
+// CHECK-INST: ldsetpal x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x31,0xe2,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19e23161 <unknown>
+ldsetpal x21, x22, [sp]
+// CHECK-INST: ldsetpal x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x33,0xf6,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19f633f5 <unknown>
+ldsetpl  x1, x2, [x11]
+// CHECK-INST: ldsetpl x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x31,0x62,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19623161 <unknown>
+ldsetpl  x21, x22, [sp]
+// CHECK-INST: ldsetpl x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x33,0x76,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  197633f5 <unknown>
+
+swpp     x1, x2, [x11]
+// CHECK-INST: swpp x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x81,0x22,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19228161 <unknown>
+swpp     x21, x22, [sp]
+// CHECK-INST: swpp x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x83,0x36,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  193683f5 <unknown>
+swppa    x1, x2, [x11]
+// CHECK-INST: swppa x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x81,0xa2,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19a28161 <unknown>
+swppa    x21, x22, [sp]
+// CHECK-INST: swppa x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x83,0xb6,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19b683f5 <unknown>
+swppal   x1, x2, [x11]
+// CHECK-INST: swppal x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x81,0xe2,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19e28161 <unknown>
+swppal   x21, x22, [sp]
+// CHECK-INST: swppal x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x83,0xf6,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19f683f5 <unknown>
+swppl    x1, x2, [x11]
+// CHECK-INST: swppl x1, x2, [x11]
+// CHECK-ENCODING: encoding: [0x61,0x81,0x62,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  19628161 <unknown>
+swppl    x21, x22, [sp]
+// CHECK-INST: swppl x21, x22, [sp]
+// CHECK-ENCODING: encoding: [0xf5,0x83,0x76,0x19]
+// CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
+// CHECK-UNKNOWN:  197683f5 <unknown>
diff --git a/llvm/test/MC/AArch64/armv9.5a-cpa.s b/llvm/test/MC/AArch64/armv9.5a-cpa.s
index 1c338eccf6cac..c106dea322293 100644
--- a/llvm/test/MC/AArch64/armv9.5a-cpa.s
+++ b/llvm/test/MC/AArch64/armv9.5a-cpa.s
@@ -1,50 +1,87 @@
-// RUN: llvm-mc -triple aarch64 -show-encoding -mattr=+cpa < %s | FileCheck %s
-// RUN: not llvm-mc -triple aarch64 < %s 2>&1 | FileCheck --check-prefix=ERROR-NO-CPA %s
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+cpa < %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-prefixes=CHECK-ERROR
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+cpa < %s \
+// RUN:        | llvm-objdump -d --mattr=+cpa - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+cpa < %s \
+// RUN:   | llvm-objdump -d --mattr=-cpa - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+cpa < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -mattr=+cpa -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 addpt x0, x1, x2
-// CHECK: addpt x0, x1, x2               // encoding: [0x20,0x20,0x02,0x9a]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: addpt x0, x1, x2
+// CHECK-ENCODING: encoding: [0x20,0x20,0x02,0x9a]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  9a022020 <unknown>
 
 addpt sp, sp, x2
-// CHECK: addpt sp, sp, x2               // encoding: [0xff,0x23,0x02,0x9a]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: addpt sp, sp, x2
+// CHECK-ENCODING: encoding: [0xff,0x23,0x02,0x9a]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  9a0223ff <unknown>
 
 addpt x0, x1, x2, lsl #0
-// CHECK: addpt x0, x1, x2               // encoding: [0x20,0x20,0x02,0x9a]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: addpt x0, x1, x2
+// CHECK-ENCODING: encoding: [0x20,0x20,0x02,0x9a]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  9a022020 <unknown>
 
 addpt x0, x1, x2, lsl #7
-// CHECK: addpt x0, x1, x2, lsl #7       // encoding: [0x20,0x3c,0x02,0x9a]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: addpt x0, x1, x2, lsl #7
+// CHECK-ENCODING: encoding: [0x20,0x3c,0x02,0x9a]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  9a023c20 <unknown>
 
 addpt sp, sp, x2, lsl #7
-// CHECK: addpt sp, sp, x2, lsl #7       // encoding: [0xff,0x3f,0x02,0x9a]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: addpt sp, sp, x2, lsl #7
+// CHECK-ENCODING: encoding: [0xff,0x3f,0x02,0x9a]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  9a023fff <unknown>
 
 subpt x0, x1, x2
-// CHECK: subpt x0, x1, x2               // encoding: [0x20,0x20,0x02,0xda]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: subpt x0, x1, x2
+// CHECK-ENCODING: encoding: [0x20,0x20,0x02,0xda]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  da022020 <unknown>
 
 subpt sp, sp, x2
-// CHECK: subpt sp, sp, x2               // encoding: [0xff,0x23,0x02,0xda]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: subpt sp, sp, x2
+// CHECK-ENCODING: encoding: [0xff,0x23,0x02,0xda]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  da0223ff <unknown>
 
 subpt x0, x1, x2, lsl #0
-// CHECK: subpt x0, x1, x2               // encoding: [0x20,0x20,0x02,0xda]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: subpt x0, x1, x2
+// CHECK-ENCODING: encoding: [0x20,0x20,0x02,0xda]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  da022020 <unknown>
 
 subpt x0, x1, x2, lsl #7
-// CHECK: subpt x0, x1, x2, lsl #7       // encoding: [0x20,0x3c,0x02,0xda]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: subpt x0, x1, x2, lsl #7
+// CHECK-ENCODING: encoding: [0x20,0x3c,0x02,0xda]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  da023c20 <unknown>
 
 subpt sp, sp, x2, lsl #7
-// CHECK: subpt sp, sp, x2, lsl #7       // encoding: [0xff,0x3f,0x02,0xda]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: subpt sp, sp, x2, lsl #7
+// CHECK-ENCODING: encoding: [0xff,0x3f,0x02,0xda]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  da023fff <unknown>
 
 maddpt x0, x1, x2, x3
-// CHECK: maddpt x0, x1, x2, x3          // encoding: [0x20,0x0c,0x62,0x9b]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: maddpt x0, x1, x2, x3
+// CHECK-ENCODING: encoding: [0x20,0x0c,0x62,0x9b]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  9b620c20 <unknown>
 
 msubpt x0, x1, x2, x3
-// CHECK: msubpt x0, x1, x2, x3          // encoding: [0x20,0x8c,0x62,0x9b]
-// ERROR-NO-CPA: error: instruction requires: cpa
+// CHECK-INST: msubpt x0, x1, x2, x3
+// CHECK-ENCODING: encoding: [0x20,0x8c,0x62,0x9b]
+// CHECK-ERROR: error: instruction requires: cpa
+// CHECK-UNKNOWN:  9b628c20 <unknown>
diff --git a/llvm/test/MC/AArch64/armv9.6a-mpam-diagnostics.s b/llvm/test/MC/AArch64/armv9.6a-mpam-diagnostics.s
new file mode 100644
index 0000000000000..a39eaef2a8df4
--- /dev/null
+++ b/llvm/test/MC/AArch64/armv9.6a-mpam-diagnostics.s
@@ -0,0 +1,5 @@
+// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ERROR
+
+msr MPAMBWIDR_EL1, x0
+// CHECK-ERROR: error: expected writable system register or pstate
\ No newline at end of file
diff --git a/llvm/test/MC/AArch64/armv9.6a-mpam.s b/llvm/test/MC/AArch64/armv9.6a-mpam.s
index c0696efd3cceb..0201365f15fb8 100644
--- a/llvm/test/MC/AArch64/armv9.6a-mpam.s
+++ b/llvm/test/MC/AArch64/armv9.6a-mpam.s
@@ -1,45 +1,81 @@
-// RUN: not llvm-mc -triple aarch64-none-linux-gnu -show-encoding < %s 2> %t | FileCheck %s --check-prefix=CHECK
-// RUN: FileCheck --check-prefix=CHECK-RO < %t %s
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
+// RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
+// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// Disassemble encoding and check the re-encoding (-show-encoding) matches.
+// RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
+// RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
+// RUN:        | llvm-mc -triple=aarch64 -disassemble -show-encoding \
+// RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
+
+
 
 //------------------------------------------------------------------------------
 // Armv9.6-A FEAT_MPAM Extensions
 //------------------------------------------------------------------------------
 
-msr MPAMBWIDR_EL1, x0
 msr MPAMBW3_EL3, x0
+// CHECK-INST: msr MPAMBW3_EL3, x0
+// CHECK-ENCODING: encoding: [0x80,0xa5,0x1e,0xd5]
+// CHECK-UNKNOWN:  d51ea580 msr MPAMBW3_EL3, x0
 msr MPAMBW2_EL2, x0
+// CHECK-INST: msr MPAMBW2_EL2, x0
+// CHECK-ENCODING: encoding: [0x80,0xa5,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51ca580 msr MPAMBW2_EL2, x0
 msr MPAMBW1_EL1, x0
+// CHECK-INST: msr MPAMBW1_EL1, x0
+// CHECK-ENCODING: encoding: [0x80,0xa5,0x18,0xd5]
+// CHECK-UNKNOWN:  d518a580 msr MPAMBW1_EL1, x0
 msr MPAMBW1_EL12, x0
+// CHECK-INST: msr MPAMBW1_EL12, x0
+// CHECK-ENCODING: encoding: [0x80,0xa5,0x1d,0xd5]
+// CHECK-UNKNOWN:  d51da580 msr MPAMBW1_EL12, x0
 msr MPAMBW0_EL1, x0
+// CHECK-INST: msr MPAMBW0_EL1, x0
+// CHECK-ENCODING: encoding: [0xa0,0xa5,0x18,0xd5]
+// CHECK-UNKNOWN:  d518a5a0 msr MPAMBW0_EL1, x0
 msr MPAMBWCAP_EL2, x0
+// CHECK-INST: msr MPAMBWCAP_EL2, x0
+// CHECK-ENCODING: encoding: [0xc0,0xa5,0x1c,0xd5]
+// CHECK-UNKNOWN:  d51ca5c0 msr MPAMBWCAP_EL2, x0
 msr MPAMBWSM_EL1, x0
+// CHECK-INST: msr MPAMBWSM_EL1, x0
+// CHECK-ENCODING: encoding: [0xe0,0xa5,0x18,0xd5]
+// CHECK-UNKNOWN:  d518a5e0 msr MPAMBWSM_EL1, x0
 
 mrs x0, MPAMBWIDR_EL1
+// CHECK-INST: mrs x0, MPAMBWIDR_EL1
+// CHECK-ENCODING: encoding: [0xa0,0xa4,0x38,0xd5]
+// CHECK-UNKNOWN:  d538a4a0 mrs x0, MPAMBWIDR_EL1
 mrs x0, MPAMBW3_EL3
+// CHECK-INST: mrs x0, MPAMBW3_EL3
+// CHECK-ENCODING: encoding: [0x80,0xa5,0x3e,0xd5]
+// CHECK-UNKNOWN:  d53ea580 mrs x0, MPAMBW3_EL3
 mrs x0, MPAMBW2_EL2
+// CHECK-INST: mrs x0, MPAMBW2_EL2
+// CHECK-ENCODING: encoding: [0x80,0xa5,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53ca580 mrs x0, MPAMBW2_EL2
 mrs x0, MPAMBW1_EL1
+// CHECK-INST: mrs x0, MPAMBW1_EL1
+// CHECK-ENCODING: encoding: [0x80,0xa5,0x38,0xd5]
+// CHECK-UNKNOWN:  d538a580 mrs x0, MPAMBW1_EL1
 mrs x0, MPAMBW1_EL12
+// CHECK-INST: mrs x0, MPAMBW1_EL12
+// CHECK-ENCODING: encoding: [0x80,0xa5,0x3d,0xd5]
+// CHECK-UNKNOWN:  d53da580 mrs x0, MPAMBW1_EL12
 mrs x0, MPAMBW0_EL1
+// CHECK-INST: mrs x0, MPAMBW0_EL1
+// CHECK-ENCODING: encoding: [0xa0,0xa5,0x38,0xd5]
+// CHECK-UNKNOWN:  d538a5a0 mrs x0, MPAMBW0_EL1
 mrs x0, MPAMBWCAP_EL2
+// CHECK-INST: mrs x0, MPAMBWCAP_EL2
+// CHECK-ENCODING: encoding: [0xc0,0xa5,0x3c,0xd5]
+// CHECK-UNKNOWN:  d53ca5c0 mrs x0, MPAMBWCAP_EL2
 mrs x0, MPAMBWSM_EL1
+// CHECK-INST: mrs x0, MPAMBWSM_EL1
+// CHECK-ENCODING: encoding: [0xe0,0xa5,0x38,0xd5]
+// CHECK-UNKNOWN:  d538a5e0 mrs x0, MPAMBWSM_EL1
 
-//CHECK: msr     MPAMBW3_EL3, x0                 // encoding: [0x80,0xa5,0x1e,0xd5]
-//CHECK: msr     MPAMBW2_EL2, x0                 // encoding: [0x80,0xa5,0x1c,0xd5]
-//CHECK: msr     MPAMBW1_EL1, x0                 // encoding: [0x80,0xa5,0x18,0xd5]
-//CHECK: msr     MPAMBW1_EL12, x0                // encoding: [0x80,0xa5,0x1d,0xd5]
-//CHECK: msr     MPAMBW0_EL1, x0                 // encoding: [0xa0,0xa5,0x18,0xd5]
-//CHECK: msr     MPAMBWCAP_EL2, x0               // encoding: [0xc0,0xa5,0x1c,0xd5]
-//CHECK: msr     MPAMBWSM_EL1, x0                // encoding: [0xe0,0xa5,0x18,0xd5]
-
-//CHECK-RO: error: expected writable system register or pstate
-//CHECK-RO: msr MPAMBWIDR_EL1, x0
-//CHECK-RO:     ^
 
-//CHECK: mrs     x0, MPAMBWIDR_EL1               // encoding: [0xa0,0xa4,0x38,0xd5]
-//CHECK: mrs     x0, MPAMBW3_EL3                 // encoding: [0x80,0xa5,0x3e,0xd5]
-//CHECK: mrs     x0, MPAMBW2_EL2                 // encoding: [0x80,0xa5,0x3c,0xd5]
-//CHECK: mrs     x0, MPAMBW1_EL1                 // encoding: [0x80,0xa5,0x38,0xd5]
-//CHECK: mrs     x0, MPAMBW1_EL12                // encoding: [0x80,0xa5,0x3d,0xd5]
-//CHECK: mrs     x0, MPAMBW0_EL1                 // encoding: [0xa0,0xa5,0x38,0xd5]
-//CHECK: mrs     x0, MPAMBWCAP_EL2               // encoding: [0xc0,0xa5,0x3c,0xd5]
-//CHECK: mrs     x0, MPAMBWSM_EL1                // encoding: [0xe0,0xa5,0x38,0xd5]
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.4a-gcs.txt b/llvm/test/MC/Disassembler/AArch64/armv9.4a-gcs.txt
deleted file mode 100644
index 512f4027d9761..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.4a-gcs.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-# RUN: llvm-mc -triple=aarch64 -mattr +gcs -disassemble %s 2> %t | FileCheck %s
-
-[0x00,0x25,0x18,0xd5]
-[0x01,0x25,0x38,0xd5]
-// CHECK: msr     GCSCR_EL1, x0
-// CHECK: mrs     x1, GCSCR_EL1
-
-[0x22,0x25,0x18,0xd5]
-[0x23,0x25,0x38,0xd5]
-// CHECK: msr     GCSPR_EL1, x2
-// CHECK: mrs     x3, GCSPR_EL1
-
-[0x44,0x25,0x18,0xd5]
-[0x45,0x25,0x38,0xd5]
-// CHECK: msr     GCSCRE0_EL1, x4
-// CHECK: mrs     x5, GCSCRE0_EL1
-
-[0x26,0x25,0x1b,0xd5]
-[0x27,0x25,0x3b,0xd5]
-// CHECK: msr     GCSPR_EL0, x6
-// CHECK: mrs     x7, GCSPR_EL0
-
-[0x0a,0x25,0x1c,0xd5]
-[0x0b,0x25,0x3c,0xd5]
-// CHECK: msr     GCSCR_EL2, x10
-// CHECK: mrs     x11, GCSCR_EL2
-
-[0x2c,0x25,0x1c,0xd5]
-[0x2d,0x25,0x3c,0xd5]
-// CHECK: msr     GCSPR_EL2, x12
-// CHECK: mrs     x13, GCSPR_EL2
-
-[0x0e,0x25,0x1d,0xd5]
-[0x0f,0x25,0x3d,0xd5]
-// CHECK: msr     GCSCR_EL12, x14
-// CHECK: mrs     x15, GCSCR_EL12
-
-[0x30,0x25,0x1d,0xd5]
-[0x31,0x25,0x3d,0xd5]
-// CHECK: msr     GCSPR_EL12, x16
-// CHECK: mrs     x17, GCSPR_EL12
-
-[0x12,0x25,0x1e,0xd5]
-[0x13,0x25,0x3e,0xd5]
-// CHECK: msr     GCSCR_EL3, x18
-// CHECK: mrs     x19, GCSCR_EL3
-
-[0x34,0x25,0x1e,0xd5]
-[0x35,0x25,0x3e,0xd5]
-// CHECK: msr     GCSPR_EL3, x20
-// CHECK: mrs     x21, GCSPR_EL3
-
-[0x55,0x77,0x0b,0xd5]
-// CHECK: gcsss1 x21
-
-[0x76,0x77,0x2b,0xd5]
-// CHECK: gcsss2    x22
-
-[0x19,0x77,0x0b,0xd5]
-// CHECK: gcspushm x25
-
-[0x3f,0x77,0x2b,0xd5]
-// CHECK: gcspopm
-
-[0x39,0x77,0x2b,0xd5]
-// CHECK: gcspopm    x25
-
-[0x7f,0x22,0x03,0xd5]
-// CHECK: gcsb    dsync
-
-[0x7a,0x0f,0x1f,0xd9]
-// CHECK: gcsstr   x26, [x27]
-
-[0xfa,0x0f,0x1f,0xd9]
-// CHECK: gcsstr   x26, [sp]
-
-[0x7a,0x1f,0x1f,0xd9]
-// CHECK: gcssttr  x26, [x27]
-
-[0xfa,0x1f,0x1f,0xd9]
-// CHECK: gcssttr  x26, [sp]
-
-[0x9f,0x77,0x08,0xd5]
-// CHECK: gcspushx
-
-[0xbf,0x77,0x08,0xd5]
-// CHECK: gcspopcx
-
-[0xdf,0x77,0x08,0xd5]
-// CHECK: gcspopx
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.4a-lse128.txt b/llvm/test/MC/Disassembler/AArch64/armv9.4a-lse128.txt
deleted file mode 100644
index d4dffa0b3a9b6..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.4a-lse128.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-# RUN: llvm-mc -triple=aarch64 -mattr=+lse128 -disassemble %s | FileCheck %s
-# RUN: not llvm-mc -triple=aarch64 -disassemble %s 2>&1 | FileCheck --check-prefix=NO-LSE128 %s
-
-[0x61,0x11,0x22,0x19]
-# CHECK: ldclrp x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x13,0x36,0x19]
-# CHECK: ldclrp x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0x61,0x11,0xa2,0x19]
-# CHECK: ldclrpa x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x13,0xb6,0x19]
-# CHECK: ldclrpa x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0x61,0x11,0xe2,0x19]
-# CHECK: ldclrpal x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x13,0xf6,0x19]
-# CHECK: ldclrpal x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0x61,0x11,0x62,0x19]
-# CHECK: ldclrpl x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x13,0x76,0x19]
-# CHECK: ldclrpl x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0x61,0x31,0x22,0x19]
-# CHECK: ldsetp x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x33,0x36,0x19]
-# CHECK: ldsetp x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0x61,0x31,0xa2,0x19]
-# CHECK: ldsetpa x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x33,0xb6,0x19]
-# CHECK: ldsetpa x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0x61,0x31,0xe2,0x19]
-# CHECK: ldsetpal x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x33,0xf6,0x19]
-# CHECK: ldsetpal x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0x61,0x31,0x62,0x19]
-# CHECK: ldsetpl x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x33,0x76,0x19]
-# CHECK: ldsetpl x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0x61,0x81,0x22,0x19]
-# CHECK: swpp x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x83,0x36,0x19]
-# CHECK: swpp x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0x61,0x81,0xa2,0x19]
-# CHECK: swppa x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x83,0xb6,0x19]
-# CHECK: swppa x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0x61,0x81,0xe2,0x19]
-# CHECK: swppal x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x83,0xf6,0x19]
-# CHECK: swppal x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0x61,0x81,0x62,0x19]
-# CHECK: swppl x1, x2, [x11]
-# NO-LSE128: warning: invalid instruction encoding
-
-[0xf5,0x83,0x76,0x19]
-# CHECK: swppl x21, x22, [sp]
-# NO-LSE128: warning: invalid instruction encoding
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.5a-cpa.txt b/llvm/test/MC/Disassembler/AArch64/armv9.5a-cpa.txt
deleted file mode 100644
index bf61782f912a3..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.5a-cpa.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-# RUN: llvm-mc -triple aarch64 -disassemble -mattr=+cpa < %s | FileCheck %s
-# RUN: not llvm-mc -triple aarch64 -disassemble < %s 2>&1 | FileCheck --check-prefix=NO-CPA %s
-
-[0x20,0x20,0x02,0x9a]
-# CHECK: addpt x0, x1, x2
-# NO-CPA: warning: invalid instruction encoding
-
-[0xff,0x23,0x02,0x9a]
-# CHECK: addpt sp, sp, x2
-# NO-CPA: warning: invalid instruction encoding
-
-[0x20,0x3c,0x02,0x9a]
-# CHECK: addpt x0, x1, x2, lsl #7
-# NO-CPA: warning: invalid instruction encoding
-
-[0xff,0x3f,0x02,0x9a]
-# CHECK: addpt sp, sp, x2, lsl #7
-# NO-CPA: warning: invalid instruction encoding
-
-[0x20,0x20,0x02,0xda]
-# CHECK: subpt x0, x1, x2
-# NO-CPA: warning: invalid instruction encoding
-
-[0xff,0x23,0x02,0xda]
-# CHECK: subpt sp, sp, x2
-# NO-CPA: warning: invalid instruction encoding
-
-[0x20,0x3c,0x02,0xda]
-# CHECK: subpt x0, x1, x2, lsl #7
-# NO-CPA: warning: invalid instruction encoding
-
-[0xff,0x3f,0x02,0xda]
-# CHECK: subpt sp, sp, x2, lsl #7
-# NO-CPA: warning: invalid instruction encoding
-
-[0x20,0x0c,0x62,0x9b]
-# CHECK: maddpt x0, x1, x2, x3
-# NO-CPA: warning: invalid instruction encoding
-
-[0x20,0x8c,0x62,0x9b]
-# CHECK: msubpt x0, x1, x2, x3
-# NO-CPA: warning: invalid instruction encoding
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9.6a-mpam.txt b/llvm/test/MC/Disassembler/AArch64/armv9.6a-mpam.txt
deleted file mode 100644
index b9ff0a4d209b2..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9.6a-mpam.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-# RUN: llvm-mc -triple aarch64 -disassemble < %s | FileCheck %s
-
-#------------------------------------------------------------------------------
-# Armv9.6-A FEAT_MPAM Extensions
-#------------------------------------------------------------------------------
-
-[0x80,0xa5,0x1e,0xd5]
-# CHECK: msr MPAMBW3_EL3, x0
-
-[0x80,0xa5,0x1c,0xd5]
-# CHECK: msr MPAMBW2_EL2, x0
-
-[0x80,0xa5,0x18,0xd5]
-# CHECK: msr MPAMBW1_EL1, x0
-
-[0x80,0xa5,0x1d,0xd5]
-# CHECK: msr MPAMBW1_EL12, x0
-
-[0xa0,0xa5,0x18,0xd5]
-# CHECK: msr MPAMBW0_EL1, x0
-
-[0xc0,0xa5,0x1c,0xd5]
-# CHECK: msr MPAMBWCAP_EL2, x0
-
-[0xe0,0xa5,0x18,0xd5]
-# CHECK: msr MPAMBWSM_EL1, x0
-
-[0xa0,0xa4,0x38,0xd5]
-# CHECK: mrs x0, MPAMBWIDR_EL1
-
-[0x80,0xa5,0x3e,0xd5]
-# CHECK: mrs x0, MPAMBW3_EL3
-
-[0x80,0xa5,0x3c,0xd5]
-# CHECK: mrs x0, MPAMBW2_EL2
-
-[0x80,0xa5,0x38,0xd5]
-# CHECK: mrs x0, MPAMBW1_EL1
-
-[0x80,0xa5,0x3d,0xd5]
-# CHECK: mrs x0, MPAMBW1_EL12
-
-[0xa0,0xa5,0x38,0xd5]
-# CHECK: mrs x0, MPAMBW0_EL1
-
-[0xc0,0xa5,0x3c,0xd5]
-# CHECK: mrs x0, MPAMBWCAP_EL2
-
-[0xe0,0xa5,0x38,0xd5]
-# CHECK: mrs x0, MPAMBWSM_EL1
diff --git a/llvm/test/MC/Disassembler/AArch64/armv9a-mec.txt b/llvm/test/MC/Disassembler/AArch64/armv9a-mec.txt
deleted file mode 100644
index c5d931d46ca6d..0000000000000
--- a/llvm/test/MC/Disassembler/AArch64/armv9a-mec.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-# RUN: llvm-mc -triple=aarch64 -mattr=+mec -disassemble %s      | FileCheck %s
-# RUN: llvm-mc -triple=aarch64             -disassemble %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-MEC
-
-[0xe0,0xa8,0x3c,0xd5]
-# CHECK: mrs x0, MECIDR_EL2
-# CHECK-NO-MEC: mrs x0, S3_4_C10_C8_7
-[0x00,0xa8,0x3c,0xd5]
-# CHECK: mrs x0, MECID_P0_EL2
-# CHECK-NO-MEC: mrs x0, S3_4_C10_C8_0
-[0x20,0xa8,0x3c,0xd5]
-# CHECK: mrs x0, MECID_A0_EL2
-# CHECK-NO-MEC: mrs x0, S3_4_C10_C8_1
-[0x40,0xa8,0x3c,0xd5]
-# CHECK: mrs x0, MECID_P1_EL2
-# CHECK-NO-MEC: mrs x0, S3_4_C10_C8_2
-[0x60,0xa8,0x3c,0xd5]
-# CHECK: mrs x0, MECID_A1_EL2
-# CHECK-NO-MEC: mrs x0, S3_4_C10_C8_3
-[0x00,0xa9,0x3c,0xd5]
-# CHECK: mrs x0, VMECID_P_EL2
-# CHECK-NO-MEC: mrs x0, S3_4_C10_C9_0
-[0x20,0xa9,0x3c,0xd5]
-# CHECK: mrs x0, VMECID_A_EL2
-# CHECK-NO-MEC: mrs x0, S3_4_C10_C9_1
-[0x20,0xaa,0x3e,0xd5]
-# CHECK: mrs x0, MECID_RL_A_EL3
-# CHECK-NO-MEC: mrs x0, S3_6_C10_C10_1
-[0x00,0xa8,0x1c,0xd5]
-# CHECK: msr MECID_P0_EL2,    x0
-# CHECK-NO-MEC: msr S3_4_C10_C8_0, x0
-[0x20,0xa8,0x1c,0xd5]
-# CHECK: msr MECID_A0_EL2,    x0
-# CHECK-NO-MEC: msr S3_4_C10_C8_1, x0
-[0x40,0xa8,0x1c,0xd5]
-# CHECK: msr MECID_P1_EL2,    x0
-# CHECK-NO-MEC: msr S3_4_C10_C8_2, x0
-[0x60,0xa8,0x1c,0xd5]
-# CHECK: msr MECID_A1_EL2,    x0
-# CHECK-NO-MEC: msr S3_4_C10_C8_3, x0
-[0x00,0xa9,0x1c,0xd5]
-# CHECK: msr VMECID_P_EL2,   x0
-# CHECK-NO-MEC: msr S3_4_C10_C9_0, x0
-[0x20,0xa9,0x1c,0xd5]
-# CHECK: msr VMECID_A_EL2,   x0
-# CHECK-NO-MEC: msr S3_4_C10_C9_1, x0
-[0x20,0xaa,0x1e,0xd5]
-# CHECK: msr MECID_RL_A_EL3, x0
-# CHECK-NO-MEC: msr S3_6_C10_C10_1, x0
-[0xe0,0x7e,0x0c,0xd5]
-# CHECK: dc cigdpae, x0
-# CHECK-NO-MEC: sys #4, c7, c14, #7, x0
-[0x00,0x7e,0x0c,0xd5]
-# CHECK: dc cipae, x0
-# CHECK-NO-MEC: sys #4, c7, c14, #0, x0

>From 9b48b94f62e8d690749df65a843fd2e4eb8732f0 Mon Sep 17 00:00:00 2001
From: Jonathan Thackray <jonathan.thackray at arm.com>
Date: Mon, 30 Jun 2025 16:51:51 +0100
Subject: [PATCH 3/3] fixup! [AArch64][llvm] Unify AArch64 tests into a single
 file (2/4) (NFC)

This is a series of patches (2/4) to unify assembly/disassembly of
recent AArch64 tests into a single file. The aim is to improve
consistency, so that all instructions and system registers are
thoroughly tested, and future test cases will be in a unified format.

This patch:
 * removes .txt tests which have only one feature required
 * makes the .s tests have a roundabout run line to test both encoding and assembly
 * creates diagnostic tests when needed
 * fixes naming convention of tests

Co-authored-by: Virginia Cangelosi <virginia.cangelosi at arm.com>
---
 llvm/test/MC/AArch64/armv9.2a-mec.s           | 16 +++++++++++--
 llvm/test/MC/AArch64/armv9.4a-gcs.s           |  6 +++--
 .../MC/AArch64/armv9.4a-lse128-diagnostics.s  |  3 +++
 llvm/test/MC/AArch64/armv9.4a-lse128.s        | 23 ++++++++++++++++++-
 llvm/test/MC/AArch64/armv9.5a-cpa.s           |  2 +-
 llvm/test/MC/AArch64/armv9.6a-mpam.s          | 15 +++++++++++-
 6 files changed, 58 insertions(+), 7 deletions(-)

diff --git a/llvm/test/MC/AArch64/armv9.2a-mec.s b/llvm/test/MC/AArch64/armv9.2a-mec.s
index c747886f7ec3b..1998b43d336ec 100644
--- a/llvm/test/MC/AArch64/armv9.2a-mec.s
+++ b/llvm/test/MC/AArch64/armv9.2a-mec.s
@@ -5,13 +5,13 @@
 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+mec < %s \
 // RUN:        | llvm-objdump -d --mattr=+mec --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+mec < %s \
-// RUN:   | llvm-objdump -d --mattr=-mec --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// RUN:        | llvm-objdump -d --mattr=-mec --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
 // Disassemble encoding and check the re-encoding (-show-encoding) matches.
 // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+mec < %s \
 // RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
 // RUN:        | llvm-mc -triple=aarch64 -mattr=+mec -disassemble -show-encoding \
 // RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
-
+// RUN: llvm-mc -triple aarch64 -disassemble < %s 2>&1 | FileCheck --check-prefix=CHECK-NO-MEC %s
 
 
 mrs x0, MECIDR_EL2
@@ -109,9 +109,21 @@ dc cigdpae, x0
 // CHECK-ENCODING: encoding: [0xe0,0x7e,0x0c,0xd5]
 // CHECK-ERROR: :[[@LINE-3]]:4: error: DC CIGDPAE requires: mec
 // CHECK-UNKNOWN:  d50c7ee0 sys #4, c7, c14, #7, x0
+// CHECK-NO-MEC: sys #4, c7, c14, #7, x0
 
 dc cipae, x0
 // CHECK-INST: dc cipae, x0
 // CHECK-ENCODING: encoding: [0x00,0x7e,0x0c,0xd5]
 // CHECK-ERROR: :[[@LINE-3]]:4: error: DC CIPAE requires: mec
 // CHECK-UNKNOWN:  d50c7e00 sys #4, c7, c14, #0, x0
+// CHECK-NO-MEC: sys #4, c7, c14, #0, x0
+
+sys #4, c7, c14, #7, x0
+// CHECK-INST: dc cigdpae, x0
+// CHECK-ENCODING: encoding: [0xe0,0x7e,0x0c,0xd5]
+// CHECK-UNKNOWN:  d50c7ee0 sys #4, c7, c14, #7, x0
+
+sys #4, c7, c14, #0, x0
+// CHECK-INST: dc cipae, x0
+// CHECK-ENCODING: encoding: [0x00,0x7e,0x0c,0xd5]
+// CHECK-UNKNOWN:  d50c7e00 sys #4, c7, c14, #0, x0
diff --git a/llvm/test/MC/AArch64/armv9.4a-gcs.s b/llvm/test/MC/AArch64/armv9.4a-gcs.s
index d6ac23dc2174d..1b1856d6b4f32 100644
--- a/llvm/test/MC/AArch64/armv9.4a-gcs.s
+++ b/llvm/test/MC/AArch64/armv9.4a-gcs.s
@@ -5,13 +5,13 @@
 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+gcs < %s \
 // RUN:        | llvm-objdump -d --mattr=+gcs --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-INST
 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+gcs < %s \
-// RUN:   | llvm-objdump -d --mattr=-gcs --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// RUN:        | llvm-objdump -d --mattr=-gcs --no-print-imm-hex - | FileCheck %s --check-prefix=CHECK-UNKNOWN
 // Disassemble encoding and check the re-encoding (-show-encoding) matches.
 // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+gcs < %s \
 // RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
 // RUN:        | llvm-mc -triple=aarch64 -mattr=+gcs -disassemble -show-encoding \
 // RUN:        | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
-
+// RUN: not llvm-mc -triple aarch64 -show-encoding %s 2>%t | FileCheck %s --check-prefix=NO-GCS
 
 
 msr GCSCR_EL1, x0
@@ -154,11 +154,13 @@ gcsb dsync
 // CHECK-INST: gcsb dsync
 // CHECK-ENCODING: encoding: [0x7f,0x22,0x03,0xd5]
 // CHECK-UNKNOWN:  d503227f hint #19
+// NO-GCS: hint #19                              // encoding: [0x7f,0x22,0x03,0xd5]
 
 hint #19
 // CHECK-INST: gcsb dsync
 // CHECK-ENCODING: encoding: [0x7f,0x22,0x03,0xd5]
 // CHECK-UNKNOWN:  d503227f hint #19
+// NO-GCS: hint #19                              // encoding: [0x7f,0x22,0x03,0xd5]
 
 gcsstr x26, [x27]
 // CHECK-INST: gcsstr x26, [x27]
diff --git a/llvm/test/MC/AArch64/armv9.4a-lse128-diagnostics.s b/llvm/test/MC/AArch64/armv9.4a-lse128-diagnostics.s
index 3ff3a98088f1e..059b18f1e9153 100644
--- a/llvm/test/MC/AArch64/armv9.4a-lse128-diagnostics.s
+++ b/llvm/test/MC/AArch64/armv9.4a-lse128-diagnostics.s
@@ -3,15 +3,18 @@
 
 ldclrpl  x22, xzr, [sp]
 // CHECK-ERROR: error: invalid operand for instruction
+
 ldclrpl  xzr, x22, [sp]
 // CHECK-ERROR: error: invalid operand for instruction
 
 ldsetpl  x22, xzr, [sp]
 // CHECK-ERROR: error: invalid operand for instruction
+
 ldsetpl  xzr, x22, [sp]
 // CHECK-ERROR: error: invalid operand for instruction
 
 swppl    x22, xzr, [sp]
 // CHECK-ERROR: error: invalid operand for instruction
+
 swppl    xzr, x22, [sp]
 // CHECK-ERROR: error: invalid operand for instruction
diff --git a/llvm/test/MC/AArch64/armv9.4a-lse128.s b/llvm/test/MC/AArch64/armv9.4a-lse128.s
index 856ca19164a75..25dcb04c2ae63 100644
--- a/llvm/test/MC/AArch64/armv9.4a-lse128.s
+++ b/llvm/test/MC/AArch64/armv9.4a-lse128.s
@@ -5,7 +5,7 @@
 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+lse128 < %s \
 // RUN:        | llvm-objdump -d --mattr=+lse128 - | FileCheck %s --check-prefix=CHECK-INST
 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+lse128 < %s \
-// RUN:   | llvm-objdump -d --mattr=-lse128 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// RUN:        | llvm-objdump -d --mattr=-lse128 - | FileCheck %s --check-prefix=CHECK-UNKNOWN
 // Disassemble encoding and check the re-encoding (-show-encoding) matches.
 // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+lse128 < %s \
 // RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
@@ -19,36 +19,43 @@ ldclrp   x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x11,0x22,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19221161 <unknown>
+
 ldclrp   x21, x22, [sp]
 // CHECK-INST: ldclrp x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x13,0x36,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  193613f5 <unknown>
+
 ldclrpa  x1, x2, [x11]
 // CHECK-INST: ldclrpa x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x11,0xa2,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19a21161 <unknown>
+
 ldclrpa  x21, x22, [sp]
 // CHECK-INST: ldclrpa x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x13,0xb6,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19b613f5 <unknown>
+
 ldclrpal x1, x2, [x11]
 // CHECK-INST: ldclrpal x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x11,0xe2,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19e21161 <unknown>
+
 ldclrpal x21, x22, [sp]
 // CHECK-INST: ldclrpal x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x13,0xf6,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19f613f5 <unknown>
+
 ldclrpl  x1, x2, [x11]
 // CHECK-INST: ldclrpl x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x11,0x62,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19621161 <unknown>
+
 ldclrpl  x21, x22, [sp]
 // CHECK-INST: ldclrpl x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x13,0x76,0x19]
@@ -60,36 +67,43 @@ ldsetp   x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x31,0x22,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19223161 <unknown>
+
 ldsetp   x21, x22, [sp]
 // CHECK-INST: ldsetp x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x33,0x36,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  193633f5 <unknown>
+
 ldsetpa  x1, x2, [x11]
 // CHECK-INST: ldsetpa x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x31,0xa2,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19a23161 <unknown>
+
 ldsetpa  x21, x22, [sp]
 // CHECK-INST: ldsetpa x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x33,0xb6,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19b633f5 <unknown>
+
 ldsetpal x1, x2, [x11]
 // CHECK-INST: ldsetpal x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x31,0xe2,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19e23161 <unknown>
+
 ldsetpal x21, x22, [sp]
 // CHECK-INST: ldsetpal x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x33,0xf6,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19f633f5 <unknown>
+
 ldsetpl  x1, x2, [x11]
 // CHECK-INST: ldsetpl x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x31,0x62,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19623161 <unknown>
+
 ldsetpl  x21, x22, [sp]
 // CHECK-INST: ldsetpl x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x33,0x76,0x19]
@@ -101,36 +115,43 @@ swpp     x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x81,0x22,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19228161 <unknown>
+
 swpp     x21, x22, [sp]
 // CHECK-INST: swpp x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x83,0x36,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  193683f5 <unknown>
+
 swppa    x1, x2, [x11]
 // CHECK-INST: swppa x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x81,0xa2,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19a28161 <unknown>
+
 swppa    x21, x22, [sp]
 // CHECK-INST: swppa x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x83,0xb6,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19b683f5 <unknown>
+
 swppal   x1, x2, [x11]
 // CHECK-INST: swppal x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x81,0xe2,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19e28161 <unknown>
+
 swppal   x21, x22, [sp]
 // CHECK-INST: swppal x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x83,0xf6,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19f683f5 <unknown>
+
 swppl    x1, x2, [x11]
 // CHECK-INST: swppl x1, x2, [x11]
 // CHECK-ENCODING: encoding: [0x61,0x81,0x62,0x19]
 // CHECK-ERROR: :[[@LINE-3]]:1: error: instruction requires: lse128
 // CHECK-UNKNOWN:  19628161 <unknown>
+
 swppl    x21, x22, [sp]
 // CHECK-INST: swppl x21, x22, [sp]
 // CHECK-ENCODING: encoding: [0xf5,0x83,0x76,0x19]
diff --git a/llvm/test/MC/AArch64/armv9.5a-cpa.s b/llvm/test/MC/AArch64/armv9.5a-cpa.s
index c106dea322293..d239224b502fe 100644
--- a/llvm/test/MC/AArch64/armv9.5a-cpa.s
+++ b/llvm/test/MC/AArch64/armv9.5a-cpa.s
@@ -5,7 +5,7 @@
 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+cpa < %s \
 // RUN:        | llvm-objdump -d --mattr=+cpa - | FileCheck %s --check-prefix=CHECK-INST
 // RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+cpa < %s \
-// RUN:   | llvm-objdump -d --mattr=-cpa - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// RUN:        | llvm-objdump -d --mattr=-cpa - | FileCheck %s --check-prefix=CHECK-UNKNOWN
 // Disassemble encoding and check the re-encoding (-show-encoding) matches.
 // RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+cpa < %s \
 // RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
diff --git a/llvm/test/MC/AArch64/armv9.6a-mpam.s b/llvm/test/MC/AArch64/armv9.6a-mpam.s
index 0201365f15fb8..82603caed5545 100644
--- a/llvm/test/MC/AArch64/armv9.6a-mpam.s
+++ b/llvm/test/MC/AArch64/armv9.6a-mpam.s
@@ -3,7 +3,7 @@
 // RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
 // RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-INST
 // RUN: llvm-mc -triple=aarch64 -filetype=obj < %s \
-// RUN:   | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
+// RUN:        | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
 // Disassemble encoding and check the re-encoding (-show-encoding) matches.
 // RUN: llvm-mc -triple=aarch64 -show-encoding < %s \
 // RUN:        | sed '/.text/d' | sed 's/.*encoding: //g' \
@@ -20,26 +20,32 @@ msr MPAMBW3_EL3, x0
 // CHECK-INST: msr MPAMBW3_EL3, x0
 // CHECK-ENCODING: encoding: [0x80,0xa5,0x1e,0xd5]
 // CHECK-UNKNOWN:  d51ea580 msr MPAMBW3_EL3, x0
+
 msr MPAMBW2_EL2, x0
 // CHECK-INST: msr MPAMBW2_EL2, x0
 // CHECK-ENCODING: encoding: [0x80,0xa5,0x1c,0xd5]
 // CHECK-UNKNOWN:  d51ca580 msr MPAMBW2_EL2, x0
+
 msr MPAMBW1_EL1, x0
 // CHECK-INST: msr MPAMBW1_EL1, x0
 // CHECK-ENCODING: encoding: [0x80,0xa5,0x18,0xd5]
 // CHECK-UNKNOWN:  d518a580 msr MPAMBW1_EL1, x0
+
 msr MPAMBW1_EL12, x0
 // CHECK-INST: msr MPAMBW1_EL12, x0
 // CHECK-ENCODING: encoding: [0x80,0xa5,0x1d,0xd5]
 // CHECK-UNKNOWN:  d51da580 msr MPAMBW1_EL12, x0
+
 msr MPAMBW0_EL1, x0
 // CHECK-INST: msr MPAMBW0_EL1, x0
 // CHECK-ENCODING: encoding: [0xa0,0xa5,0x18,0xd5]
 // CHECK-UNKNOWN:  d518a5a0 msr MPAMBW0_EL1, x0
+
 msr MPAMBWCAP_EL2, x0
 // CHECK-INST: msr MPAMBWCAP_EL2, x0
 // CHECK-ENCODING: encoding: [0xc0,0xa5,0x1c,0xd5]
 // CHECK-UNKNOWN:  d51ca5c0 msr MPAMBWCAP_EL2, x0
+
 msr MPAMBWSM_EL1, x0
 // CHECK-INST: msr MPAMBWSM_EL1, x0
 // CHECK-ENCODING: encoding: [0xe0,0xa5,0x18,0xd5]
@@ -49,30 +55,37 @@ mrs x0, MPAMBWIDR_EL1
 // CHECK-INST: mrs x0, MPAMBWIDR_EL1
 // CHECK-ENCODING: encoding: [0xa0,0xa4,0x38,0xd5]
 // CHECK-UNKNOWN:  d538a4a0 mrs x0, MPAMBWIDR_EL1
+
 mrs x0, MPAMBW3_EL3
 // CHECK-INST: mrs x0, MPAMBW3_EL3
 // CHECK-ENCODING: encoding: [0x80,0xa5,0x3e,0xd5]
 // CHECK-UNKNOWN:  d53ea580 mrs x0, MPAMBW3_EL3
+
 mrs x0, MPAMBW2_EL2
 // CHECK-INST: mrs x0, MPAMBW2_EL2
 // CHECK-ENCODING: encoding: [0x80,0xa5,0x3c,0xd5]
 // CHECK-UNKNOWN:  d53ca580 mrs x0, MPAMBW2_EL2
+
 mrs x0, MPAMBW1_EL1
 // CHECK-INST: mrs x0, MPAMBW1_EL1
 // CHECK-ENCODING: encoding: [0x80,0xa5,0x38,0xd5]
 // CHECK-UNKNOWN:  d538a580 mrs x0, MPAMBW1_EL1
+
 mrs x0, MPAMBW1_EL12
 // CHECK-INST: mrs x0, MPAMBW1_EL12
 // CHECK-ENCODING: encoding: [0x80,0xa5,0x3d,0xd5]
 // CHECK-UNKNOWN:  d53da580 mrs x0, MPAMBW1_EL12
+
 mrs x0, MPAMBW0_EL1
 // CHECK-INST: mrs x0, MPAMBW0_EL1
 // CHECK-ENCODING: encoding: [0xa0,0xa5,0x38,0xd5]
 // CHECK-UNKNOWN:  d538a5a0 mrs x0, MPAMBW0_EL1
+
 mrs x0, MPAMBWCAP_EL2
 // CHECK-INST: mrs x0, MPAMBWCAP_EL2
 // CHECK-ENCODING: encoding: [0xc0,0xa5,0x3c,0xd5]
 // CHECK-UNKNOWN:  d53ca5c0 mrs x0, MPAMBWCAP_EL2
+
 mrs x0, MPAMBWSM_EL1
 // CHECK-INST: mrs x0, MPAMBWSM_EL1
 // CHECK-ENCODING: encoding: [0xe0,0xa5,0x38,0xd5]



More information about the llvm-branch-commits mailing list