[llvm] [NFC][X86] Reorg MC tests for APX promoted instrs (PR #76697)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 00:00:44 PST 2024


https://github.com/XinWang10 updated https://github.com/llvm/llvm-project/pull/76697

>From 6167ca084837c43d2d087ef0e601c42ec17616eb Mon Sep 17 00:00:00 2001
From: "Wang, Xin10" <xin10.wang at intel.com>
Date: Mon, 1 Jan 2024 22:16:18 -0800
Subject: [PATCH 1/2] [NFC][X86] Reorg MC tests for APX promoted instrs

---
 llvm/lib/Target/X86/X86InstrMisc.td           |   4 +-
 llvm/lib/Target/X86/X86InstrShiftRotate.td    |   2 +-
 llvm/test/MC/Disassembler/X86/apx/bmi2.txt    | 226 +++++++++++++++++
 llvm/test/MC/Disassembler/X86/apx/cet.txt     |  34 +++
 llvm/test/MC/Disassembler/X86/apx/invept.txt  |   6 -
 llvm/test/MC/Disassembler/X86/apx/invvpid.txt |   6 -
 .../MC/Disassembler/X86/apx/movdir64b.txt     |   8 +
 llvm/test/MC/Disassembler/X86/apx/movdiri.txt |   8 +
 llvm/test/MC/Disassembler/X86/apx/sha.txt     | 110 +++++++++
 .../test/MC/Disassembler/X86/apx/sha1msg1.txt |  10 -
 .../test/MC/Disassembler/X86/apx/sha1msg2.txt |  10 -
 .../MC/Disassembler/X86/apx/sha1nexte.txt     |  10 -
 .../MC/Disassembler/X86/apx/sha1rnds4.txt     |  10 -
 .../MC/Disassembler/X86/apx/sha256msg1.txt    |  10 -
 .../MC/Disassembler/X86/apx/sha256msg2.txt    |  10 -
 .../MC/Disassembler/X86/apx/sha256rnds2.txt   |  10 -
 llvm/test/MC/Disassembler/X86/apx/vmx.txt     |  18 ++
 llvm/test/MC/Disassembler/X86/apx/wrssd.txt   |   6 -
 llvm/test/MC/Disassembler/X86/apx/wrssq.txt   |   6 -
 llvm/test/MC/Disassembler/X86/apx/wrussd.txt  |   6 -
 llvm/test/MC/Disassembler/X86/apx/wrussq.txt  |   6 -
 llvm/test/MC/X86/apx/bmi2-att.s               | 228 ++++++++++++++++++
 llvm/test/MC/X86/apx/bmi2-intel.s             | 225 +++++++++++++++++
 llvm/test/MC/X86/apx/cet-att.s                |  36 +++
 llvm/test/MC/X86/apx/cet-intel.s              |  33 +++
 llvm/test/MC/X86/apx/invept-att.s             |   8 -
 llvm/test/MC/X86/apx/invept-intel.s           |   5 -
 llvm/test/MC/X86/apx/invvpid-att.s            |   9 -
 llvm/test/MC/X86/apx/invvpid-intel.s          |   5 -
 llvm/test/MC/X86/apx/movdir64b-att.s          |  10 +-
 llvm/test/MC/X86/apx/movdir64b-intel.s        |   8 +
 llvm/test/MC/X86/apx/movdiri-att.s            |  10 +-
 llvm/test/MC/X86/apx/movdiri-intel.s          |   8 +
 llvm/test/MC/X86/apx/mulx-att.s               |  20 --
 llvm/test/MC/X86/apx/mulx-intel.s             |  17 --
 llvm/test/MC/X86/apx/pdep-att.s               |  20 --
 llvm/test/MC/X86/apx/pdep-intel.s             |  17 --
 llvm/test/MC/X86/apx/pext-att.s               |  20 --
 llvm/test/MC/X86/apx/pext-intel.s             |  17 --
 llvm/test/MC/X86/apx/rorx-att.s               |  20 --
 llvm/test/MC/X86/apx/rorx-intel.s             |  17 --
 llvm/test/MC/X86/apx/sarx-att.s               |  20 --
 llvm/test/MC/X86/apx/sarx-intel.s             |  17 --
 llvm/test/MC/X86/apx/sha-att.s                | 112 +++++++++
 llvm/test/MC/X86/apx/sha-intel.s              | 109 +++++++++
 llvm/test/MC/X86/apx/sha1msg1-att.s           |   9 -
 llvm/test/MC/X86/apx/sha1msg1-intel.s         |   9 -
 llvm/test/MC/X86/apx/sha1msg2-att.s           |   9 -
 llvm/test/MC/X86/apx/sha1msg2-intel.s         |   9 -
 llvm/test/MC/X86/apx/sha1nexte-att.s          |   9 -
 llvm/test/MC/X86/apx/sha1nexte-intel.s        |   9 -
 llvm/test/MC/X86/apx/sha1rnds4-att.s          |   9 -
 llvm/test/MC/X86/apx/sha1rnds4-intel.s        |   9 -
 llvm/test/MC/X86/apx/sha256msg1-att.s         |   9 -
 llvm/test/MC/X86/apx/sha256msg1-intel.s       |   9 -
 llvm/test/MC/X86/apx/sha256msg2-att.s         |   9 -
 llvm/test/MC/X86/apx/sha256msg2-intel.s       |   9 -
 llvm/test/MC/X86/apx/sha256rnds2-att.s        |  13 -
 llvm/test/MC/X86/apx/sha256rnds2-intel.s      |  14 --
 llvm/test/MC/X86/apx/shlx-att.s               |  20 --
 llvm/test/MC/X86/apx/shlx-intel.s             |  17 --
 llvm/test/MC/X86/apx/shrx-att.s               |  20 --
 llvm/test/MC/X86/apx/shrx-intel.s             |  17 --
 llvm/test/MC/X86/apx/vmx-att.s                |  20 ++
 llvm/test/MC/X86/apx/vmx-intel.s              |  17 ++
 llvm/test/MC/X86/apx/wrssd-att.s              |   8 -
 llvm/test/MC/X86/apx/wrssd-intel.s            |   5 -
 llvm/test/MC/X86/apx/wrssq-att.s              |   8 -
 llvm/test/MC/X86/apx/wrssq-intel.s            |   5 -
 llvm/test/MC/X86/apx/wrussd-att.s             |   8 -
 llvm/test/MC/X86/apx/wrussd-intel.s           |   5 -
 llvm/test/MC/X86/apx/wrussq-att.s             |   8 -
 llvm/test/MC/X86/apx/wrussq-intel.s           |   5 -
 73 files changed, 1221 insertions(+), 584 deletions(-)
 create mode 100644 llvm/test/MC/Disassembler/X86/apx/bmi2.txt
 create mode 100644 llvm/test/MC/Disassembler/X86/apx/cet.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/invept.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/invvpid.txt
 create mode 100644 llvm/test/MC/Disassembler/X86/apx/sha.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/sha1msg1.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/sha1msg2.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/sha1nexte.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/sha1rnds4.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/sha256msg1.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/sha256msg2.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/sha256rnds2.txt
 create mode 100644 llvm/test/MC/Disassembler/X86/apx/vmx.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/wrssd.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/wrssq.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/wrussd.txt
 delete mode 100644 llvm/test/MC/Disassembler/X86/apx/wrussq.txt
 create mode 100644 llvm/test/MC/X86/apx/bmi2-att.s
 create mode 100644 llvm/test/MC/X86/apx/bmi2-intel.s
 create mode 100644 llvm/test/MC/X86/apx/cet-att.s
 create mode 100644 llvm/test/MC/X86/apx/cet-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/invept-att.s
 delete mode 100644 llvm/test/MC/X86/apx/invept-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/invvpid-att.s
 delete mode 100644 llvm/test/MC/X86/apx/invvpid-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/mulx-att.s
 delete mode 100644 llvm/test/MC/X86/apx/mulx-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/pdep-att.s
 delete mode 100644 llvm/test/MC/X86/apx/pdep-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/pext-att.s
 delete mode 100644 llvm/test/MC/X86/apx/pext-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/rorx-att.s
 delete mode 100644 llvm/test/MC/X86/apx/rorx-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/sarx-att.s
 delete mode 100644 llvm/test/MC/X86/apx/sarx-intel.s
 create mode 100644 llvm/test/MC/X86/apx/sha-att.s
 create mode 100644 llvm/test/MC/X86/apx/sha-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/sha1msg1-att.s
 delete mode 100644 llvm/test/MC/X86/apx/sha1msg1-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/sha1msg2-att.s
 delete mode 100644 llvm/test/MC/X86/apx/sha1msg2-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/sha1nexte-att.s
 delete mode 100644 llvm/test/MC/X86/apx/sha1nexte-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/sha1rnds4-att.s
 delete mode 100644 llvm/test/MC/X86/apx/sha1rnds4-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/sha256msg1-att.s
 delete mode 100644 llvm/test/MC/X86/apx/sha256msg1-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/sha256msg2-att.s
 delete mode 100644 llvm/test/MC/X86/apx/sha256msg2-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/sha256rnds2-att.s
 delete mode 100644 llvm/test/MC/X86/apx/sha256rnds2-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/shlx-att.s
 delete mode 100644 llvm/test/MC/X86/apx/shlx-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/shrx-att.s
 delete mode 100644 llvm/test/MC/X86/apx/shrx-intel.s
 create mode 100644 llvm/test/MC/X86/apx/vmx-att.s
 create mode 100644 llvm/test/MC/X86/apx/vmx-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/wrssd-att.s
 delete mode 100644 llvm/test/MC/X86/apx/wrssd-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/wrssq-att.s
 delete mode 100644 llvm/test/MC/X86/apx/wrssq-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/wrussd-att.s
 delete mode 100644 llvm/test/MC/X86/apx/wrussd-intel.s
 delete mode 100644 llvm/test/MC/X86/apx/wrussq-att.s
 delete mode 100644 llvm/test/MC/X86/apx/wrussq-intel.s

diff --git a/llvm/lib/Target/X86/X86InstrMisc.td b/llvm/lib/Target/X86/X86InstrMisc.td
index 305bd74f7bd70a..67c38bfc7ba41e 100644
--- a/llvm/lib/Target/X86/X86InstrMisc.td
+++ b/llvm/lib/Target/X86/X86InstrMisc.td
@@ -1371,11 +1371,11 @@ multiclass bmi_pdep_pext<string mnemonic, RegisterClass RC,
   def rr#Suffix : I<0xF5, MRMSrcReg, (outs RC:$dst), (ins RC:$src1, RC:$src2),
                     !strconcat(mnemonic, "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
                     [(set RC:$dst, (OpNode RC:$src1, RC:$src2))]>,
-                  VEX, VVVV, Sched<[WriteALU]>;
+                  VEX, NoCD8, VVVV, Sched<[WriteALU]>;
   def rm#Suffix : I<0xF5, MRMSrcMem, (outs RC:$dst), (ins RC:$src1, x86memop:$src2),
                     !strconcat(mnemonic, "\t{$src2, $src1, $dst|$dst, $src1, $src2}"),
                     [(set RC:$dst, (OpNode RC:$src1, (ld_frag addr:$src2)))]>,
-                  VEX, VVVV, Sched<[WriteALU.Folded, WriteALU.ReadAfterFold]>;
+                  VEX, NoCD8, VVVV, Sched<[WriteALU.Folded, WriteALU.ReadAfterFold]>;
 }
 
 let Predicates = [HasBMI2, NoEGPR] in {
diff --git a/llvm/lib/Target/X86/X86InstrShiftRotate.td b/llvm/lib/Target/X86/X86InstrShiftRotate.td
index d13e3b7af69a95..f951894db1890c 100644
--- a/llvm/lib/Target/X86/X86InstrShiftRotate.td
+++ b/llvm/lib/Target/X86/X86InstrShiftRotate.td
@@ -868,7 +868,7 @@ let Predicates = [HasBMI2, NoEGPR] in {
   defm SHLX64 : bmi_shift<"shlx{q}", GR64, i64mem>, T8, PD, REX_W;
 }
 
-let Predicates = [HasBMI2, HasEGPR] in {
+let Predicates = [HasBMI2, HasEGPR, In64BitMode] in {
   defm RORX32 : bmi_rotate<"rorx{l}", GR32, i32mem, "_EVEX">, EVEX;
   defm RORX64 : bmi_rotate<"rorx{q}", GR64, i64mem, "_EVEX">, REX_W, EVEX;
   defm SARX32 : bmi_shift<"sarx{l}", GR32, i32mem, "_EVEX">, T8, XS, EVEX;
diff --git a/llvm/test/MC/Disassembler/X86/apx/bmi2.txt b/llvm/test/MC/Disassembler/X86/apx/bmi2.txt
new file mode 100644
index 00000000000000..6c39ae2e67005f
--- /dev/null
+++ b/llvm/test/MC/Disassembler/X86/apx/bmi2.txt
@@ -0,0 +1,226 @@
+# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
+# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
+
+# ATT:   mulxl	%ecx, %edx, %r10d
+# INTEL: mulx	r10d, edx, ecx
+0x62,0x72,0x6f,0x08,0xf6,0xd1
+
+# ATT:   mulxq	%r9, %r15, %r11
+# INTEL: mulx	r11, r15, r9
+0x62,0x52,0x87,0x08,0xf6,0xd9
+
+# ATT:   mulxl	123(%rax,%rbx,4), %ecx, %edx
+# INTEL: mulx	edx, ecx, dword ptr [rax + 4*rbx + 123]
+0x62,0xf2,0x77,0x08,0xf6,0x94,0x98,0x7b,0x00,0x00,0x00
+
+# ATT:   mulxq	123(%rax,%rbx,4), %r9, %r15
+# INTEL: mulx	r15, r9, qword ptr [rax + 4*rbx + 123]
+0x62,0x72,0xb7,0x08,0xf6,0xbc,0x98,0x7b,0x00,0x00,0x00
+
+# ATT:   mulxl	%r18d, %r22d, %r26d
+# INTEL: mulx	r26d, r22d, r18d
+0x62,0x6a,0x4f,0x00,0xf6,0xd2
+
+# ATT:   mulxq	%r19, %r23, %r27
+# INTEL: mulx	r27, r23, r19
+0x62,0x6a,0xc7,0x00,0xf6,0xdb
+
+# ATT:   mulxl	291(%r28,%r29,4), %r18d, %r22d
+# INTEL: mulx	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
+0x62,0x8a,0x6b,0x00,0xf6,0xb4,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   mulxq	291(%r28,%r29,4), %r19, %r23
+# INTEL: mulx	r23, r19, qword ptr [r28 + 4*r29 + 291]
+0x62,0x8a,0xe3,0x00,0xf6,0xbc,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   pdepl	%ecx, %edx, %r10d
+# INTEL: pdep	r10d, edx, ecx
+0x62,0x72,0x6f,0x08,0xf5,0xd1
+
+# ATT:   pdepq	%r9, %r15, %r11
+# INTEL: pdep	r11, r15, r9
+0x62,0x52,0x87,0x08,0xf5,0xd9
+
+# ATT:   pdepl	123(%rax,%rbx,4), %ecx, %edx
+# INTEL: pdep	edx, ecx, dword ptr [rax + 4*rbx + 123]
+0x62,0xf2,0x77,0x08,0xf5,0x54,0x98,0x7b
+
+# ATT:   pdepq	123(%rax,%rbx,4), %r9, %r15
+# INTEL: pdep	r15, r9, qword ptr [rax + 4*rbx + 123]
+0x62,0x72,0xb7,0x08,0xf5,0x7c,0x98,0x7b
+
+# ATT:   pdepl	%r18d, %r22d, %r26d
+# INTEL: pdep	r26d, r22d, r18d
+0x62,0x6a,0x4f,0x00,0xf5,0xd2
+
+# ATT:   pdepq	%r19, %r23, %r27
+# INTEL: pdep	r27, r23, r19
+0x62,0x6a,0xc7,0x00,0xf5,0xdb
+
+# ATT:   pdepl	291(%r28,%r29,4), %r18d, %r22d
+# INTEL: pdep	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
+0x62,0x8a,0x6b,0x00,0xf5,0xb4,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   pdepq	291(%r28,%r29,4), %r19, %r23
+# INTEL: pdep	r23, r19, qword ptr [r28 + 4*r29 + 291]
+0x62,0x8a,0xe3,0x00,0xf5,0xbc,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   pextl	%ecx, %edx, %r10d
+# INTEL: pext	r10d, edx, ecx
+0x62,0x72,0x6e,0x08,0xf5,0xd1
+
+# ATT:   pextq	%r9, %r15, %r11
+# INTEL: pext	r11, r15, r9
+0x62,0x52,0x86,0x08,0xf5,0xd9
+
+# ATT:   pextl	123(%rax,%rbx,4), %ecx, %edx
+# INTEL: pext	edx, ecx, dword ptr [rax + 4*rbx + 123]
+0x62,0xf2,0x76,0x08,0xf5,0x54,0x98,0x7b
+
+# ATT:   pextq	123(%rax,%rbx,4), %r9, %r15
+# INTEL: pext	r15, r9, qword ptr [rax + 4*rbx + 123]
+0x62,0x72,0xb6,0x08,0xf5,0x7c,0x98,0x7b
+
+# ATT:   pextl	%r18d, %r22d, %r26d
+# INTEL: pext	r26d, r22d, r18d
+0x62,0x6a,0x4e,0x00,0xf5,0xd2
+
+# ATT:   pextq	%r19, %r23, %r27
+# INTEL: pext	r27, r23, r19
+0x62,0x6a,0xc6,0x00,0xf5,0xdb
+
+# ATT:   pextl	291(%r28,%r29,4), %r18d, %r22d
+# INTEL: pext	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
+0x62,0x8a,0x6a,0x00,0xf5,0xb4,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   pextq	291(%r28,%r29,4), %r19, %r23
+# INTEL: pext	r23, r19, qword ptr [r28 + 4*r29 + 291]
+0x62,0x8a,0xe2,0x00,0xf5,0xbc,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   rorxl	$123, %ecx, %edx
+# INTEL: rorx	edx, ecx, 123
+0x62,0xf3,0x7f,0x08,0xf0,0xd1,0x7b
+
+# ATT:   rorxq	$123, %r9, %r15
+# INTEL: rorx	r15, r9, 123
+0x62,0x53,0xff,0x08,0xf0,0xf9,0x7b
+
+# ATT:   rorxl	$123, 123(%rax,%rbx,4), %ecx
+# INTEL: rorx	ecx, dword ptr [rax + 4*rbx + 123], 123
+0x62,0xf3,0x7f,0x08,0xf0,0x8c,0x98,0x7b,0x00,0x00,0x00,0x7b
+
+# ATT:   rorxq	$123, 123(%rax,%rbx,4), %r9
+# INTEL: rorx	r9, qword ptr [rax + 4*rbx + 123], 123
+0x62,0x73,0xff,0x08,0xf0,0x8c,0x98,0x7b,0x00,0x00,0x00,0x7b
+
+# ATT:   rorxl	$123, %r18d, %r22d
+# INTEL: rorx	r22d, r18d, 123
+0x62,0xeb,0x7f,0x08,0xf0,0xf2,0x7b
+
+# ATT:   rorxq	$123, %r19, %r23
+# INTEL: rorx	r23, r19, 123
+0x62,0xeb,0xff,0x08,0xf0,0xfb,0x7b
+
+# ATT:   rorxl	$123, 291(%r28,%r29,4), %r18d
+# INTEL: rorx	r18d, dword ptr [r28 + 4*r29 + 291], 123
+0x62,0x8b,0x7b,0x08,0xf0,0x94,0xac,0x23,0x01,0x00,0x00,0x7b
+
+# ATT:   rorxq	$123, 291(%r28,%r29,4), %r19
+# INTEL: rorx	r19, qword ptr [r28 + 4*r29 + 291], 123
+0x62,0x8b,0xfb,0x08,0xf0,0x9c,0xac,0x23,0x01,0x00,0x00,0x7b
+
+# ATT:   sarxl	%ecx, %edx, %r10d
+# INTEL: sarx	r10d, edx, ecx
+0x62,0x72,0x76,0x08,0xf7,0xd2
+
+# ATT:   sarxl	%ecx, 123(%rax,%rbx,4), %edx
+# INTEL: sarx	edx, dword ptr [rax + 4*rbx + 123], ecx
+0x62,0xf2,0x76,0x08,0xf7,0x94,0x98,0x7b,0x00,0x00,0x00
+
+# ATT:   sarxq	%r9, %r15, %r11
+# INTEL: sarx	r11, r15, r9
+0x62,0x52,0xb6,0x08,0xf7,0xdf
+
+# ATT:   sarxq	%r9, 123(%rax,%rbx,4), %r15
+# INTEL: sarx	r15, qword ptr [rax + 4*rbx + 123], r9
+0x62,0x72,0xb6,0x08,0xf7,0xbc,0x98,0x7b,0x00,0x00,0x00
+
+# ATT:   sarxl	%r18d, %r22d, %r26d
+# INTEL: sarx	r26d, r22d, r18d
+0x62,0x6a,0x6e,0x00,0xf7,0xd6
+
+# ATT:   sarxl	%r18d, 291(%r28,%r29,4), %r22d
+# INTEL: sarx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
+0x62,0x8a,0x6a,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   sarxq	%r19, %r23, %r27
+# INTEL: sarx	r27, r23, r19
+0x62,0x6a,0xe6,0x00,0xf7,0xdf
+
+# ATT:   sarxq	%r19, 291(%r28,%r29,4), %r23
+# INTEL: sarx	r23, qword ptr [r28 + 4*r29 + 291], r19
+0x62,0x8a,0xe2,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   shlxl	%ecx, %edx, %r10d
+# INTEL: shlx	r10d, edx, ecx
+0x62,0x72,0x75,0x08,0xf7,0xd2
+
+# ATT:   shlxl	%ecx, 123(%rax,%rbx,4), %edx
+# INTEL: shlx	edx, dword ptr [rax + 4*rbx + 123], ecx
+0x62,0xf2,0x75,0x08,0xf7,0x94,0x98,0x7b,0x00,0x00,0x00
+
+# ATT:   shlxq	%r9, %r15, %r11
+# INTEL: shlx	r11, r15, r9
+0x62,0x52,0xb5,0x08,0xf7,0xdf
+
+# ATT:   shlxq	%r9, 123(%rax,%rbx,4), %r15
+# INTEL: shlx	r15, qword ptr [rax + 4*rbx + 123], r9
+0x62,0x72,0xb5,0x08,0xf7,0xbc,0x98,0x7b,0x00,0x00,0x00
+
+# ATT:   shlxl	%r18d, %r22d, %r26d
+# INTEL: shlx	r26d, r22d, r18d
+0x62,0x6a,0x6d,0x00,0xf7,0xd6
+
+# ATT:   shlxl	%r18d, 291(%r28,%r29,4), %r22d
+# INTEL: shlx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
+0x62,0x8a,0x69,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   shlxq	%r19, %r23, %r27
+# INTEL: shlx	r27, r23, r19
+0x62,0x6a,0xe5,0x00,0xf7,0xdf
+
+# ATT:   shlxq	%r19, 291(%r28,%r29,4), %r23
+# INTEL: shlx	r23, qword ptr [r28 + 4*r29 + 291], r19
+0x62,0x8a,0xe1,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   shrxl	%ecx, %edx, %r10d
+# INTEL: shrx	r10d, edx, ecx
+0x62,0x72,0x77,0x08,0xf7,0xd2
+
+# ATT:   shrxl	%ecx, 123(%rax,%rbx,4), %edx
+# INTEL: shrx	edx, dword ptr [rax + 4*rbx + 123], ecx
+0x62,0xf2,0x77,0x08,0xf7,0x94,0x98,0x7b,0x00,0x00,0x00
+
+# ATT:   shrxq	%r9, %r15, %r11
+# INTEL: shrx	r11, r15, r9
+0x62,0x52,0xb7,0x08,0xf7,0xdf
+
+# ATT:   shrxq	%r9, 123(%rax,%rbx,4), %r15
+# INTEL: shrx	r15, qword ptr [rax + 4*rbx + 123], r9
+0x62,0x72,0xb7,0x08,0xf7,0xbc,0x98,0x7b,0x00,0x00,0x00
+
+# ATT:   shrxl	%r18d, %r22d, %r26d
+# INTEL: shrx	r26d, r22d, r18d
+0x62,0x6a,0x6f,0x00,0xf7,0xd6
+
+# ATT:   shrxl	%r18d, 291(%r28,%r29,4), %r22d
+# INTEL: shrx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
+0x62,0x8a,0x6b,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   shrxq	%r19, %r23, %r27
+# INTEL: shrx	r27, r23, r19
+0x62,0x6a,0xe7,0x00,0xf7,0xdf
+
+# ATT:   shrxq	%r19, 291(%r28,%r29,4), %r23
+# INTEL: shrx	r23, qword ptr [r28 + 4*r29 + 291], r19
+0x62,0x8a,0xe3,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/cet.txt b/llvm/test/MC/Disassembler/X86/apx/cet.txt
new file mode 100644
index 00000000000000..1c9db6fea80874
--- /dev/null
+++ b/llvm/test/MC/Disassembler/X86/apx/cet.txt
@@ -0,0 +1,34 @@
+# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
+# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
+
+# ATT:   wrssd	%ecx, 123(%rax,%rbx,4)
+# INTEL: wrssd	dword ptr [rax + 4*rbx + 123], ecx
+0x62,0xf4,0x7c,0x08,0x66,0x4c,0x98,0x7b
+
+# ATT:   wrssd	%r18d, 291(%r28,%r29,4)
+# INTEL: wrssd	dword ptr [r28 + 4*r29 + 291], r18d
+0x62,0x8c,0x78,0x08,0x66,0x94,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   wrssq	%r9, 123(%rax,%rbx,4)
+# INTEL: wrssq	qword ptr [rax + 4*rbx + 123], r9
+0x62,0x74,0xfc,0x08,0x66,0x4c,0x98,0x7b
+
+# ATT:   wrssq	%r19, 291(%r28,%r29,4)
+# INTEL: wrssq	qword ptr [r28 + 4*r29 + 291], r19
+0x62,0x8c,0xf8,0x08,0x66,0x9c,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   wrussd	%ecx, 123(%rax,%rbx,4)
+# INTEL: wrussd	dword ptr [rax + 4*rbx + 123], ecx
+0x62,0xf4,0x7d,0x08,0x65,0x4c,0x98,0x7b
+
+# ATT:   wrussd	%r18d, 291(%r28,%r29,4)
+# INTEL: wrussd	dword ptr [r28 + 4*r29 + 291], r18d
+0x62,0x8c,0x79,0x08,0x65,0x94,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   wrussq	%r9, 123(%rax,%rbx,4)
+# INTEL: wrussq	qword ptr [rax + 4*rbx + 123], r9
+0x62,0x74,0xfd,0x08,0x65,0x4c,0x98,0x7b
+
+# ATT:   wrussq	%r19, 291(%r28,%r29,4)
+# INTEL: wrussq	qword ptr [r28 + 4*r29 + 291], r19
+0x62,0x8c,0xf9,0x08,0x65,0x9c,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/invept.txt b/llvm/test/MC/Disassembler/X86/apx/invept.txt
deleted file mode 100644
index dc6bcbbb05cca7..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/invept.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   invept	123(%r28,%r29,4), %r19
-# INTEL: invept	r19, xmmword ptr [r28 + 4*r29 + 123]
-0x62,0x8c,0x7a,0x08,0xf0,0x5c,0xac,0x7b
diff --git a/llvm/test/MC/Disassembler/X86/apx/invvpid.txt b/llvm/test/MC/Disassembler/X86/apx/invvpid.txt
deleted file mode 100644
index 05abc29b9b4679..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/invvpid.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   invvpid	291(%r28,%r29,4), %r19
-# INTEL: invvpid	r19, xmmword ptr [r28 + 4*r29 + 291]
-0x62,0x8c,0x7a,0x08,0xf1,0x9c,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/movdir64b.txt b/llvm/test/MC/Disassembler/X86/apx/movdir64b.txt
index 81d8f49dbf69de..efb2f41056e321 100644
--- a/llvm/test/MC/Disassembler/X86/apx/movdir64b.txt
+++ b/llvm/test/MC/Disassembler/X86/apx/movdir64b.txt
@@ -1,6 +1,14 @@
 # RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
 # RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
 
+# ATT:   movdir64b	123(%eax,%ebx,4), %ecx
+# INTEL: movdir64b	ecx, zmmword ptr [eax + 4*ebx + 123]
+0x67,0x62,0xf4,0x7d,0x08,0xf8,0x4c,0x98,0x7b
+
+# ATT:   movdir64b	123(%rax,%rbx,4), %r9
+# INTEL: movdir64b	r9, zmmword ptr [rax + 4*rbx + 123]
+0x62,0x74,0x7d,0x08,0xf8,0x4c,0x98,0x7b
+
 # ATT:   movdir64b	291(%r28d,%r29d,4), %r18d
 # INTEL: movdir64b	r18d, zmmword ptr [r28d + 4*r29d + 291]
 0x67,0x62,0x8c,0x79,0x08,0xf8,0x94,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/movdiri.txt b/llvm/test/MC/Disassembler/X86/apx/movdiri.txt
index 997d016f0d2228..280d01e1cd0bbf 100644
--- a/llvm/test/MC/Disassembler/X86/apx/movdiri.txt
+++ b/llvm/test/MC/Disassembler/X86/apx/movdiri.txt
@@ -1,6 +1,14 @@
 # RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
 # RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
 
+# ATT:   movdiri	%ecx, 123(%eax,%ebx,4)
+# INTEL: movdiri	dword ptr [eax + 4*ebx + 123], ecx
+0x67,0x62,0xf4,0x7c,0x08,0xf9,0x4c,0x98,0x7b
+
+# ATT:   movdiri	%r9, 123(%rax,%rbx,4)
+# INTEL: movdiri	qword ptr [rax + 4*rbx + 123], r9
+0x62,0x74,0xfc,0x08,0xf9,0x4c,0x98,0x7b
+
 # ATT:   movdiri	%r18d, 291(%r28,%r29,4)
 # INTEL: movdiri	dword ptr [r28 + 4*r29 + 291], r18d
 0x62,0x8c,0x78,0x08,0xf9,0x94,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/sha.txt b/llvm/test/MC/Disassembler/X86/apx/sha.txt
new file mode 100644
index 00000000000000..1697bdbbfdf61f
--- /dev/null
+++ b/llvm/test/MC/Disassembler/X86/apx/sha.txt
@@ -0,0 +1,110 @@
+# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
+# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
+
+# ATT:   sha1msg1	%xmm13, %xmm12
+# INTEL: sha1msg1	xmm12, xmm13
+0x62,0x54,0x7c,0x08,0xd9,0xe5
+
+# ATT:   sha1msg1	123(%rax,%rbx,4), %xmm12
+# INTEL: sha1msg1	xmm12, xmmword ptr [rax + 4*rbx + 123]
+0x62,0x74,0x7c,0x08,0xd9,0x64,0x98,0x7b
+
+# ATT:   sha1msg1	%xmm13, %xmm12
+# INTEL: sha1msg1	xmm12, xmm13
+0x45,0x0f,0x38,0xc9,0xe5
+
+# ATT:   sha1msg1	291(%r28,%r29,4), %xmm12
+# INTEL: sha1msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+0x62,0x1c,0x78,0x08,0xd9,0xa4,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   sha1msg2	%xmm13, %xmm12
+# INTEL: sha1msg2	xmm12, xmm13
+0x62,0x54,0x7c,0x08,0xda,0xe5
+
+# ATT:   sha1msg2	123(%rax,%rbx,4), %xmm12
+# INTEL: sha1msg2	xmm12, xmmword ptr [rax + 4*rbx + 123]
+0x62,0x74,0x7c,0x08,0xda,0x64,0x98,0x7b
+
+# ATT:   sha1msg2	%xmm13, %xmm12
+# INTEL: sha1msg2	xmm12, xmm13
+0x45,0x0f,0x38,0xca,0xe5
+
+# ATT:   sha1msg2	291(%r28,%r29,4), %xmm12
+# INTEL: sha1msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+0x62,0x1c,0x78,0x08,0xda,0xa4,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   sha1nexte	%xmm13, %xmm12
+# INTEL: sha1nexte	xmm12, xmm13
+0x62,0x54,0x7c,0x08,0xd8,0xe5
+
+# ATT:   sha1nexte	123(%rax,%rbx,4), %xmm12
+# INTEL: sha1nexte	xmm12, xmmword ptr [rax + 4*rbx + 123]
+0x62,0x74,0x7c,0x08,0xd8,0x64,0x98,0x7b
+
+# ATT:   sha1nexte	%xmm13, %xmm12
+# INTEL: sha1nexte	xmm12, xmm13
+0x45,0x0f,0x38,0xc8,0xe5
+
+# ATT:   sha1nexte	291(%r28,%r29,4), %xmm12
+# INTEL: sha1nexte	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+0x62,0x1c,0x78,0x08,0xd8,0xa4,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   sha1rnds4	$123, %xmm13, %xmm12
+# INTEL: sha1rnds4	xmm12, xmm13, 123
+0x62,0x54,0x7c,0x08,0xd4,0xe5,0x7b
+
+# ATT:   sha1rnds4	$123, 123(%rax,%rbx,4), %xmm12
+# INTEL: sha1rnds4	xmm12, xmmword ptr [rax + 4*rbx + 123], 123
+0x62,0x74,0x7c,0x08,0xd4,0x64,0x98,0x7b,0x7b
+
+# ATT:   sha1rnds4	$123, %xmm13, %xmm12
+# INTEL: sha1rnds4	xmm12, xmm13, 123
+0x45,0x0f,0x3a,0xcc,0xe5,0x7b
+
+# ATT:   sha1rnds4	$123, 291(%r28,%r29,4), %xmm12
+# INTEL: sha1rnds4	xmm12, xmmword ptr [r28 + 4*r29 + 291], 123
+0x62,0x1c,0x78,0x08,0xd4,0xa4,0xac,0x23,0x01,0x00,0x00,0x7b
+
+# ATT:   sha256msg1	%xmm13, %xmm12
+# INTEL: sha256msg1	xmm12, xmm13
+0x62,0x54,0x7c,0x08,0xdc,0xe5
+
+# ATT:   sha256msg1	123(%rax,%rbx,4), %xmm12
+# INTEL: sha256msg1	xmm12, xmmword ptr [rax + 4*rbx + 123]
+0x62,0x74,0x7c,0x08,0xdc,0x64,0x98,0x7b
+
+# ATT:   sha256msg1	%xmm13, %xmm12
+# INTEL: sha256msg1	xmm12, xmm13
+0x45,0x0f,0x38,0xcc,0xe5
+
+# ATT:   sha256msg1	291(%r28,%r29,4), %xmm12
+# INTEL: sha256msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+0x62,0x1c,0x78,0x08,0xdc,0xa4,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   sha256msg2	%xmm13, %xmm12
+# INTEL: sha256msg2	xmm12, xmm13
+0x62,0x54,0x7c,0x08,0xdd,0xe5
+
+# ATT:   sha256msg2	123(%rax,%rbx,4), %xmm12
+# INTEL: sha256msg2	xmm12, xmmword ptr [rax + 4*rbx + 123]
+0x62,0x74,0x7c,0x08,0xdd,0x64,0x98,0x7b
+
+# ATT:   sha256msg2	%xmm13, %xmm12
+# INTEL: sha256msg2	xmm12, xmm13
+0x45,0x0f,0x38,0xcd,0xe5
+
+# ATT:   sha256msg2	291(%r28,%r29,4), %xmm12
+# INTEL: sha256msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+0x62,0x1c,0x78,0x08,0xdd,0xa4,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   sha256rnds2	%xmm0, 123(%rax,%rbx,4), %xmm12
+# INTEL: sha256rnds2	xmm12, xmmword ptr [rax + 4*rbx + 123], xmm0
+0x62,0x74,0x7c,0x08,0xdb,0x64,0x98,0x7b
+
+# ATT:   sha256rnds2	%xmm0, %xmm13, %xmm12
+# INTEL: sha256rnds2	xmm12, xmm13, xmm0
+0x45,0x0f,0x38,0xcb,0xe5
+
+# ATT:   sha256rnds2	%xmm0, 291(%r28,%r29,4), %xmm12
+# INTEL: sha256rnds2	xmm12, xmmword ptr [r28 + 4*r29 + 291], xmm0
+0x62,0x1c,0x78,0x08,0xdb,0xa4,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/sha1msg1.txt b/llvm/test/MC/Disassembler/X86/apx/sha1msg1.txt
deleted file mode 100644
index 1c94fa88a3d3cf..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/sha1msg1.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   sha1msg1	%xmm13, %xmm12
-# INTEL: sha1msg1	xmm12, xmm13
-0x45,0x0f,0x38,0xc9,0xe5
-
-# ATT:   sha1msg1	291(%r28,%r29,4), %xmm12
-# INTEL: sha1msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
-0x62,0x1c,0x78,0x08,0xd9,0xa4,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/sha1msg2.txt b/llvm/test/MC/Disassembler/X86/apx/sha1msg2.txt
deleted file mode 100644
index 5fd17d9f326006..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/sha1msg2.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   sha1msg2	%xmm13, %xmm12
-# INTEL: sha1msg2	xmm12, xmm13
-0x45,0x0f,0x38,0xca,0xe5
-
-# ATT:   sha1msg2	291(%r28,%r29,4), %xmm12
-# INTEL: sha1msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
-0x62,0x1c,0x78,0x08,0xda,0xa4,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/sha1nexte.txt b/llvm/test/MC/Disassembler/X86/apx/sha1nexte.txt
deleted file mode 100644
index 3c5eae3d7177fc..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/sha1nexte.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   sha1nexte	%xmm13, %xmm12
-# INTEL: sha1nexte	xmm12, xmm13
-0x45,0x0f,0x38,0xc8,0xe5
-
-# ATT:   sha1nexte	291(%r28,%r29,4), %xmm12
-# INTEL: sha1nexte	xmm12, xmmword ptr [r28 + 4*r29 + 291]
-0x62,0x1c,0x78,0x08,0xd8,0xa4,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/sha1rnds4.txt b/llvm/test/MC/Disassembler/X86/apx/sha1rnds4.txt
deleted file mode 100644
index a05f17739606ac..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/sha1rnds4.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   sha1rnds4	$123, %xmm13, %xmm12
-# INTEL: sha1rnds4	xmm12, xmm13, 123
-0x45,0x0f,0x3a,0xcc,0xe5,0x7b
-
-# ATT:   sha1rnds4	$123, 291(%r28,%r29,4), %xmm12
-# INTEL: sha1rnds4	xmm12, xmmword ptr [r28 + 4*r29 + 291], 123
-0x62,0x1c,0x78,0x08,0xd4,0xa4,0xac,0x23,0x01,0x00,0x00,0x7b
diff --git a/llvm/test/MC/Disassembler/X86/apx/sha256msg1.txt b/llvm/test/MC/Disassembler/X86/apx/sha256msg1.txt
deleted file mode 100644
index b4c14866647dd6..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/sha256msg1.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   sha256msg1	%xmm13, %xmm12
-# INTEL: sha256msg1	xmm12, xmm13
-0x45,0x0f,0x38,0xcc,0xe5
-
-# ATT:   sha256msg1	291(%r28,%r29,4), %xmm12
-# INTEL: sha256msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
-0x62,0x1c,0x78,0x08,0xdc,0xa4,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/sha256msg2.txt b/llvm/test/MC/Disassembler/X86/apx/sha256msg2.txt
deleted file mode 100644
index 75099b428e2b67..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/sha256msg2.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   sha256msg2	%xmm13, %xmm12
-# INTEL: sha256msg2	xmm12, xmm13
-0x45,0x0f,0x38,0xcd,0xe5
-
-# ATT:   sha256msg2	291(%r28,%r29,4), %xmm12
-# INTEL: sha256msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
-0x62,0x1c,0x78,0x08,0xdd,0xa4,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/sha256rnds2.txt b/llvm/test/MC/Disassembler/X86/apx/sha256rnds2.txt
deleted file mode 100644
index 1ca60aa9e9b1a2..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/sha256rnds2.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   sha256rnds2	%xmm0, %xmm13, %xmm12
-# INTEL: sha256rnds2	xmm12, xmm13, xmm0
-0x45,0x0f,0x38,0xcb,0xe5
-
-# ATT:   sha256rnds2	%xmm0, 291(%r28,%r29,4), %xmm12
-# INTEL: sha256rnds2	xmm12, xmmword ptr [r28 + 4*r29 + 291], xmm0
-0x62,0x1c,0x78,0x08,0xdb,0xa4,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/vmx.txt b/llvm/test/MC/Disassembler/X86/apx/vmx.txt
new file mode 100644
index 00000000000000..c7b8616e772926
--- /dev/null
+++ b/llvm/test/MC/Disassembler/X86/apx/vmx.txt
@@ -0,0 +1,18 @@
+# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
+# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
+
+# ATT:   invept	291(%r28,%r29,4), %r19
+# INTEL: invept	r19, xmmword ptr [r28 + 4*r29 + 291]
+0x62,0x8c,0x7a,0x08,0xf0,0x9c,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   invept	123(%rax,%rbx,4), %r9
+# INTEL: invept	r9, xmmword ptr [rax + 4*rbx + 123]
+0x62,0x74,0x7e,0x08,0xf0,0x4c,0x98,0x7b
+
+# ATT:   invvpid	291(%r28,%r29,4), %r19
+# INTEL: invvpid	r19, xmmword ptr [r28 + 4*r29 + 291]
+0x62,0x8c,0x7a,0x08,0xf1,0x9c,0xac,0x23,0x01,0x00,0x00
+
+# ATT:   invvpid	123(%rax,%rbx,4), %r9
+# INTEL: invvpid	r9, xmmword ptr [rax + 4*rbx + 123]
+0x62,0x74,0x7e,0x08,0xf1,0x4c,0x98,0x7b
diff --git a/llvm/test/MC/Disassembler/X86/apx/wrssd.txt b/llvm/test/MC/Disassembler/X86/apx/wrssd.txt
deleted file mode 100644
index 600e85e1440e85..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/wrssd.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   wrssd	%r18d, 291(%r28,%r29,4)
-# INTEL: wrssd	dword ptr [r28 + 4*r29 + 291], r18d
-0x62,0x8c,0x78,0x08,0x66,0x94,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/wrssq.txt b/llvm/test/MC/Disassembler/X86/apx/wrssq.txt
deleted file mode 100644
index 9f5b26321fd2b3..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/wrssq.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   wrssq	%r19, 291(%r28,%r29,4)
-# INTEL: wrssq	qword ptr [r28 + 4*r29 + 291], r19
-0x62,0x8c,0xf8,0x08,0x66,0x9c,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/wrussd.txt b/llvm/test/MC/Disassembler/X86/apx/wrussd.txt
deleted file mode 100644
index 1b8b0007e2d322..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/wrussd.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   wrussd	%r18d, 291(%r28,%r29,4)
-# INTEL: wrussd	dword ptr [r28 + 4*r29 + 291], r18d
-0x62,0x8c,0x79,0x08,0x65,0x94,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/Disassembler/X86/apx/wrussq.txt b/llvm/test/MC/Disassembler/X86/apx/wrussq.txt
deleted file mode 100644
index 7ff51f617c5cce..00000000000000
--- a/llvm/test/MC/Disassembler/X86/apx/wrussq.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
-# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
-
-# ATT:   wrussq	%r19, 291(%r28,%r29,4)
-# INTEL: wrussq	qword ptr [r28 + 4*r29 + 291], r19
-0x62,0x8c,0xf9,0x08,0x65,0x9c,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/X86/apx/bmi2-att.s b/llvm/test/MC/X86/apx/bmi2-att.s
new file mode 100644
index 00000000000000..a99433fb803b7c
--- /dev/null
+++ b/llvm/test/MC/X86/apx/bmi2-att.s
@@ -0,0 +1,228 @@
+# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
+# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
+
+# ERROR-COUNT-56: error:
+# ERROR-NOT: error:
+# CHECK: {evex}	mulxl	%ecx, %edx, %r10d
+# CHECK: encoding: [0x62,0x72,0x6f,0x08,0xf6,0xd1]
+         {evex}	mulxl	%ecx, %edx, %r10d
+
+# CHECK: {evex}	mulxq	%r9, %r15, %r11
+# CHECK: encoding: [0x62,0x52,0x87,0x08,0xf6,0xd9]
+         {evex}	mulxq	%r9, %r15, %r11
+
+# CHECK: {evex}	mulxl	123(%rax,%rbx,4), %ecx, %edx
+# CHECK: encoding: [0x62,0xf2,0x77,0x08,0xf6,0x94,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	mulxl	123(%rax,%rbx,4), %ecx, %edx
+
+# CHECK: {evex}	mulxq	123(%rax,%rbx,4), %r9, %r15
+# CHECK: encoding: [0x62,0x72,0xb7,0x08,0xf6,0xbc,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	mulxq	123(%rax,%rbx,4), %r9, %r15
+
+# CHECK: {evex}	mulxl	%r18d, %r22d, %r26d
+# CHECK: encoding: [0x62,0x6a,0x4f,0x00,0xf6,0xd2]
+         {evex}	mulxl	%r18d, %r22d, %r26d
+
+# CHECK: {evex}	mulxq	%r19, %r23, %r27
+# CHECK: encoding: [0x62,0x6a,0xc7,0x00,0xf6,0xdb]
+         {evex}	mulxq	%r19, %r23, %r27
+
+# CHECK: {evex}	mulxl	291(%r28,%r29,4), %r18d, %r22d
+# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf6,0xb4,0xac,0x23,0x01,0x00,0x00]
+         {evex}	mulxl	291(%r28,%r29,4), %r18d, %r22d
+
+# CHECK: {evex}	mulxq	291(%r28,%r29,4), %r19, %r23
+# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf6,0xbc,0xac,0x23,0x01,0x00,0x00]
+         {evex}	mulxq	291(%r28,%r29,4), %r19, %r23
+
+# CHECK: {evex}	pdepl	%ecx, %edx, %r10d
+# CHECK: encoding: [0x62,0x72,0x6f,0x08,0xf5,0xd1]
+         {evex}	pdepl	%ecx, %edx, %r10d
+
+# CHECK: {evex}	pdepq	%r9, %r15, %r11
+# CHECK: encoding: [0x62,0x52,0x87,0x08,0xf5,0xd9]
+         {evex}	pdepq	%r9, %r15, %r11
+
+# CHECK: {evex}	pdepl	123(%rax,%rbx,4), %ecx, %edx
+# CHECK: encoding: [0x62,0xf2,0x77,0x08,0xf5,0x54,0x98,0x7b]
+         {evex}	pdepl	123(%rax,%rbx,4), %ecx, %edx
+
+# CHECK: {evex}	pdepq	123(%rax,%rbx,4), %r9, %r15
+# CHECK: encoding: [0x62,0x72,0xb7,0x08,0xf5,0x7c,0x98,0x7b]
+         {evex}	pdepq	123(%rax,%rbx,4), %r9, %r15
+
+# CHECK: pdepl	%r18d, %r22d, %r26d
+# CHECK: encoding: [0x62,0x6a,0x4f,0x00,0xf5,0xd2]
+         pdepl	%r18d, %r22d, %r26d
+
+# CHECK: pdepq	%r19, %r23, %r27
+# CHECK: encoding: [0x62,0x6a,0xc7,0x00,0xf5,0xdb]
+         pdepq	%r19, %r23, %r27
+
+# CHECK: pdepl	291(%r28,%r29,4), %r18d, %r22d
+# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf5,0xb4,0xac,0x23,0x01,0x00,0x00]
+         pdepl	291(%r28,%r29,4), %r18d, %r22d
+
+# CHECK: pdepq	291(%r28,%r29,4), %r19, %r23
+# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf5,0xbc,0xac,0x23,0x01,0x00,0x00]
+         pdepq	291(%r28,%r29,4), %r19, %r23
+
+# CHECK: {evex}	pextl	%ecx, %edx, %r10d
+# CHECK: encoding: [0x62,0x72,0x6e,0x08,0xf5,0xd1]
+         {evex}	pextl	%ecx, %edx, %r10d
+
+# CHECK: {evex}	pextq	%r9, %r15, %r11
+# CHECK: encoding: [0x62,0x52,0x86,0x08,0xf5,0xd9]
+         {evex}	pextq	%r9, %r15, %r11
+
+# CHECK: {evex}	pextl	123(%rax,%rbx,4), %ecx, %edx
+# CHECK: encoding: [0x62,0xf2,0x76,0x08,0xf5,0x54,0x98,0x7b]
+         {evex}	pextl	123(%rax,%rbx,4), %ecx, %edx
+
+# CHECK: {evex}	pextq	123(%rax,%rbx,4), %r9, %r15
+# CHECK: encoding: [0x62,0x72,0xb6,0x08,0xf5,0x7c,0x98,0x7b]
+         {evex}	pextq	123(%rax,%rbx,4), %r9, %r15
+
+# CHECK: pextl	%r18d, %r22d, %r26d
+# CHECK: encoding: [0x62,0x6a,0x4e,0x00,0xf5,0xd2]
+         pextl	%r18d, %r22d, %r26d
+
+# CHECK: pextq	%r19, %r23, %r27
+# CHECK: encoding: [0x62,0x6a,0xc6,0x00,0xf5,0xdb]
+         pextq	%r19, %r23, %r27
+
+# CHECK: pextl	291(%r28,%r29,4), %r18d, %r22d
+# CHECK: encoding: [0x62,0x8a,0x6a,0x00,0xf5,0xb4,0xac,0x23,0x01,0x00,0x00]
+         pextl	291(%r28,%r29,4), %r18d, %r22d
+
+# CHECK: pextq	291(%r28,%r29,4), %r19, %r23
+# CHECK: encoding: [0x62,0x8a,0xe2,0x00,0xf5,0xbc,0xac,0x23,0x01,0x00,0x00]
+         pextq	291(%r28,%r29,4), %r19, %r23
+
+# CHECK: {evex}	rorxl	$123, %ecx, %edx
+# CHECK: encoding: [0x62,0xf3,0x7f,0x08,0xf0,0xd1,0x7b]
+         {evex}	rorxl	$123, %ecx, %edx
+
+# CHECK: {evex}	rorxq	$123, %r9, %r15
+# CHECK: encoding: [0x62,0x53,0xff,0x08,0xf0,0xf9,0x7b]
+         {evex}	rorxq	$123, %r9, %r15
+
+# CHECK: {evex}	rorxl	$123, 123(%rax,%rbx,4), %ecx
+# CHECK: encoding: [0x62,0xf3,0x7f,0x08,0xf0,0x8c,0x98,0x7b,0x00,0x00,0x00,0x7b]
+         {evex}	rorxl	$123, 123(%rax,%rbx,4), %ecx
+
+# CHECK: {evex}	rorxq	$123, 123(%rax,%rbx,4), %r9
+# CHECK: encoding: [0x62,0x73,0xff,0x08,0xf0,0x8c,0x98,0x7b,0x00,0x00,0x00,0x7b]
+         {evex}	rorxq	$123, 123(%rax,%rbx,4), %r9
+
+# CHECK: rorxl	$123, %r18d, %r22d
+# CHECK: encoding: [0x62,0xeb,0x7f,0x08,0xf0,0xf2,0x7b]
+         rorxl	$123, %r18d, %r22d
+
+# CHECK: rorxq	$123, %r19, %r23
+# CHECK: encoding: [0x62,0xeb,0xff,0x08,0xf0,0xfb,0x7b]
+         rorxq	$123, %r19, %r23
+
+# CHECK: rorxl	$123, 291(%r28,%r29,4), %r18d
+# CHECK: encoding: [0x62,0x8b,0x7b,0x08,0xf0,0x94,0xac,0x23,0x01,0x00,0x00,0x7b]
+         rorxl	$123, 291(%r28,%r29,4), %r18d
+
+# CHECK: rorxq	$123, 291(%r28,%r29,4), %r19
+# CHECK: encoding: [0x62,0x8b,0xfb,0x08,0xf0,0x9c,0xac,0x23,0x01,0x00,0x00,0x7b]
+         rorxq	$123, 291(%r28,%r29,4), %r19
+
+# CHECK: {evex}	sarxl	%ecx, %edx, %r10d
+# CHECK: encoding: [0x62,0x72,0x76,0x08,0xf7,0xd2]
+         {evex}	sarxl	%ecx, %edx, %r10d
+
+# CHECK: {evex}	sarxl	%ecx, 123(%rax,%rbx,4), %edx
+# CHECK: encoding: [0x62,0xf2,0x76,0x08,0xf7,0x94,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	sarxl	%ecx, 123(%rax,%rbx,4), %edx
+
+# CHECK: {evex}	sarxq	%r9, %r15, %r11
+# CHECK: encoding: [0x62,0x52,0xb6,0x08,0xf7,0xdf]
+         {evex}	sarxq	%r9, %r15, %r11
+
+# CHECK: {evex}	sarxq	%r9, 123(%rax,%rbx,4), %r15
+# CHECK: encoding: [0x62,0x72,0xb6,0x08,0xf7,0xbc,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	sarxq	%r9, 123(%rax,%rbx,4), %r15
+
+# CHECK: sarxl	%r18d, %r22d, %r26d
+# CHECK: encoding: [0x62,0x6a,0x6e,0x00,0xf7,0xd6]
+         sarxl	%r18d, %r22d, %r26d
+
+# CHECK: sarxl	%r18d, 291(%r28,%r29,4), %r22d
+# CHECK: encoding: [0x62,0x8a,0x6a,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
+         sarxl	%r18d, 291(%r28,%r29,4), %r22d
+
+# CHECK: sarxq	%r19, %r23, %r27
+# CHECK: encoding: [0x62,0x6a,0xe6,0x00,0xf7,0xdf]
+         sarxq	%r19, %r23, %r27
+
+# CHECK: sarxq	%r19, 291(%r28,%r29,4), %r23
+# CHECK: encoding: [0x62,0x8a,0xe2,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
+         sarxq	%r19, 291(%r28,%r29,4), %r23
+
+# CHECK: {evex}	shlxl	%ecx, %edx, %r10d
+# CHECK: encoding: [0x62,0x72,0x75,0x08,0xf7,0xd2]
+         {evex}	shlxl	%ecx, %edx, %r10d
+
+# CHECK: {evex}	shlxl	%ecx, 123(%rax,%rbx,4), %edx
+# CHECK: encoding: [0x62,0xf2,0x75,0x08,0xf7,0x94,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	shlxl	%ecx, 123(%rax,%rbx,4), %edx
+
+# CHECK: {evex}	shlxq	%r9, %r15, %r11
+# CHECK: encoding: [0x62,0x52,0xb5,0x08,0xf7,0xdf]
+         {evex}	shlxq	%r9, %r15, %r11
+
+# CHECK: {evex}	shlxq	%r9, 123(%rax,%rbx,4), %r15
+# CHECK: encoding: [0x62,0x72,0xb5,0x08,0xf7,0xbc,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	shlxq	%r9, 123(%rax,%rbx,4), %r15
+
+# CHECK: shlxl	%r18d, %r22d, %r26d
+# CHECK: encoding: [0x62,0x6a,0x6d,0x00,0xf7,0xd6]
+         shlxl	%r18d, %r22d, %r26d
+
+# CHECK: shlxl	%r18d, 291(%r28,%r29,4), %r22d
+# CHECK: encoding: [0x62,0x8a,0x69,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
+         shlxl	%r18d, 291(%r28,%r29,4), %r22d
+
+# CHECK: shlxq	%r19, %r23, %r27
+# CHECK: encoding: [0x62,0x6a,0xe5,0x00,0xf7,0xdf]
+         shlxq	%r19, %r23, %r27
+
+# CHECK: shlxq	%r19, 291(%r28,%r29,4), %r23
+# CHECK: encoding: [0x62,0x8a,0xe1,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
+         shlxq	%r19, 291(%r28,%r29,4), %r23
+
+# CHECK: {evex}	shrxl	%ecx, %edx, %r10d
+# CHECK: encoding: [0x62,0x72,0x77,0x08,0xf7,0xd2]
+         {evex}	shrxl	%ecx, %edx, %r10d
+
+# CHECK: {evex}	shrxl	%ecx, 123(%rax,%rbx,4), %edx
+# CHECK: encoding: [0x62,0xf2,0x77,0x08,0xf7,0x94,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	shrxl	%ecx, 123(%rax,%rbx,4), %edx
+
+# CHECK: {evex}	shrxq	%r9, %r15, %r11
+# CHECK: encoding: [0x62,0x52,0xb7,0x08,0xf7,0xdf]
+         {evex}	shrxq	%r9, %r15, %r11
+
+# CHECK: {evex}	shrxq	%r9, 123(%rax,%rbx,4), %r15
+# CHECK: encoding: [0x62,0x72,0xb7,0x08,0xf7,0xbc,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	shrxq	%r9, 123(%rax,%rbx,4), %r15
+
+# CHECK: shrxl	%r18d, %r22d, %r26d
+# CHECK: encoding: [0x62,0x6a,0x6f,0x00,0xf7,0xd6]
+         shrxl	%r18d, %r22d, %r26d
+
+# CHECK: shrxl	%r18d, 291(%r28,%r29,4), %r22d
+# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
+         shrxl	%r18d, 291(%r28,%r29,4), %r22d
+
+# CHECK: shrxq	%r19, %r23, %r27
+# CHECK: encoding: [0x62,0x6a,0xe7,0x00,0xf7,0xdf]
+         shrxq	%r19, %r23, %r27
+
+# CHECK: shrxq	%r19, 291(%r28,%r29,4), %r23
+# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
+         shrxq	%r19, 291(%r28,%r29,4), %r23
diff --git a/llvm/test/MC/X86/apx/bmi2-intel.s b/llvm/test/MC/X86/apx/bmi2-intel.s
new file mode 100644
index 00000000000000..f87734222da9e1
--- /dev/null
+++ b/llvm/test/MC/X86/apx/bmi2-intel.s
@@ -0,0 +1,225 @@
+# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+# CHECK: {evex}	mulx	r10d, edx, ecx
+# CHECK: encoding: [0x62,0x72,0x6f,0x08,0xf6,0xd1]
+         {evex}	mulx	r10d, edx, ecx
+
+# CHECK: {evex}	mulx	r11, r15, r9
+# CHECK: encoding: [0x62,0x52,0x87,0x08,0xf6,0xd9]
+         {evex}	mulx	r11, r15, r9
+
+# CHECK: {evex}	mulx	edx, ecx, dword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0xf2,0x77,0x08,0xf6,0x94,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	mulx	edx, ecx, dword ptr [rax + 4*rbx + 123]
+
+# CHECK: {evex}	mulx	r15, r9, qword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x72,0xb7,0x08,0xf6,0xbc,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	mulx	r15, r9, qword ptr [rax + 4*rbx + 123]
+
+# CHECK: {evex}	mulx	r26d, r22d, r18d
+# CHECK: encoding: [0x62,0x6a,0x4f,0x00,0xf6,0xd2]
+         {evex}	mulx	r26d, r22d, r18d
+
+# CHECK: {evex}	mulx	r27, r23, r19
+# CHECK: encoding: [0x62,0x6a,0xc7,0x00,0xf6,0xdb]
+         {evex}	mulx	r27, r23, r19
+
+# CHECK: {evex}	mulx	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf6,0xb4,0xac,0x23,0x01,0x00,0x00]
+         {evex}	mulx	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
+
+# CHECK: {evex}	mulx	r23, r19, qword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf6,0xbc,0xac,0x23,0x01,0x00,0x00]
+         {evex}	mulx	r23, r19, qword ptr [r28 + 4*r29 + 291]
+
+# CHECK: {evex}	pdep	r10d, edx, ecx
+# CHECK: encoding: [0x62,0x72,0x6f,0x08,0xf5,0xd1]
+         {evex}	pdep	r10d, edx, ecx
+
+# CHECK: {evex}	pdep	r11, r15, r9
+# CHECK: encoding: [0x62,0x52,0x87,0x08,0xf5,0xd9]
+         {evex}	pdep	r11, r15, r9
+
+# CHECK: {evex}	pdep	edx, ecx, dword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0xf2,0x77,0x08,0xf5,0x54,0x98,0x7b]
+         {evex}	pdep	edx, ecx, dword ptr [rax + 4*rbx + 123]
+
+# CHECK: {evex}	pdep	r15, r9, qword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x72,0xb7,0x08,0xf5,0x7c,0x98,0x7b]
+         {evex}	pdep	r15, r9, qword ptr [rax + 4*rbx + 123]
+
+# CHECK: pdep	r26d, r22d, r18d
+# CHECK: encoding: [0x62,0x6a,0x4f,0x00,0xf5,0xd2]
+         pdep	r26d, r22d, r18d
+
+# CHECK: pdep	r27, r23, r19
+# CHECK: encoding: [0x62,0x6a,0xc7,0x00,0xf5,0xdb]
+         pdep	r27, r23, r19
+
+# CHECK: pdep	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf5,0xb4,0xac,0x23,0x01,0x00,0x00]
+         pdep	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
+
+# CHECK: pdep	r23, r19, qword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf5,0xbc,0xac,0x23,0x01,0x00,0x00]
+         pdep	r23, r19, qword ptr [r28 + 4*r29 + 291]
+
+# CHECK: {evex}	pext	r10d, edx, ecx
+# CHECK: encoding: [0x62,0x72,0x6e,0x08,0xf5,0xd1]
+         {evex}	pext	r10d, edx, ecx
+
+# CHECK: {evex}	pext	r11, r15, r9
+# CHECK: encoding: [0x62,0x52,0x86,0x08,0xf5,0xd9]
+         {evex}	pext	r11, r15, r9
+
+# CHECK: {evex}	pext	edx, ecx, dword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0xf2,0x76,0x08,0xf5,0x54,0x98,0x7b]
+         {evex}	pext	edx, ecx, dword ptr [rax + 4*rbx + 123]
+
+# CHECK: {evex}	pext	r15, r9, qword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x72,0xb6,0x08,0xf5,0x7c,0x98,0x7b]
+         {evex}	pext	r15, r9, qword ptr [rax + 4*rbx + 123]
+
+# CHECK: pext	r26d, r22d, r18d
+# CHECK: encoding: [0x62,0x6a,0x4e,0x00,0xf5,0xd2]
+         pext	r26d, r22d, r18d
+
+# CHECK: pext	r27, r23, r19
+# CHECK: encoding: [0x62,0x6a,0xc6,0x00,0xf5,0xdb]
+         pext	r27, r23, r19
+
+# CHECK: pext	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x8a,0x6a,0x00,0xf5,0xb4,0xac,0x23,0x01,0x00,0x00]
+         pext	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
+
+# CHECK: pext	r23, r19, qword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x8a,0xe2,0x00,0xf5,0xbc,0xac,0x23,0x01,0x00,0x00]
+         pext	r23, r19, qword ptr [r28 + 4*r29 + 291]
+
+# CHECK: {evex}	rorx	edx, ecx, 123
+# CHECK: encoding: [0x62,0xf3,0x7f,0x08,0xf0,0xd1,0x7b]
+         {evex}	rorx	edx, ecx, 123
+
+# CHECK: {evex}	rorx	r15, r9, 123
+# CHECK: encoding: [0x62,0x53,0xff,0x08,0xf0,0xf9,0x7b]
+         {evex}	rorx	r15, r9, 123
+
+# CHECK: {evex}	rorx	ecx, dword ptr [rax + 4*rbx + 123], 123
+# CHECK: encoding: [0x62,0xf3,0x7f,0x08,0xf0,0x8c,0x98,0x7b,0x00,0x00,0x00,0x7b]
+         {evex}	rorx	ecx, dword ptr [rax + 4*rbx + 123], 123
+
+# CHECK: {evex}	rorx	r9, qword ptr [rax + 4*rbx + 123], 123
+# CHECK: encoding: [0x62,0x73,0xff,0x08,0xf0,0x8c,0x98,0x7b,0x00,0x00,0x00,0x7b]
+         {evex}	rorx	r9, qword ptr [rax + 4*rbx + 123], 123
+
+# CHECK: rorx	r22d, r18d, 123
+# CHECK: encoding: [0x62,0xeb,0x7f,0x08,0xf0,0xf2,0x7b]
+         rorx	r22d, r18d, 123
+
+# CHECK: rorx	r23, r19, 123
+# CHECK: encoding: [0x62,0xeb,0xff,0x08,0xf0,0xfb,0x7b]
+         rorx	r23, r19, 123
+
+# CHECK: rorx	r18d, dword ptr [r28 + 4*r29 + 291], 123
+# CHECK: encoding: [0x62,0x8b,0x7b,0x08,0xf0,0x94,0xac,0x23,0x01,0x00,0x00,0x7b]
+         rorx	r18d, dword ptr [r28 + 4*r29 + 291], 123
+
+# CHECK: rorx	r19, qword ptr [r28 + 4*r29 + 291], 123
+# CHECK: encoding: [0x62,0x8b,0xfb,0x08,0xf0,0x9c,0xac,0x23,0x01,0x00,0x00,0x7b]
+         rorx	r19, qword ptr [r28 + 4*r29 + 291], 123
+
+# CHECK: {evex}	sarx	r10d, edx, ecx
+# CHECK: encoding: [0x62,0x72,0x76,0x08,0xf7,0xd2]
+         {evex}	sarx	r10d, edx, ecx
+
+# CHECK: {evex}	sarx	edx, dword ptr [rax + 4*rbx + 123], ecx
+# CHECK: encoding: [0x62,0xf2,0x76,0x08,0xf7,0x94,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	sarx	edx, dword ptr [rax + 4*rbx + 123], ecx
+
+# CHECK: {evex}	sarx	r11, r15, r9
+# CHECK: encoding: [0x62,0x52,0xb6,0x08,0xf7,0xdf]
+         {evex}	sarx	r11, r15, r9
+
+# CHECK: {evex}	sarx	r15, qword ptr [rax + 4*rbx + 123], r9
+# CHECK: encoding: [0x62,0x72,0xb6,0x08,0xf7,0xbc,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	sarx	r15, qword ptr [rax + 4*rbx + 123], r9
+
+# CHECK: sarx	r26d, r22d, r18d
+# CHECK: encoding: [0x62,0x6a,0x6e,0x00,0xf7,0xd6]
+         sarx	r26d, r22d, r18d
+
+# CHECK: sarx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
+# CHECK: encoding: [0x62,0x8a,0x6a,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
+         sarx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
+
+# CHECK: sarx	r27, r23, r19
+# CHECK: encoding: [0x62,0x6a,0xe6,0x00,0xf7,0xdf]
+         sarx	r27, r23, r19
+
+# CHECK: sarx	r23, qword ptr [r28 + 4*r29 + 291], r19
+# CHECK: encoding: [0x62,0x8a,0xe2,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
+         sarx	r23, qword ptr [r28 + 4*r29 + 291], r19
+
+# CHECK: {evex}	shlx	r10d, edx, ecx
+# CHECK: encoding: [0x62,0x72,0x75,0x08,0xf7,0xd2]
+         {evex}	shlx	r10d, edx, ecx
+
+# CHECK: {evex}	shlx	edx, dword ptr [rax + 4*rbx + 123], ecx
+# CHECK: encoding: [0x62,0xf2,0x75,0x08,0xf7,0x94,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	shlx	edx, dword ptr [rax + 4*rbx + 123], ecx
+
+# CHECK: {evex}	shlx	r11, r15, r9
+# CHECK: encoding: [0x62,0x52,0xb5,0x08,0xf7,0xdf]
+         {evex}	shlx	r11, r15, r9
+
+# CHECK: {evex}	shlx	r15, qword ptr [rax + 4*rbx + 123], r9
+# CHECK: encoding: [0x62,0x72,0xb5,0x08,0xf7,0xbc,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	shlx	r15, qword ptr [rax + 4*rbx + 123], r9
+
+# CHECK: shlx	r26d, r22d, r18d
+# CHECK: encoding: [0x62,0x6a,0x6d,0x00,0xf7,0xd6]
+         shlx	r26d, r22d, r18d
+
+# CHECK: shlx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
+# CHECK: encoding: [0x62,0x8a,0x69,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
+         shlx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
+
+# CHECK: shlx	r27, r23, r19
+# CHECK: encoding: [0x62,0x6a,0xe5,0x00,0xf7,0xdf]
+         shlx	r27, r23, r19
+
+# CHECK: shlx	r23, qword ptr [r28 + 4*r29 + 291], r19
+# CHECK: encoding: [0x62,0x8a,0xe1,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
+         shlx	r23, qword ptr [r28 + 4*r29 + 291], r19
+
+# CHECK: {evex}	shrx	r10d, edx, ecx
+# CHECK: encoding: [0x62,0x72,0x77,0x08,0xf7,0xd2]
+         {evex}	shrx	r10d, edx, ecx
+
+# CHECK: {evex}	shrx	edx, dword ptr [rax + 4*rbx + 123], ecx
+# CHECK: encoding: [0x62,0xf2,0x77,0x08,0xf7,0x94,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	shrx	edx, dword ptr [rax + 4*rbx + 123], ecx
+
+# CHECK: {evex}	shrx	r11, r15, r9
+# CHECK: encoding: [0x62,0x52,0xb7,0x08,0xf7,0xdf]
+         {evex}	shrx	r11, r15, r9
+
+# CHECK: {evex}	shrx	r15, qword ptr [rax + 4*rbx + 123], r9
+# CHECK: encoding: [0x62,0x72,0xb7,0x08,0xf7,0xbc,0x98,0x7b,0x00,0x00,0x00]
+         {evex}	shrx	r15, qword ptr [rax + 4*rbx + 123], r9
+
+# CHECK: shrx	r26d, r22d, r18d
+# CHECK: encoding: [0x62,0x6a,0x6f,0x00,0xf7,0xd6]
+         shrx	r26d, r22d, r18d
+
+# CHECK: shrx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
+# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
+         shrx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
+
+# CHECK: shrx	r27, r23, r19
+# CHECK: encoding: [0x62,0x6a,0xe7,0x00,0xf7,0xdf]
+         shrx	r27, r23, r19
+
+# CHECK: shrx	r23, qword ptr [r28 + 4*r29 + 291], r19
+# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
+         shrx	r23, qword ptr [r28 + 4*r29 + 291], r19
diff --git a/llvm/test/MC/X86/apx/cet-att.s b/llvm/test/MC/X86/apx/cet-att.s
new file mode 100644
index 00000000000000..32ee371a4c2ae7
--- /dev/null
+++ b/llvm/test/MC/X86/apx/cet-att.s
@@ -0,0 +1,36 @@
+# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
+# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
+
+# ERROR-COUNT-8: error:
+# ERROR-NOT: error:
+# CHECK: {evex}	wrssd	%ecx, 123(%rax,%rbx,4)
+# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0x66,0x4c,0x98,0x7b]
+         {evex}	wrssd	%ecx, 123(%rax,%rbx,4)
+
+# CHECK: wrssd	%r18d, 291(%r28,%r29,4)
+# CHECK: encoding: [0x62,0x8c,0x78,0x08,0x66,0x94,0xac,0x23,0x01,0x00,0x00]
+         wrssd	%r18d, 291(%r28,%r29,4)
+
+# CHECK: {evex}	wrssq	%r9, 123(%rax,%rbx,4)
+# CHECK: encoding: [0x62,0x74,0xfc,0x08,0x66,0x4c,0x98,0x7b]
+         {evex}	wrssq	%r9, 123(%rax,%rbx,4)
+
+# CHECK: wrssq	%r19, 291(%r28,%r29,4)
+# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0x66,0x9c,0xac,0x23,0x01,0x00,0x00]
+         wrssq	%r19, 291(%r28,%r29,4)
+
+# CHECK: {evex}	wrussd	%ecx, 123(%rax,%rbx,4)
+# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0x65,0x4c,0x98,0x7b]
+         {evex}	wrussd	%ecx, 123(%rax,%rbx,4)
+
+# CHECK: wrussd	%r18d, 291(%r28,%r29,4)
+# CHECK: encoding: [0x62,0x8c,0x79,0x08,0x65,0x94,0xac,0x23,0x01,0x00,0x00]
+         wrussd	%r18d, 291(%r28,%r29,4)
+
+# CHECK: {evex}	wrussq	%r9, 123(%rax,%rbx,4)
+# CHECK: encoding: [0x62,0x74,0xfd,0x08,0x65,0x4c,0x98,0x7b]
+         {evex}	wrussq	%r9, 123(%rax,%rbx,4)
+
+# CHECK: wrussq	%r19, 291(%r28,%r29,4)
+# CHECK: encoding: [0x62,0x8c,0xf9,0x08,0x65,0x9c,0xac,0x23,0x01,0x00,0x00]
+         wrussq	%r19, 291(%r28,%r29,4)
diff --git a/llvm/test/MC/X86/apx/cet-intel.s b/llvm/test/MC/X86/apx/cet-intel.s
new file mode 100644
index 00000000000000..126bf5af43d505
--- /dev/null
+++ b/llvm/test/MC/X86/apx/cet-intel.s
@@ -0,0 +1,33 @@
+# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+# CHECK: {evex}	wrssd	dword ptr [rax + 4*rbx + 123], ecx
+# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0x66,0x4c,0x98,0x7b]
+         {evex}	wrssd	dword ptr [rax + 4*rbx + 123], ecx
+
+# CHECK: wrssd	dword ptr [r28 + 4*r29 + 291], r18d
+# CHECK: encoding: [0x62,0x8c,0x78,0x08,0x66,0x94,0xac,0x23,0x01,0x00,0x00]
+         wrssd	dword ptr [r28 + 4*r29 + 291], r18d
+
+# CHECK: {evex}	wrssq	qword ptr [rax + 4*rbx + 123], r9
+# CHECK: encoding: [0x62,0x74,0xfc,0x08,0x66,0x4c,0x98,0x7b]
+         {evex}	wrssq	qword ptr [rax + 4*rbx + 123], r9
+
+# CHECK: wrssq	qword ptr [r28 + 4*r29 + 291], r19
+# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0x66,0x9c,0xac,0x23,0x01,0x00,0x00]
+         wrssq	qword ptr [r28 + 4*r29 + 291], r19
+
+# CHECK: {evex}	wrussd	dword ptr [rax + 4*rbx + 123], ecx
+# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0x65,0x4c,0x98,0x7b]
+         {evex}	wrussd	dword ptr [rax + 4*rbx + 123], ecx
+
+# CHECK: wrussd	dword ptr [r28 + 4*r29 + 291], r18d
+# CHECK: encoding: [0x62,0x8c,0x79,0x08,0x65,0x94,0xac,0x23,0x01,0x00,0x00]
+         wrussd	dword ptr [r28 + 4*r29 + 291], r18d
+
+# CHECK: {evex}	wrussq	qword ptr [rax + 4*rbx + 123], r9
+# CHECK: encoding: [0x62,0x74,0xfd,0x08,0x65,0x4c,0x98,0x7b]
+         {evex}	wrussq	qword ptr [rax + 4*rbx + 123], r9
+
+# CHECK: wrussq	qword ptr [r28 + 4*r29 + 291], r19
+# CHECK: encoding: [0x62,0x8c,0xf9,0x08,0x65,0x9c,0xac,0x23,0x01,0x00,0x00]
+         wrussq	qword ptr [r28 + 4*r29 + 291], r19
diff --git a/llvm/test/MC/X86/apx/invept-att.s b/llvm/test/MC/X86/apx/invept-att.s
deleted file mode 100644
index 42840bf0b7308a..00000000000000
--- a/llvm/test/MC/X86/apx/invept-att.s
+++ /dev/null
@@ -1,8 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-1: error:
-# ERROR-NOT: error:
-# CHECK: invept	123(%r28,%r29,4), %r19
-# CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf0,0x5c,0xac,0x7b]
-         invept	123(%r28,%r29,4), %r19
diff --git a/llvm/test/MC/X86/apx/invept-intel.s b/llvm/test/MC/X86/apx/invept-intel.s
deleted file mode 100644
index 1c5fac234570da..00000000000000
--- a/llvm/test/MC/X86/apx/invept-intel.s
+++ /dev/null
@@ -1,5 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: invept	r19, xmmword ptr [r28 + 4*r29 + 123]
-# CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf0,0x5c,0xac,0x7b]
-         invept	r19, xmmword ptr [r28 + 4*r29 + 123]
diff --git a/llvm/test/MC/X86/apx/invvpid-att.s b/llvm/test/MC/X86/apx/invvpid-att.s
deleted file mode 100644
index a074891214606b..00000000000000
--- a/llvm/test/MC/X86/apx/invvpid-att.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-1: error:
-# ERROR-NOT: error:
-# CHECK: invvpid	291(%r28,%r29,4), %r19
-# CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf1,0x9c,0xac,0x23,0x01,0x00,0x00]
-         invvpid	291(%r28,%r29,4), %r19
-
diff --git a/llvm/test/MC/X86/apx/invvpid-intel.s b/llvm/test/MC/X86/apx/invvpid-intel.s
deleted file mode 100644
index cc4e3e9a618d64..00000000000000
--- a/llvm/test/MC/X86/apx/invvpid-intel.s
+++ /dev/null
@@ -1,5 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: invvpid	r19, xmmword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf1,0x9c,0xac,0x23,0x01,0x00,0x00]
-         invvpid	r19, xmmword ptr [r28 + 4*r29 + 291]
diff --git a/llvm/test/MC/X86/apx/movdir64b-att.s b/llvm/test/MC/X86/apx/movdir64b-att.s
index bc8f1a90c9ed6b..2956c5fd012983 100644
--- a/llvm/test/MC/X86/apx/movdir64b-att.s
+++ b/llvm/test/MC/X86/apx/movdir64b-att.s
@@ -1,8 +1,16 @@
 # RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
 # RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
 
-# ERROR-COUNT-2: error:
+# ERROR-COUNT-4: error:
 # ERROR-NOT: error:
+# CHECK: {evex}	movdir64b	123(%eax,%ebx,4), %ecx
+# CHECK: encoding: [0x67,0x62,0xf4,0x7d,0x08,0xf8,0x4c,0x98,0x7b]
+         {evex}	movdir64b	123(%eax,%ebx,4), %ecx
+
+# CHECK: {evex}	movdir64b	123(%rax,%rbx,4), %r9
+# CHECK: encoding: [0x62,0x74,0x7d,0x08,0xf8,0x4c,0x98,0x7b]
+         {evex}	movdir64b	123(%rax,%rbx,4), %r9
+
 # CHECK: movdir64b	291(%r28d,%r29d,4), %r18d
 # CHECK: encoding: [0x67,0x62,0x8c,0x79,0x08,0xf8,0x94,0xac,0x23,0x01,0x00,0x00]
          movdir64b	291(%r28d,%r29d,4), %r18d
diff --git a/llvm/test/MC/X86/apx/movdir64b-intel.s b/llvm/test/MC/X86/apx/movdir64b-intel.s
index b34efefeba2dae..fac9bb9ecd5333 100644
--- a/llvm/test/MC/X86/apx/movdir64b-intel.s
+++ b/llvm/test/MC/X86/apx/movdir64b-intel.s
@@ -1,5 +1,13 @@
 # RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
 
+# CHECK: {evex}	movdir64b	ecx, zmmword ptr [eax + 4*ebx + 123]
+# CHECK: encoding: [0x67,0x62,0xf4,0x7d,0x08,0xf8,0x4c,0x98,0x7b]
+         {evex}	movdir64b	ecx, zmmword ptr [eax + 4*ebx + 123]
+
+# CHECK: {evex}	movdir64b	r9, zmmword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x74,0x7d,0x08,0xf8,0x4c,0x98,0x7b]
+         {evex}	movdir64b	r9, zmmword ptr [rax + 4*rbx + 123]
+
 # CHECK: movdir64b	r18d, zmmword ptr [r28d + 4*r29d + 291]
 # CHECK: encoding: [0x67,0x62,0x8c,0x79,0x08,0xf8,0x94,0xac,0x23,0x01,0x00,0x00]
          movdir64b	r18d, zmmword ptr [r28d + 4*r29d + 291]
diff --git a/llvm/test/MC/X86/apx/movdiri-att.s b/llvm/test/MC/X86/apx/movdiri-att.s
index 8bdabf232f5dee..f951e314045582 100644
--- a/llvm/test/MC/X86/apx/movdiri-att.s
+++ b/llvm/test/MC/X86/apx/movdiri-att.s
@@ -1,8 +1,16 @@
 # RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
 # RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
 
-# ERROR-COUNT-2: error:
+# ERROR-COUNT-4: error:
 # ERROR-NOT: error:
+# CHECK: {evex}	movdiri	%ecx, 123(%eax,%ebx,4)
+# CHECK: encoding: [0x67,0x62,0xf4,0x7c,0x08,0xf9,0x4c,0x98,0x7b]
+         {evex}	movdiri	%ecx, 123(%eax,%ebx,4)
+
+# CHECK: {evex}	movdiri	%r9, 123(%rax,%rbx,4)
+# CHECK: encoding: [0x62,0x74,0xfc,0x08,0xf9,0x4c,0x98,0x7b]
+         {evex}	movdiri	%r9, 123(%rax,%rbx,4)
+
 # CHECK: movdiri	%r18d, 291(%r28,%r29,4)
 # CHECK: encoding: [0x62,0x8c,0x78,0x08,0xf9,0x94,0xac,0x23,0x01,0x00,0x00]
          movdiri	%r18d, 291(%r28,%r29,4)
diff --git a/llvm/test/MC/X86/apx/movdiri-intel.s b/llvm/test/MC/X86/apx/movdiri-intel.s
index 1a38384f9f96eb..16a5432253e726 100644
--- a/llvm/test/MC/X86/apx/movdiri-intel.s
+++ b/llvm/test/MC/X86/apx/movdiri-intel.s
@@ -1,5 +1,13 @@
 # RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
 
+# CHECK: {evex}	movdiri	dword ptr [eax + 4*ebx + 123], ecx
+# CHECK: encoding: [0x67,0x62,0xf4,0x7c,0x08,0xf9,0x4c,0x98,0x7b]
+         {evex}	movdiri	dword ptr [eax + 4*ebx + 123], ecx
+
+# CHECK: {evex}	movdiri	qword ptr [rax + 4*rbx + 123], r9
+# CHECK: encoding: [0x62,0x74,0xfc,0x08,0xf9,0x4c,0x98,0x7b]
+         {evex}	movdiri	qword ptr [rax + 4*rbx + 123], r9
+
 # CHECK: movdiri	dword ptr [r28 + 4*r29 + 291], r18d
 # CHECK: encoding: [0x62,0x8c,0x78,0x08,0xf9,0x94,0xac,0x23,0x01,0x00,0x00]
          movdiri	dword ptr [r28 + 4*r29 + 291], r18d
diff --git a/llvm/test/MC/X86/apx/mulx-att.s b/llvm/test/MC/X86/apx/mulx-att.s
deleted file mode 100644
index 976a79f469cd6f..00000000000000
--- a/llvm/test/MC/X86/apx/mulx-att.s
+++ /dev/null
@@ -1,20 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-4: error:
-# ERROR-NOT: error:
-# CHECK: mulxl	%r18d, %r22d, %r26d
-# CHECK: encoding: [0x62,0x6a,0x4f,0x00,0xf6,0xd2]
-         mulxl	%r18d, %r22d, %r26d
-
-# CHECK: mulxq	%r19, %r23, %r27
-# CHECK: encoding: [0x62,0x6a,0xc7,0x00,0xf6,0xdb]
-         mulxq	%r19, %r23, %r27
-
-# CHECK: mulxl	291(%r28,%r29,4), %r18d, %r22d
-# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf6,0xb4,0xac,0x23,0x01,0x00,0x00]
-         mulxl	291(%r28,%r29,4), %r18d, %r22d
-
-# CHECK: mulxq	291(%r28,%r29,4), %r19, %r23
-# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf6,0xbc,0xac,0x23,0x01,0x00,0x00]
-         mulxq	291(%r28,%r29,4), %r19, %r23
diff --git a/llvm/test/MC/X86/apx/mulx-intel.s b/llvm/test/MC/X86/apx/mulx-intel.s
deleted file mode 100644
index 3db587502915df..00000000000000
--- a/llvm/test/MC/X86/apx/mulx-intel.s
+++ /dev/null
@@ -1,17 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: mulx	r26d, r22d, r18d
-# CHECK: encoding: [0x62,0x6a,0x4f,0x00,0xf6,0xd2]
-         mulx	r26d, r22d, r18d
-
-# CHECK: mulx	r27, r23, r19
-# CHECK: encoding: [0x62,0x6a,0xc7,0x00,0xf6,0xdb]
-         mulx	r27, r23, r19
-
-# CHECK: mulx	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf6,0xb4,0xac,0x23,0x01,0x00,0x00]
-         mulx	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
-
-# CHECK: mulx	r23, r19, qword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf6,0xbc,0xac,0x23,0x01,0x00,0x00]
-         mulx	r23, r19, qword ptr [r28 + 4*r29 + 291]
diff --git a/llvm/test/MC/X86/apx/pdep-att.s b/llvm/test/MC/X86/apx/pdep-att.s
deleted file mode 100644
index c319b17e47f6fc..00000000000000
--- a/llvm/test/MC/X86/apx/pdep-att.s
+++ /dev/null
@@ -1,20 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-4: error:
-# ERROR-NOT: error:
-# CHECK: pdepl	%r18d, %r22d, %r26d
-# CHECK: encoding: [0x62,0x6a,0x4f,0x00,0xf5,0xd2]
-         pdepl	%r18d, %r22d, %r26d
-
-# CHECK: pdepq	%r19, %r23, %r27
-# CHECK: encoding: [0x62,0x6a,0xc7,0x00,0xf5,0xdb]
-         pdepq	%r19, %r23, %r27
-
-# CHECK: pdepl	291(%r28,%r29,4), %r18d, %r22d
-# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf5,0xb4,0xac,0x23,0x01,0x00,0x00]
-         pdepl	291(%r28,%r29,4), %r18d, %r22d
-
-# CHECK: pdepq	291(%r28,%r29,4), %r19, %r23
-# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf5,0xbc,0xac,0x23,0x01,0x00,0x00]
-         pdepq	291(%r28,%r29,4), %r19, %r23
diff --git a/llvm/test/MC/X86/apx/pdep-intel.s b/llvm/test/MC/X86/apx/pdep-intel.s
deleted file mode 100644
index 0f9e828c021c3a..00000000000000
--- a/llvm/test/MC/X86/apx/pdep-intel.s
+++ /dev/null
@@ -1,17 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: pdep	r26d, r22d, r18d
-# CHECK: encoding: [0x62,0x6a,0x4f,0x00,0xf5,0xd2]
-         pdep	r26d, r22d, r18d
-
-# CHECK: pdep	r27, r23, r19
-# CHECK: encoding: [0x62,0x6a,0xc7,0x00,0xf5,0xdb]
-         pdep	r27, r23, r19
-
-# CHECK: pdep	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf5,0xb4,0xac,0x23,0x01,0x00,0x00]
-         pdep	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
-
-# CHECK: pdep	r23, r19, qword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf5,0xbc,0xac,0x23,0x01,0x00,0x00]
-         pdep	r23, r19, qword ptr [r28 + 4*r29 + 291]
diff --git a/llvm/test/MC/X86/apx/pext-att.s b/llvm/test/MC/X86/apx/pext-att.s
deleted file mode 100644
index c07fa1ac2082af..00000000000000
--- a/llvm/test/MC/X86/apx/pext-att.s
+++ /dev/null
@@ -1,20 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-4: error:
-# ERROR-NOT: error:
-# CHECK: pextl	%r18d, %r22d, %r26d
-# CHECK: encoding: [0x62,0x6a,0x4e,0x00,0xf5,0xd2]
-         pextl	%r18d, %r22d, %r26d
-
-# CHECK: pextq	%r19, %r23, %r27
-# CHECK: encoding: [0x62,0x6a,0xc6,0x00,0xf5,0xdb]
-         pextq	%r19, %r23, %r27
-
-# CHECK: pextl	291(%r28,%r29,4), %r18d, %r22d
-# CHECK: encoding: [0x62,0x8a,0x6a,0x00,0xf5,0xb4,0xac,0x23,0x01,0x00,0x00]
-         pextl	291(%r28,%r29,4), %r18d, %r22d
-
-# CHECK: pextq	291(%r28,%r29,4), %r19, %r23
-# CHECK: encoding: [0x62,0x8a,0xe2,0x00,0xf5,0xbc,0xac,0x23,0x01,0x00,0x00]
-         pextq	291(%r28,%r29,4), %r19, %r23
diff --git a/llvm/test/MC/X86/apx/pext-intel.s b/llvm/test/MC/X86/apx/pext-intel.s
deleted file mode 100644
index 9a7e7d93094a42..00000000000000
--- a/llvm/test/MC/X86/apx/pext-intel.s
+++ /dev/null
@@ -1,17 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: pext	r26d, r22d, r18d
-# CHECK: encoding: [0x62,0x6a,0x4e,0x00,0xf5,0xd2]
-         pext	r26d, r22d, r18d
-
-# CHECK: pext	r27, r23, r19
-# CHECK: encoding: [0x62,0x6a,0xc6,0x00,0xf5,0xdb]
-         pext	r27, r23, r19
-
-# CHECK: pext	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x8a,0x6a,0x00,0xf5,0xb4,0xac,0x23,0x01,0x00,0x00]
-         pext	r22d, r18d, dword ptr [r28 + 4*r29 + 291]
-
-# CHECK: pext	r23, r19, qword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x8a,0xe2,0x00,0xf5,0xbc,0xac,0x23,0x01,0x00,0x00]
-         pext	r23, r19, qword ptr [r28 + 4*r29 + 291]
diff --git a/llvm/test/MC/X86/apx/rorx-att.s b/llvm/test/MC/X86/apx/rorx-att.s
deleted file mode 100644
index fb613d95c7cb43..00000000000000
--- a/llvm/test/MC/X86/apx/rorx-att.s
+++ /dev/null
@@ -1,20 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-4: error:
-# ERROR-NOT: error:
-# CHECK: rorxl	$123, %r18d, %r22d
-# CHECK: encoding: [0x62,0xeb,0x7f,0x08,0xf0,0xf2,0x7b]
-         rorxl	$123, %r18d, %r22d
-
-# CHECK: rorxq	$123, %r19, %r23
-# CHECK: encoding: [0x62,0xeb,0xff,0x08,0xf0,0xfb,0x7b]
-         rorxq	$123, %r19, %r23
-
-# CHECK: rorxl	$123, 291(%r28,%r29,4), %r18d
-# CHECK: encoding: [0x62,0x8b,0x7b,0x08,0xf0,0x94,0xac,0x23,0x01,0x00,0x00,0x7b]
-         rorxl	$123, 291(%r28,%r29,4), %r18d
-
-# CHECK: rorxq	$123, 291(%r28,%r29,4), %r19
-# CHECK: encoding: [0x62,0x8b,0xfb,0x08,0xf0,0x9c,0xac,0x23,0x01,0x00,0x00,0x7b]
-         rorxq	$123, 291(%r28,%r29,4), %r19
diff --git a/llvm/test/MC/X86/apx/rorx-intel.s b/llvm/test/MC/X86/apx/rorx-intel.s
deleted file mode 100644
index d3e63559cba579..00000000000000
--- a/llvm/test/MC/X86/apx/rorx-intel.s
+++ /dev/null
@@ -1,17 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: rorx	r22d, r18d, 123
-# CHECK: encoding: [0x62,0xeb,0x7f,0x08,0xf0,0xf2,0x7b]
-         rorx	r22d, r18d, 123
-
-# CHECK: rorx	r23, r19, 123
-# CHECK: encoding: [0x62,0xeb,0xff,0x08,0xf0,0xfb,0x7b]
-         rorx	r23, r19, 123
-
-# CHECK: rorx	r18d, dword ptr [r28 + 4*r29 + 291], 123
-# CHECK: encoding: [0x62,0x8b,0x7b,0x08,0xf0,0x94,0xac,0x23,0x01,0x00,0x00,0x7b]
-         rorx	r18d, dword ptr [r28 + 4*r29 + 291], 123
-
-# CHECK: rorx	r19, qword ptr [r28 + 4*r29 + 291], 123
-# CHECK: encoding: [0x62,0x8b,0xfb,0x08,0xf0,0x9c,0xac,0x23,0x01,0x00,0x00,0x7b]
-         rorx	r19, qword ptr [r28 + 4*r29 + 291], 123
diff --git a/llvm/test/MC/X86/apx/sarx-att.s b/llvm/test/MC/X86/apx/sarx-att.s
deleted file mode 100644
index a174903d976cbf..00000000000000
--- a/llvm/test/MC/X86/apx/sarx-att.s
+++ /dev/null
@@ -1,20 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-4: error:
-# ERROR-NOT: error:
-# CHECK: sarxl	%r18d, %r22d, %r26d
-# CHECK: encoding: [0x62,0x6a,0x6e,0x00,0xf7,0xd6]
-         sarxl	%r18d, %r22d, %r26d
-
-# CHECK: sarxl	%r18d, 291(%r28,%r29,4), %r22d
-# CHECK: encoding: [0x62,0x8a,0x6a,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
-         sarxl	%r18d, 291(%r28,%r29,4), %r22d
-
-# CHECK: sarxq	%r19, %r23, %r27
-# CHECK: encoding: [0x62,0x6a,0xe6,0x00,0xf7,0xdf]
-         sarxq	%r19, %r23, %r27
-
-# CHECK: sarxq	%r19, 291(%r28,%r29,4), %r23
-# CHECK: encoding: [0x62,0x8a,0xe2,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
-         sarxq	%r19, 291(%r28,%r29,4), %r23
diff --git a/llvm/test/MC/X86/apx/sarx-intel.s b/llvm/test/MC/X86/apx/sarx-intel.s
deleted file mode 100644
index 962b6ec313b987..00000000000000
--- a/llvm/test/MC/X86/apx/sarx-intel.s
+++ /dev/null
@@ -1,17 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: sarx	r26d, r22d, r18d
-# CHECK: encoding: [0x62,0x6a,0x6e,0x00,0xf7,0xd6]
-         sarx	r26d, r22d, r18d
-
-# CHECK: sarx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
-# CHECK: encoding: [0x62,0x8a,0x6a,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
-         sarx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
-
-# CHECK: sarx	r27, r23, r19
-# CHECK: encoding: [0x62,0x6a,0xe6,0x00,0xf7,0xdf]
-         sarx	r27, r23, r19
-
-# CHECK: sarx	r23, qword ptr [r28 + 4*r29 + 291], r19
-# CHECK: encoding: [0x62,0x8a,0xe2,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
-         sarx	r23, qword ptr [r28 + 4*r29 + 291], r19
diff --git a/llvm/test/MC/X86/apx/sha-att.s b/llvm/test/MC/X86/apx/sha-att.s
new file mode 100644
index 00000000000000..f87628662328ed
--- /dev/null
+++ b/llvm/test/MC/X86/apx/sha-att.s
@@ -0,0 +1,112 @@
+# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
+# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
+
+# ERROR-COUNT-27: error:
+# ERROR-NOT: error:
+# CHECK: {evex}	sha1msg1	%xmm13, %xmm12
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xd9,0xe5]
+         {evex}	sha1msg1	%xmm13, %xmm12
+
+# CHECK: {evex}	sha1msg1	123(%rax,%rbx,4), %xmm12
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xd9,0x64,0x98,0x7b]
+         {evex}	sha1msg1	123(%rax,%rbx,4), %xmm12
+
+# CHECK: sha1msg1	%xmm13, %xmm12
+# CHECK: encoding: [0x45,0x0f,0x38,0xc9,0xe5]
+         sha1msg1	%xmm13, %xmm12
+
+# CHECK: sha1msg1	291(%r28,%r29,4), %xmm12
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd9,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha1msg1	291(%r28,%r29,4), %xmm12
+
+# CHECK: {evex}	sha1msg2	%xmm13, %xmm12
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xda,0xe5]
+         {evex}	sha1msg2	%xmm13, %xmm12
+
+# CHECK: {evex}	sha1msg2	123(%rax,%rbx,4), %xmm12
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xda,0x64,0x98,0x7b]
+         {evex}	sha1msg2	123(%rax,%rbx,4), %xmm12
+
+# CHECK: sha1msg2	%xmm13, %xmm12
+# CHECK: encoding: [0x45,0x0f,0x38,0xca,0xe5]
+         sha1msg2	%xmm13, %xmm12
+
+# CHECK: sha1msg2	291(%r28,%r29,4), %xmm12
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xda,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha1msg2	291(%r28,%r29,4), %xmm12
+
+# CHECK: {evex}	sha1nexte	%xmm13, %xmm12
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xd8,0xe5]
+         {evex}	sha1nexte	%xmm13, %xmm12
+
+# CHECK: {evex}	sha1nexte	123(%rax,%rbx,4), %xmm12
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xd8,0x64,0x98,0x7b]
+         {evex}	sha1nexte	123(%rax,%rbx,4), %xmm12
+
+# CHECK: sha1nexte	%xmm13, %xmm12
+# CHECK: encoding: [0x45,0x0f,0x38,0xc8,0xe5]
+         sha1nexte	%xmm13, %xmm12
+
+# CHECK: sha1nexte	291(%r28,%r29,4), %xmm12
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd8,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha1nexte	291(%r28,%r29,4), %xmm12
+
+# CHECK: {evex}	sha1rnds4	$123, %xmm13, %xmm12
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xd4,0xe5,0x7b]
+         {evex}	sha1rnds4	$123, %xmm13, %xmm12
+
+# CHECK: {evex}	sha1rnds4	$123, 123(%rax,%rbx,4), %xmm12
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xd4,0x64,0x98,0x7b,0x7b]
+         {evex}	sha1rnds4	$123, 123(%rax,%rbx,4), %xmm12
+
+# CHECK: sha1rnds4	$123, %xmm13, %xmm12
+# CHECK: encoding: [0x45,0x0f,0x3a,0xcc,0xe5,0x7b]
+         sha1rnds4	$123, %xmm13, %xmm12
+
+# CHECK: sha1rnds4	$123, 291(%r28,%r29,4), %xmm12
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd4,0xa4,0xac,0x23,0x01,0x00,0x00,0x7b]
+         sha1rnds4	$123, 291(%r28,%r29,4), %xmm12
+
+# CHECK: {evex}	sha256msg1	%xmm13, %xmm12
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xdc,0xe5]
+         {evex}	sha256msg1	%xmm13, %xmm12
+
+# CHECK: {evex}	sha256msg1	123(%rax,%rbx,4), %xmm12
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xdc,0x64,0x98,0x7b]
+         {evex}	sha256msg1	123(%rax,%rbx,4), %xmm12
+
+# CHECK: sha256msg1	%xmm13, %xmm12
+# CHECK: encoding: [0x45,0x0f,0x38,0xcc,0xe5]
+         sha256msg1	%xmm13, %xmm12
+
+# CHECK: sha256msg1	291(%r28,%r29,4), %xmm12
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdc,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha256msg1	291(%r28,%r29,4), %xmm12
+
+# CHECK: {evex}	sha256msg2	%xmm13, %xmm12
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xdd,0xe5]
+         {evex}	sha256msg2	%xmm13, %xmm12
+
+# CHECK: {evex}	sha256msg2	123(%rax,%rbx,4), %xmm12
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xdd,0x64,0x98,0x7b]
+         {evex}	sha256msg2	123(%rax,%rbx,4), %xmm12
+
+# CHECK: sha256msg2	%xmm13, %xmm12
+# CHECK: encoding: [0x45,0x0f,0x38,0xcd,0xe5]
+         sha256msg2	%xmm13, %xmm12
+
+# CHECK: sha256msg2	291(%r28,%r29,4), %xmm12
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdd,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha256msg2	291(%r28,%r29,4), %xmm12
+
+# CHECK: {evex}	sha256rnds2	%xmm0, 123(%rax,%rbx,4), %xmm12
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xdb,0x64,0x98,0x7b]
+         {evex}	sha256rnds2	%xmm0, 123(%rax,%rbx,4), %xmm12
+
+# CHECK: sha256rnds2	%xmm0, %xmm13, %xmm12
+# CHECK: encoding: [0x45,0x0f,0x38,0xcb,0xe5]
+         sha256rnds2	%xmm0, %xmm13, %xmm12
+
+# CHECK: sha256rnds2	%xmm0, 291(%r28,%r29,4), %xmm12
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdb,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha256rnds2	%xmm0, 291(%r28,%r29,4), %xmm12
diff --git a/llvm/test/MC/X86/apx/sha-intel.s b/llvm/test/MC/X86/apx/sha-intel.s
new file mode 100644
index 00000000000000..75ad2ee4aa2d57
--- /dev/null
+++ b/llvm/test/MC/X86/apx/sha-intel.s
@@ -0,0 +1,109 @@
+# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+# CHECK: {evex}	sha1msg1	xmm12, xmm13
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xd9,0xe5]
+         {evex}	sha1msg1	xmm12, xmm13
+
+# CHECK: {evex}	sha1msg1	xmm12, xmmword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xd9,0x64,0x98,0x7b]
+         {evex}	sha1msg1	xmm12, xmmword ptr [rax + 4*rbx + 123]
+
+# CHECK: sha1msg1	xmm12, xmm13
+# CHECK: encoding: [0x45,0x0f,0x38,0xc9,0xe5]
+         sha1msg1	xmm12, xmm13
+
+# CHECK: sha1msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd9,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha1msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+
+# CHECK: {evex}	sha1msg2	xmm12, xmm13
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xda,0xe5]
+         {evex}	sha1msg2	xmm12, xmm13
+
+# CHECK: {evex}	sha1msg2	xmm12, xmmword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xda,0x64,0x98,0x7b]
+         {evex}	sha1msg2	xmm12, xmmword ptr [rax + 4*rbx + 123]
+
+# CHECK: sha1msg2	xmm12, xmm13
+# CHECK: encoding: [0x45,0x0f,0x38,0xca,0xe5]
+         sha1msg2	xmm12, xmm13
+
+# CHECK: sha1msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xda,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha1msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+
+# CHECK: {evex}	sha1nexte	xmm12, xmm13
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xd8,0xe5]
+         {evex}	sha1nexte	xmm12, xmm13
+
+# CHECK: {evex}	sha1nexte	xmm12, xmmword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xd8,0x64,0x98,0x7b]
+         {evex}	sha1nexte	xmm12, xmmword ptr [rax + 4*rbx + 123]
+
+# CHECK: sha1nexte	xmm12, xmm13
+# CHECK: encoding: [0x45,0x0f,0x38,0xc8,0xe5]
+         sha1nexte	xmm12, xmm13
+
+# CHECK: sha1nexte	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd8,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha1nexte	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+
+# CHECK: {evex}	sha1rnds4	xmm12, xmm13, 123
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xd4,0xe5,0x7b]
+         {evex}	sha1rnds4	xmm12, xmm13, 123
+
+# CHECK: {evex}	sha1rnds4	xmm12, xmmword ptr [rax + 4*rbx + 123], 123
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xd4,0x64,0x98,0x7b,0x7b]
+         {evex}	sha1rnds4	xmm12, xmmword ptr [rax + 4*rbx + 123], 123
+
+# CHECK: sha1rnds4	xmm12, xmm13, 123
+# CHECK: encoding: [0x45,0x0f,0x3a,0xcc,0xe5,0x7b]
+         sha1rnds4	xmm12, xmm13, 123
+
+# CHECK: sha1rnds4	xmm12, xmmword ptr [r28 + 4*r29 + 291], 123
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd4,0xa4,0xac,0x23,0x01,0x00,0x00,0x7b]
+         sha1rnds4	xmm12, xmmword ptr [r28 + 4*r29 + 291], 123
+
+# CHECK: {evex}	sha256msg1	xmm12, xmm13
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xdc,0xe5]
+         {evex}	sha256msg1	xmm12, xmm13
+
+# CHECK: {evex}	sha256msg1	xmm12, xmmword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xdc,0x64,0x98,0x7b]
+         {evex}	sha256msg1	xmm12, xmmword ptr [rax + 4*rbx + 123]
+
+# CHECK: sha256msg1	xmm12, xmm13
+# CHECK: encoding: [0x45,0x0f,0x38,0xcc,0xe5]
+         sha256msg1	xmm12, xmm13
+
+# CHECK: sha256msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdc,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha256msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+
+# CHECK: {evex}	sha256msg2	xmm12, xmm13
+# CHECK: encoding: [0x62,0x54,0x7c,0x08,0xdd,0xe5]
+         {evex}	sha256msg2	xmm12, xmm13
+
+# CHECK: {evex}	sha256msg2	xmm12, xmmword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xdd,0x64,0x98,0x7b]
+         {evex}	sha256msg2	xmm12, xmmword ptr [rax + 4*rbx + 123]
+
+# CHECK: sha256msg2	xmm12, xmm13
+# CHECK: encoding: [0x45,0x0f,0x38,0xcd,0xe5]
+         sha256msg2	xmm12, xmm13
+
+# CHECK: sha256msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdd,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha256msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
+
+# CHECK: {evex}	sha256rnds2	xmm12, xmmword ptr [rax + 4*rbx + 123], xmm0
+# CHECK: encoding: [0x62,0x74,0x7c,0x08,0xdb,0x64,0x98,0x7b]
+         {evex}	sha256rnds2	xmm12, xmmword ptr [rax + 4*rbx + 123], xmm0
+
+# CHECK: sha256rnds2	xmm12, xmm13, xmm0
+# CHECK: encoding: [0x45,0x0f,0x38,0xcb,0xe5]
+         sha256rnds2	xmm12, xmm13, xmm0
+
+# CHECK: sha256rnds2	xmm12, xmmword ptr [r28 + 4*r29 + 291], xmm0
+# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdb,0xa4,0xac,0x23,0x01,0x00,0x00]
+         sha256rnds2	xmm12, xmmword ptr [r28 + 4*r29 + 291], xmm0
diff --git a/llvm/test/MC/X86/apx/sha1msg1-att.s b/llvm/test/MC/X86/apx/sha1msg1-att.s
deleted file mode 100644
index 900b1b703c48ba..00000000000000
--- a/llvm/test/MC/X86/apx/sha1msg1-att.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-
-# CHECK: sha1msg1	%xmm13, %xmm12
-# CHECK: encoding: [0x45,0x0f,0x38,0xc9,0xe5]
-         sha1msg1	%xmm13, %xmm12
-
-# CHECK: sha1msg1	291(%r28,%r29,4), %xmm12
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd9,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha1msg1	291(%r28,%r29,4), %xmm12
diff --git a/llvm/test/MC/X86/apx/sha1msg1-intel.s b/llvm/test/MC/X86/apx/sha1msg1-intel.s
deleted file mode 100644
index d347a671069f55..00000000000000
--- a/llvm/test/MC/X86/apx/sha1msg1-intel.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: sha1msg1	xmm12, xmm13
-# CHECK: encoding: [0x45,0x0f,0x38,0xc9,0xe5]
-         sha1msg1	xmm12, xmm13
-
-# CHECK: sha1msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd9,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha1msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
diff --git a/llvm/test/MC/X86/apx/sha1msg2-att.s b/llvm/test/MC/X86/apx/sha1msg2-att.s
deleted file mode 100644
index 62557e46f8b9d0..00000000000000
--- a/llvm/test/MC/X86/apx/sha1msg2-att.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-
-# CHECK: sha1msg2	%xmm13, %xmm12
-# CHECK: encoding: [0x45,0x0f,0x38,0xca,0xe5]
-         sha1msg2	%xmm13, %xmm12
-
-# CHECK: sha1msg2	291(%r28,%r29,4), %xmm12
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xda,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha1msg2	291(%r28,%r29,4), %xmm12
diff --git a/llvm/test/MC/X86/apx/sha1msg2-intel.s b/llvm/test/MC/X86/apx/sha1msg2-intel.s
deleted file mode 100644
index 546a56263bbe20..00000000000000
--- a/llvm/test/MC/X86/apx/sha1msg2-intel.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: sha1msg2	xmm12, xmm13
-# CHECK: encoding: [0x45,0x0f,0x38,0xca,0xe5]
-         sha1msg2	xmm12, xmm13
-
-# CHECK: sha1msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xda,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha1msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
diff --git a/llvm/test/MC/X86/apx/sha1nexte-att.s b/llvm/test/MC/X86/apx/sha1nexte-att.s
deleted file mode 100644
index 70e8300cb70a7c..00000000000000
--- a/llvm/test/MC/X86/apx/sha1nexte-att.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-
-# CHECK: sha1nexte	%xmm13, %xmm12
-# CHECK: encoding: [0x45,0x0f,0x38,0xc8,0xe5]
-         sha1nexte	%xmm13, %xmm12
-
-# CHECK: sha1nexte	291(%r28,%r29,4), %xmm12
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd8,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha1nexte	291(%r28,%r29,4), %xmm12
diff --git a/llvm/test/MC/X86/apx/sha1nexte-intel.s b/llvm/test/MC/X86/apx/sha1nexte-intel.s
deleted file mode 100644
index 1c890c3cda44ad..00000000000000
--- a/llvm/test/MC/X86/apx/sha1nexte-intel.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: sha1nexte	xmm12, xmm13
-# CHECK: encoding: [0x45,0x0f,0x38,0xc8,0xe5]
-         sha1nexte	xmm12, xmm13
-
-# CHECK: sha1nexte	xmm12, xmmword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd8,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha1nexte	xmm12, xmmword ptr [r28 + 4*r29 + 291]
diff --git a/llvm/test/MC/X86/apx/sha1rnds4-att.s b/llvm/test/MC/X86/apx/sha1rnds4-att.s
deleted file mode 100644
index 1d24c83a0b30e5..00000000000000
--- a/llvm/test/MC/X86/apx/sha1rnds4-att.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-
-# CHECK: sha1rnds4	$123, %xmm13, %xmm12
-# CHECK: encoding: [0x45,0x0f,0x3a,0xcc,0xe5,0x7b]
-         sha1rnds4	$123, %xmm13, %xmm12
-
-# CHECK: sha1rnds4	$123, 291(%r28,%r29,4), %xmm12
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd4,0xa4,0xac,0x23,0x01,0x00,0x00,0x7b]
-         sha1rnds4	$123, 291(%r28,%r29,4), %xmm12
diff --git a/llvm/test/MC/X86/apx/sha1rnds4-intel.s b/llvm/test/MC/X86/apx/sha1rnds4-intel.s
deleted file mode 100644
index 53620856bbf0fc..00000000000000
--- a/llvm/test/MC/X86/apx/sha1rnds4-intel.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: sha1rnds4	xmm12, xmm13, 123
-# CHECK: encoding: [0x45,0x0f,0x3a,0xcc,0xe5,0x7b]
-         sha1rnds4	xmm12, xmm13, 123
-
-# CHECK: sha1rnds4	xmm12, xmmword ptr [r28 + 4*r29 + 291], 123
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xd4,0xa4,0xac,0x23,0x01,0x00,0x00,0x7b]
-         sha1rnds4	xmm12, xmmword ptr [r28 + 4*r29 + 291], 123
diff --git a/llvm/test/MC/X86/apx/sha256msg1-att.s b/llvm/test/MC/X86/apx/sha256msg1-att.s
deleted file mode 100644
index c6d833dc78039a..00000000000000
--- a/llvm/test/MC/X86/apx/sha256msg1-att.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-
-# CHECK: sha256msg1	%xmm13, %xmm12
-# CHECK: encoding: [0x45,0x0f,0x38,0xcc,0xe5]
-         sha256msg1	%xmm13, %xmm12
-
-# CHECK: sha256msg1	291(%r28,%r29,4), %xmm12
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdc,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha256msg1	291(%r28,%r29,4), %xmm12
diff --git a/llvm/test/MC/X86/apx/sha256msg1-intel.s b/llvm/test/MC/X86/apx/sha256msg1-intel.s
deleted file mode 100644
index e3e96f9e2f7d55..00000000000000
--- a/llvm/test/MC/X86/apx/sha256msg1-intel.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: sha256msg1	xmm12, xmm13
-# CHECK: encoding: [0x45,0x0f,0x38,0xcc,0xe5]
-         sha256msg1	xmm12, xmm13
-
-# CHECK: sha256msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdc,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha256msg1	xmm12, xmmword ptr [r28 + 4*r29 + 291]
diff --git a/llvm/test/MC/X86/apx/sha256msg2-att.s b/llvm/test/MC/X86/apx/sha256msg2-att.s
deleted file mode 100644
index 96528d90c3f4a1..00000000000000
--- a/llvm/test/MC/X86/apx/sha256msg2-att.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-
-# CHECK: sha256msg2	%xmm13, %xmm12
-# CHECK: encoding: [0x45,0x0f,0x38,0xcd,0xe5]
-         sha256msg2	%xmm13, %xmm12
-
-# CHECK: sha256msg2	291(%r28,%r29,4), %xmm12
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdd,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha256msg2	291(%r28,%r29,4), %xmm12
diff --git a/llvm/test/MC/X86/apx/sha256msg2-intel.s b/llvm/test/MC/X86/apx/sha256msg2-intel.s
deleted file mode 100644
index 043633de1c0413..00000000000000
--- a/llvm/test/MC/X86/apx/sha256msg2-intel.s
+++ /dev/null
@@ -1,9 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: sha256msg2	xmm12, xmm13
-# CHECK: encoding: [0x45,0x0f,0x38,0xcd,0xe5]
-         sha256msg2	xmm12, xmm13
-
-# CHECK: sha256msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdd,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha256msg2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
diff --git a/llvm/test/MC/X86/apx/sha256rnds2-att.s b/llvm/test/MC/X86/apx/sha256rnds2-att.s
deleted file mode 100644
index 3071d40babf5bd..00000000000000
--- a/llvm/test/MC/X86/apx/sha256rnds2-att.s
+++ /dev/null
@@ -1,13 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-
-# CHECK: sha256rnds2	%xmm0, %xmm13, %xmm12
-# CHECK: encoding: [0x45,0x0f,0x38,0xcb,0xe5]
-         sha256rnds2	%xmm0, %xmm13, %xmm12
-
-# CHECK: sha256rnds2	%xmm0, 291(%r28,%r29,4), %xmm12
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdb,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha256rnds2	%xmm0, 291(%r28,%r29,4), %xmm12
-
-# CHECK: sha256rnds2	%xmm0, 291(%r28,%r29,4), %xmm12
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdb,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha256rnds2	291(%r28,%r29,4), %xmm12
diff --git a/llvm/test/MC/X86/apx/sha256rnds2-intel.s b/llvm/test/MC/X86/apx/sha256rnds2-intel.s
deleted file mode 100644
index 7630f3c2cd22f4..00000000000000
--- a/llvm/test/MC/X86/apx/sha256rnds2-intel.s
+++ /dev/null
@@ -1,14 +0,0 @@
-
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: sha256rnds2	xmm12, xmm13, xmm0
-# CHECK: encoding: [0x45,0x0f,0x38,0xcb,0xe5]
-         sha256rnds2	xmm12, xmm13, xmm0
-
-# CHECK: sha256rnds2	xmm12, xmmword ptr [r28 + 4*r29 + 291], xmm0
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdb,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha256rnds2	xmm12, xmmword ptr [r28 + 4*r29 + 291], xmm0
-
-# CHECK: sha256rnds2	xmm12, xmmword ptr [r28 + 4*r29 + 291], xmm0
-# CHECK: encoding: [0x62,0x1c,0x78,0x08,0xdb,0xa4,0xac,0x23,0x01,0x00,0x00]
-         sha256rnds2	xmm12, xmmword ptr [r28 + 4*r29 + 291]
diff --git a/llvm/test/MC/X86/apx/shlx-att.s b/llvm/test/MC/X86/apx/shlx-att.s
deleted file mode 100644
index 4e28119f083056..00000000000000
--- a/llvm/test/MC/X86/apx/shlx-att.s
+++ /dev/null
@@ -1,20 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-4: error:
-# ERROR-NOT: error:
-# CHECK: shlxl	%r18d, %r22d, %r26d
-# CHECK: encoding: [0x62,0x6a,0x6d,0x00,0xf7,0xd6]
-         shlxl	%r18d, %r22d, %r26d
-
-# CHECK: shlxl	%r18d, 291(%r28,%r29,4), %r22d
-# CHECK: encoding: [0x62,0x8a,0x69,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
-         shlxl	%r18d, 291(%r28,%r29,4), %r22d
-
-# CHECK: shlxq	%r19, %r23, %r27
-# CHECK: encoding: [0x62,0x6a,0xe5,0x00,0xf7,0xdf]
-         shlxq	%r19, %r23, %r27
-
-# CHECK: shlxq	%r19, 291(%r28,%r29,4), %r23
-# CHECK: encoding: [0x62,0x8a,0xe1,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
-         shlxq	%r19, 291(%r28,%r29,4), %r23
diff --git a/llvm/test/MC/X86/apx/shlx-intel.s b/llvm/test/MC/X86/apx/shlx-intel.s
deleted file mode 100644
index 9f16918a712dc5..00000000000000
--- a/llvm/test/MC/X86/apx/shlx-intel.s
+++ /dev/null
@@ -1,17 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: shlx	r26d, r22d, r18d
-# CHECK: encoding: [0x62,0x6a,0x6d,0x00,0xf7,0xd6]
-         shlx	r26d, r22d, r18d
-
-# CHECK: shlx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
-# CHECK: encoding: [0x62,0x8a,0x69,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
-         shlx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
-
-# CHECK: shlx	r27, r23, r19
-# CHECK: encoding: [0x62,0x6a,0xe5,0x00,0xf7,0xdf]
-         shlx	r27, r23, r19
-
-# CHECK: shlx	r23, qword ptr [r28 + 4*r29 + 291], r19
-# CHECK: encoding: [0x62,0x8a,0xe1,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
-         shlx	r23, qword ptr [r28 + 4*r29 + 291], r19
diff --git a/llvm/test/MC/X86/apx/shrx-att.s b/llvm/test/MC/X86/apx/shrx-att.s
deleted file mode 100644
index d9bb5f84af73d4..00000000000000
--- a/llvm/test/MC/X86/apx/shrx-att.s
+++ /dev/null
@@ -1,20 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-4: error:
-# ERROR-NOT: error:
-# CHECK: shrxl	%r18d, %r22d, %r26d
-# CHECK: encoding: [0x62,0x6a,0x6f,0x00,0xf7,0xd6]
-         shrxl	%r18d, %r22d, %r26d
-
-# CHECK: shrxl	%r18d, 291(%r28,%r29,4), %r22d
-# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
-         shrxl	%r18d, 291(%r28,%r29,4), %r22d
-
-# CHECK: shrxq	%r19, %r23, %r27
-# CHECK: encoding: [0x62,0x6a,0xe7,0x00,0xf7,0xdf]
-         shrxq	%r19, %r23, %r27
-
-# CHECK: shrxq	%r19, 291(%r28,%r29,4), %r23
-# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
-         shrxq	%r19, 291(%r28,%r29,4), %r23
diff --git a/llvm/test/MC/X86/apx/shrx-intel.s b/llvm/test/MC/X86/apx/shrx-intel.s
deleted file mode 100644
index 385c530a1108be..00000000000000
--- a/llvm/test/MC/X86/apx/shrx-intel.s
+++ /dev/null
@@ -1,17 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: shrx	r26d, r22d, r18d
-# CHECK: encoding: [0x62,0x6a,0x6f,0x00,0xf7,0xd6]
-         shrx	r26d, r22d, r18d
-
-# CHECK: shrx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
-# CHECK: encoding: [0x62,0x8a,0x6b,0x00,0xf7,0xb4,0xac,0x23,0x01,0x00,0x00]
-         shrx	r22d, dword ptr [r28 + 4*r29 + 291], r18d
-
-# CHECK: shrx	r27, r23, r19
-# CHECK: encoding: [0x62,0x6a,0xe7,0x00,0xf7,0xdf]
-         shrx	r27, r23, r19
-
-# CHECK: shrx	r23, qword ptr [r28 + 4*r29 + 291], r19
-# CHECK: encoding: [0x62,0x8a,0xe3,0x00,0xf7,0xbc,0xac,0x23,0x01,0x00,0x00]
-         shrx	r23, qword ptr [r28 + 4*r29 + 291], r19
diff --git a/llvm/test/MC/X86/apx/vmx-att.s b/llvm/test/MC/X86/apx/vmx-att.s
new file mode 100644
index 00000000000000..0a594f592bd3cd
--- /dev/null
+++ b/llvm/test/MC/X86/apx/vmx-att.s
@@ -0,0 +1,20 @@
+# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
+# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
+
+# ERROR-COUNT-4: error:
+# ERROR-NOT: error:
+# CHECK: invept	291(%r28,%r29,4), %r19
+# CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf0,0x9c,0xac,0x23,0x01,0x00,0x00]
+         invept	291(%r28,%r29,4), %r19
+
+# CHECK: {evex}	invept	123(%rax,%rbx,4), %r9
+# CHECK: encoding: [0x62,0x74,0x7e,0x08,0xf0,0x4c,0x98,0x7b]
+         {evex}	invept	123(%rax,%rbx,4), %r9
+
+# CHECK: invvpid	291(%r28,%r29,4), %r19
+# CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf1,0x9c,0xac,0x23,0x01,0x00,0x00]
+         invvpid	291(%r28,%r29,4), %r19
+
+# CHECK: {evex}	invvpid	123(%rax,%rbx,4), %r9
+# CHECK: encoding: [0x62,0x74,0x7e,0x08,0xf1,0x4c,0x98,0x7b]
+         {evex}	invvpid	123(%rax,%rbx,4), %r9
diff --git a/llvm/test/MC/X86/apx/vmx-intel.s b/llvm/test/MC/X86/apx/vmx-intel.s
new file mode 100644
index 00000000000000..5935774058bc95
--- /dev/null
+++ b/llvm/test/MC/X86/apx/vmx-intel.s
@@ -0,0 +1,17 @@
+# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
+
+# CHECK: invept	r19, xmmword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf0,0x9c,0xac,0x23,0x01,0x00,0x00]
+         invept	r19, xmmword ptr [r28 + 4*r29 + 291]
+
+# CHECK: {evex}	invept	r9, xmmword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x74,0x7e,0x08,0xf0,0x4c,0x98,0x7b]
+         {evex}	invept	r9, xmmword ptr [rax + 4*rbx + 123]
+
+# CHECK: invvpid	r19, xmmword ptr [r28 + 4*r29 + 291]
+# CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf1,0x9c,0xac,0x23,0x01,0x00,0x00]
+         invvpid	r19, xmmword ptr [r28 + 4*r29 + 291]
+
+# CHECK: {evex}	invvpid	r9, xmmword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x74,0x7e,0x08,0xf1,0x4c,0x98,0x7b]
+         {evex}	invvpid	r9, xmmword ptr [rax + 4*rbx + 123]
diff --git a/llvm/test/MC/X86/apx/wrssd-att.s b/llvm/test/MC/X86/apx/wrssd-att.s
deleted file mode 100644
index 409b3010f5c767..00000000000000
--- a/llvm/test/MC/X86/apx/wrssd-att.s
+++ /dev/null
@@ -1,8 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-1: error:
-# ERROR-NOT: error:
-# CHECK: wrssd	%r18d, 291(%r28,%r29,4)
-# CHECK: encoding: [0x62,0x8c,0x78,0x08,0x66,0x94,0xac,0x23,0x01,0x00,0x00]
-         wrssd	%r18d, 291(%r28,%r29,4)
diff --git a/llvm/test/MC/X86/apx/wrssd-intel.s b/llvm/test/MC/X86/apx/wrssd-intel.s
deleted file mode 100644
index 1d402f2c517761..00000000000000
--- a/llvm/test/MC/X86/apx/wrssd-intel.s
+++ /dev/null
@@ -1,5 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: wrssd	dword ptr [r28 + 4*r29 + 291], r18d
-# CHECK: encoding: [0x62,0x8c,0x78,0x08,0x66,0x94,0xac,0x23,0x01,0x00,0x00]
-         wrssd	dword ptr [r28 + 4*r29 + 291], r18d
diff --git a/llvm/test/MC/X86/apx/wrssq-att.s b/llvm/test/MC/X86/apx/wrssq-att.s
deleted file mode 100644
index 1f616ac2e4e47f..00000000000000
--- a/llvm/test/MC/X86/apx/wrssq-att.s
+++ /dev/null
@@ -1,8 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-1: error:
-# ERROR-NOT: error:
-# CHECK: wrssq	%r19, 291(%r28,%r29,4)
-# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0x66,0x9c,0xac,0x23,0x01,0x00,0x00]
-         wrssq	%r19, 291(%r28,%r29,4)
diff --git a/llvm/test/MC/X86/apx/wrssq-intel.s b/llvm/test/MC/X86/apx/wrssq-intel.s
deleted file mode 100644
index d31dca55ca4a41..00000000000000
--- a/llvm/test/MC/X86/apx/wrssq-intel.s
+++ /dev/null
@@ -1,5 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: wrssq	qword ptr [r28 + 4*r29 + 291], r19
-# CHECK: encoding: [0x62,0x8c,0xf8,0x08,0x66,0x9c,0xac,0x23,0x01,0x00,0x00]
-         wrssq	qword ptr [r28 + 4*r29 + 291], r19
diff --git a/llvm/test/MC/X86/apx/wrussd-att.s b/llvm/test/MC/X86/apx/wrussd-att.s
deleted file mode 100644
index 269d9a8aa85860..00000000000000
--- a/llvm/test/MC/X86/apx/wrussd-att.s
+++ /dev/null
@@ -1,8 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-1: error:
-# ERROR-NOT: error:
-# CHECK: wrussd	%r18d, 291(%r28,%r29,4)
-# CHECK: encoding: [0x62,0x8c,0x79,0x08,0x65,0x94,0xac,0x23,0x01,0x00,0x00]
-         wrussd	%r18d, 291(%r28,%r29,4)
diff --git a/llvm/test/MC/X86/apx/wrussd-intel.s b/llvm/test/MC/X86/apx/wrussd-intel.s
deleted file mode 100644
index fed6eb10d4addf..00000000000000
--- a/llvm/test/MC/X86/apx/wrussd-intel.s
+++ /dev/null
@@ -1,5 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: wrussd	dword ptr [r28 + 4*r29 + 291], r18d
-# CHECK: encoding: [0x62,0x8c,0x79,0x08,0x65,0x94,0xac,0x23,0x01,0x00,0x00]
-         wrussd	dword ptr [r28 + 4*r29 + 291], r18d
diff --git a/llvm/test/MC/X86/apx/wrussq-att.s b/llvm/test/MC/X86/apx/wrussq-att.s
deleted file mode 100644
index b41360cd9db048..00000000000000
--- a/llvm/test/MC/X86/apx/wrussq-att.s
+++ /dev/null
@@ -1,8 +0,0 @@
-# RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
-# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-# ERROR-COUNT-1: error:
-# ERROR-NOT: error:
-# CHECK: wrussq	%r19, 291(%r28,%r29,4)
-# CHECK: encoding: [0x62,0x8c,0xf9,0x08,0x65,0x9c,0xac,0x23,0x01,0x00,0x00]
-         wrussq	%r19, 291(%r28,%r29,4)
diff --git a/llvm/test/MC/X86/apx/wrussq-intel.s b/llvm/test/MC/X86/apx/wrussq-intel.s
deleted file mode 100644
index a9a96da9d3d1d4..00000000000000
--- a/llvm/test/MC/X86/apx/wrussq-intel.s
+++ /dev/null
@@ -1,5 +0,0 @@
-# RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
-
-# CHECK: wrussq	qword ptr [r28 + 4*r29 + 291], r19
-# CHECK: encoding: [0x62,0x8c,0xf9,0x08,0x65,0x9c,0xac,0x23,0x01,0x00,0x00]
-         wrussq	qword ptr [r28 + 4*r29 + 291], r19

>From ade421323a45bef37df520a3a10f01a512566ec0 Mon Sep 17 00:00:00 2001
From: "Wang, Xin10" <xin10.wang at intel.com>
Date: Mon, 1 Jan 2024 23:23:26 -0800
Subject: [PATCH 2/2] add test for invpcid

---
 llvm/test/MC/Disassembler/X86/apx/invpcid.txt | 4 ++++
 llvm/test/MC/X86/apx/invpcid-att.s            | 6 +++++-
 llvm/test/MC/X86/apx/invpcid-intel.s          | 4 ++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/llvm/test/MC/Disassembler/X86/apx/invpcid.txt b/llvm/test/MC/Disassembler/X86/apx/invpcid.txt
index 8987332e9c9d9d..8b590cc4ea47ca 100644
--- a/llvm/test/MC/Disassembler/X86/apx/invpcid.txt
+++ b/llvm/test/MC/Disassembler/X86/apx/invpcid.txt
@@ -1,6 +1,10 @@
 # RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
 # RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
 
+# ATT:   invpcid	123(%rax,%rbx,4), %r9
+# INTEL: invpcid	r9, xmmword ptr [rax + 4*rbx + 123]
+0x62,0x74,0x7e,0x08,0xf2,0x4c,0x98,0x7b
+
 # ATT:   invpcid	291(%r28,%r29,4), %r19
 # INTEL: invpcid	r19, xmmword ptr [r28 + 4*r29 + 291]
 0x62,0x8c,0x7a,0x08,0xf2,0x9c,0xac,0x23,0x01,0x00,0x00
diff --git a/llvm/test/MC/X86/apx/invpcid-att.s b/llvm/test/MC/X86/apx/invpcid-att.s
index a0e827ecadb057..57dee2e597a640 100644
--- a/llvm/test/MC/X86/apx/invpcid-att.s
+++ b/llvm/test/MC/X86/apx/invpcid-att.s
@@ -1,8 +1,12 @@
 # RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
 # RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
 
-# ERROR-COUNT-1: error:
+# ERROR-COUNT-2: error:
 # ERROR-NOT: error:
+# CHECK: {evex}	invpcid	123(%rax,%rbx,4), %r9
+# CHECK: encoding: [0x62,0x74,0x7e,0x08,0xf2,0x4c,0x98,0x7b]
+         {evex}	invpcid	123(%rax,%rbx,4), %r9
+
 # CHECK: invpcid	291(%r28,%r29,4), %r19
 # CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf2,0x9c,0xac,0x23,0x01,0x00,0x00]
          invpcid	291(%r28,%r29,4), %r19
diff --git a/llvm/test/MC/X86/apx/invpcid-intel.s b/llvm/test/MC/X86/apx/invpcid-intel.s
index e9993d26962e22..d959af7b149598 100644
--- a/llvm/test/MC/X86/apx/invpcid-intel.s
+++ b/llvm/test/MC/X86/apx/invpcid-intel.s
@@ -1,5 +1,9 @@
 # RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
 
+# CHECK: {evex}	invpcid	r9, xmmword ptr [rax + 4*rbx + 123]
+# CHECK: encoding: [0x62,0x74,0x7e,0x08,0xf2,0x4c,0x98,0x7b]
+         {evex}	invpcid	r9, xmmword ptr [rax + 4*rbx + 123]
+
 # CHECK: invpcid	r19, xmmword ptr [r28 + 4*r29 + 291]
 # CHECK: encoding: [0x62,0x8c,0x7a,0x08,0xf2,0x9c,0xac,0x23,0x01,0x00,0x00]
          invpcid	r19, xmmword ptr [r28 + 4*r29 + 291]



More information about the llvm-commits mailing list