x86/APX: Remove KEYLOCKER and SHA promotions from EVEX MAP4

Message ID 20240402070843.2270752-1-lili.cui@intel.com
State New
Headers
Series x86/APX: Remove KEYLOCKER and SHA promotions from EVEX MAP4 |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Testing passed

Commit Message

Cui, Lili April 2, 2024, 7:08 a.m. UTC
  APX spec removed KEYLOCKER and SHA promotions from EVEX MAP4.
https://www.intel.com/content/www/us/en/developer/articles/technical/advanced-performance-extensions-apx.html

gas/ChangeLog:

        * config/tc-i386.c (process_operands): Removed special handling of
	* KEYLOCKER and SHA.
        * testsuite/gas/i386/x86-64-apx-egpr-promote-inval.l: Removed KEYLOCKER
        * and SHA instructions.
        * testsuite/gas/i386/x86-64-apx-egpr-promote-inval.s: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-wig.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted.s: Ditto.

opcodes/ChangeLog:

        * i386-dis-evex-prefix.h: Removed KEYLOCKER and SHA instructions.
        * i386-dis-evex.h: Ditto.
        * i386-opc.tbl: Ditto.
        * i386-dis.c (print_vector_reg): Removed special handling of KEYLOCKER
	*  and SHA.
---
 gas/config/tc-i386.c                          |  7 ----
 .../gas/i386/x86-64-apx-egpr-promote-inval.l  | 17 ++++-----
 .../gas/i386/x86-64-apx-egpr-promote-inval.s  |  4 ---
 .../gas/i386/x86-64-apx-evex-promoted-bad.d   |  3 --
 .../gas/i386/x86-64-apx-evex-promoted-bad.s   |  9 -----
 .../gas/i386/x86-64-apx-evex-promoted-intel.d | 34 ------------------
 .../gas/i386/x86-64-apx-evex-promoted-wig.d   | 34 ------------------
 .../gas/i386/x86-64-apx-evex-promoted.d       | 34 ------------------
 .../gas/i386/x86-64-apx-evex-promoted.s       | 34 ------------------
 opcodes/i386-dis-evex-prefix.h                | 35 -------------------
 opcodes/i386-dis-evex.h                       | 18 +++++-----
 opcodes/i386-dis.c                            | 12 -------
 opcodes/i386-opc.tbl                          | 18 ----------
 13 files changed, 16 insertions(+), 243 deletions(-)
  

Comments

Jan Beulich April 2, 2024, 8:25 a.m. UTC | #1
On 02.04.2024 09:08, Cui, Lili wrote:
> APX spec removed KEYLOCKER and SHA promotions from EVEX MAP4.
> https://www.intel.com/content/www/us/en/developer/articles/technical/advanced-performance-extensions-apx.html

This is unfortunate forth an back, but well - the patch is okay. May want
mentioning in gas/NEWS, though, seeing that the insns were usable in 2.42.

Jan
  
Cui, Lili April 2, 2024, 8:55 a.m. UTC | #2
> On 02.04.2024 09:08, Cui, Lili wrote:
> > APX spec removed KEYLOCKER and SHA promotions from EVEX MAP4.
> > https://www.intel.com/content/www/us/en/developer/articles/technical/a
> > dvanced-performance-extensions-apx.html
> 
> This is unfortunate forth an back, but well - the patch is okay. May want
> mentioning in gas/NEWS, though, seeing that the insns were usable in 2.42.
> 

Mention it in gas/NEWS and backport this patch to binutils-2_42-branch, right?

Lili.
  
Jan Beulich April 2, 2024, 9:11 a.m. UTC | #3
On 02.04.2024 10:55, Cui, Lili wrote:
> 
>> On 02.04.2024 09:08, Cui, Lili wrote:
>>> APX spec removed KEYLOCKER and SHA promotions from EVEX MAP4.
>>> https://www.intel.com/content/www/us/en/developer/articles/technical/a
>>> dvanced-performance-extensions-apx.html
>>
>> This is unfortunate forth an back, but well - the patch is okay. May want
>> mentioning in gas/NEWS, though, seeing that the insns were usable in 2.42.
>>
> 
> Mention it in gas/NEWS and backport this patch to binutils-2_42-branch, right?

Not sure about backporting; it won't hurt, I suppose.

Jan
  
H.J. Lu April 2, 2024, 12:26 p.m. UTC | #4
On Tue, Apr 2, 2024 at 2:11 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 02.04.2024 10:55, Cui, Lili wrote:
> >
> >> On 02.04.2024 09:08, Cui, Lili wrote:
> >>> APX spec removed KEYLOCKER and SHA promotions from EVEX MAP4.
> >>> https://www.intel.com/content/www/us/en/developer/articles/technical/a
> >>> dvanced-performance-extensions-apx.html
> >>
> >> This is unfortunate forth an back, but well - the patch is okay. May want
> >> mentioning in gas/NEWS, though, seeing that the insns were usable in 2.42.
> >>
> >
> > Mention it in gas/NEWS and backport this patch to binutils-2_42-branch, right?
>
> Not sure about backporting; it won't hurt, I suppose.
>
> Jan

Please backport it.

Thanks.
  
Cui, Lili April 3, 2024, 8:33 a.m. UTC | #5
> On Tue, Apr 2, 2024 at 2:11 AM Jan Beulich <jbeulich@suse.com> wrote:
> >
> > On 02.04.2024 10:55, Cui, Lili wrote:
> > >
> > >> On 02.04.2024 09:08, Cui, Lili wrote:
> > >>> APX spec removed KEYLOCKER and SHA promotions from EVEX MAP4.
> > >>>
> https://www.intel.com/content/www/us/en/developer/articles/technic
> > >>> al/a dvanced-performance-extensions-apx.html
> > >>
> > >> This is unfortunate forth an back, but well - the patch is okay.
> > >> May want mentioning in gas/NEWS, though, seeing that the insns were
> usable in 2.42.
> > >>
> > >
> > > Mention it in gas/NEWS and backport this patch to binutils-2_42-branch,
> right?
> >
> > Not sure about backporting; it won't hurt, I suppose.
> >
> > Jan
> 
> Please backport it.
> 

Done.

Thanks,
Lili.
  

Patch

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 7467cef18cd..b022efa4f6f 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -10015,13 +10015,6 @@  process_operands (void)
   for (unsigned int j = 0; j < i.operands; j++)
     if (i.types[j].bitfield.instance != InstanceNone)
       i.reg_operands--;
-    else if (i.tm.opcode_space == SPACE_EVEXMAP4
-	     && i.types[j].bitfield.class == RegSIMD
-	     && (i.op[j].regs->reg_flags & RegVRex)
-	     && !dot_insn ())
-      /* Just raise an error, but continue processing.  */
-      as_bad (_("`%s%s' cannot be used with `%s'"),
-	      register_prefix, i.op[j].regs->reg_name, insn_name (&i.tm));
 
   if (i.tm.opcode_modifier.sse2avx)
     {
diff --git a/gas/testsuite/gas/i386/x86-64-apx-egpr-promote-inval.l b/gas/testsuite/gas/i386/x86-64-apx-egpr-promote-inval.l
index 547b98f5778..6f06df91905 100644
--- a/gas/testsuite/gas/i386/x86-64-apx-egpr-promote-inval.l
+++ b/gas/testsuite/gas/i386/x86-64-apx-egpr-promote-inval.l
@@ -13,16 +13,13 @@ 
 .*:25: Error: `andn' is not supported on `x86_64.nobmi'
 .*:28: Error: `bzhi' is not supported on `x86_64.nobmi2'
 .*:29: Error: `bzhi' is not supported on `x86_64.nobmi2'
-.*:32: Error: .*`%?xmm20'.*`aesenc128kl'.*
-.*:33: Error: .*`%?xmm20'.*`sha1msg1'.*
-.*:34: Error: .*`%?xmm20'.*`sha256msg2'.*
-.*:37: Error: .*`andn'.*
-.*:38: Error: .*`bzhi'.*
-.*:39: Error: .*`kmovw'.*
-.*:40: Error: .*`kmovq'.*
-.*:41: Error: .*`kmovb'.*
-.*:42: Error: .*`ldtilecfg'.*
-.*:43: Error: .*`cmpexadd'.*
+.*:33: Error: .*`andn'.*
+.*:34: Error: .*`bzhi'.*
+.*:35: Error: .*`kmovw'.*
+.*:36: Error: .*`kmovq'.*
+.*:37: Error: .*`kmovb'.*
+.*:38: Error: .*`ldtilecfg'.*
+.*:39: Error: .*`cmpexadd'.*
 GAS LISTING .*
 #...
 [ 	]*1[ 	]+\# Check illegal 64bit APX EVEX promoted instructions
diff --git a/gas/testsuite/gas/i386/x86-64-apx-egpr-promote-inval.s b/gas/testsuite/gas/i386/x86-64-apx-egpr-promote-inval.s
index 8065b1a9710..5e4e08fa2fd 100644
--- a/gas/testsuite/gas/i386/x86-64-apx-egpr-promote-inval.s
+++ b/gas/testsuite/gas/i386/x86-64-apx-egpr-promote-inval.s
@@ -29,10 +29,6 @@ 
 	bzhi %r15,%r15,%r11
 
 	.arch default
-	aesenc128kl (%rax), %xmm20
-	sha1msg1 %xmm20, %xmm0
-	sha256msg2 (%rax), %xmm20
-
 	.arch .noapx_f
 	{evex} andn %r15, %r15, %r11
 	{evex} bzhi %r15, %r15, %r11
diff --git a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d
index 5f96df95a35..c0ee6218561 100644
--- a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d
+++ b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d
@@ -40,7 +40,4 @@  Disassembly of section .text:
 [ 	]*[a-f0-9]+:[ 	]+62 74 7c 18 8f c0[ 	]+pop2   %rax,\(bad\)
 [ 	]*[a-f0-9]+:[ 	]+62 d4 24 18 8f[ 	]+\(bad\)
 [ 	]*[a-f0-9]+:[ 	]+c3[ 	]+.*
-[ 	]*[a-f0-9]+:[ 	]+62 e4 7e 08 dc 20[ 	]+aesenc128kl \(%rax\),%xmm20\(bad\)
-[ 	]*[a-f0-9]+:[ 	]+62 b4 7c 08 d9 c4[ 	]+sha1msg1 %xmm20\(bad\),%xmm0
-[ 	]*[a-f0-9]+:[ 	]+62 e4 7c 08 d9 20[ 	]+sha1msg1 \(%rax\),%xmm20\(bad\)
 #pass
diff --git a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s
index 668e4a29f06..10ec4d618a5 100644
--- a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s
+++ b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s
@@ -48,12 +48,3 @@  _start:
 
 	# pop2 %r11, %r11
 	.insn EVEX.L0.NP.M4.W0 0x8f/0, {sae}, %xmm11, %xmm11
-
-	# aesenc128kl (%rax), %xmm20
-	.insn EVEX.L0.F3.M4.W0 0xdc, (%rax), %xmm20
-
-	# sha1msg1 %xmm20, %xmm0
-	.insn EVEX.L0.NP.M4.W0 0xd9, %xmm20, %xmm0
-
-	# sha1msg1 (%rax), %xmm20
-	.insn EVEX.L0.NP.M4.W0 0xd9, (%rax), %xmm20
diff --git a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d
index 9c88880191b..d049c099daf 100644
--- a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d
+++ b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d
@@ -12,14 +12,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 4c fc 08 fc bc 87 23 01 00 00[	 ]+aadd[	 ]+QWORD PTR \[r31\+rax\*4\+0x123\],r31
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7d 08 fc 8c 87 23 01 00 00[	 ]+aand[	 ]+DWORD PTR \[r31\+rax\*4\+0x123\],r25d
 [	 ]*[a-f0-9]+:[	 ]*62 4c fd 08 fc bc 87 23 01 00 00[	 ]+aand[	 ]+QWORD PTR \[r31\+rax\*4\+0x123\],r31
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 dd a4 87 23 01 00 00[	 ]+aesdec128kl xmm12,\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 df a4 87 23 01 00 00[	 ]+aesdec256kl xmm12,\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 8c 87 23 01 00 00[	 ]+aesdecwide128kl[	 ]+\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 9c 87 23 01 00 00[	 ]+aesdecwide256kl[	 ]+\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 dc a4 87 23 01 00 00[	 ]+aesenc128kl xmm12,\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 de a4 87 23 01 00 00[	 ]+aesenc256kl xmm12,\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 84 87 23 01 00 00[	 ]+aesencwide128kl[	 ]+\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 94 87 23 01 00 00[	 ]+aesencwide256kl[	 ]+\[r31\+rax\*4\+0x123\]
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7f 08 fc 8c 87 23 01 00 00[	 ]+aor[	 ]+DWORD PTR \[r31\+rax\*4\+0x123\],r25d
 [	 ]*[a-f0-9]+:[	 ]*62 4c ff 08 fc bc 87 23 01 00 00[	 ]+aor[	 ]+QWORD PTR \[r31\+rax\*4\+0x123\],r31
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7e 08 fc 8c 87 23 01 00 00[	 ]+axor[	 ]+DWORD PTR \[r31\+rax\*4\+0x123\],r25d
@@ -84,8 +76,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 ef[	 ]+crc32[	 ]+r21d,r31w
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 2f[	 ]+crc32[	 ]+r21d,WORD PTR \[r31\]
 [	 ]*[a-f0-9]+:[	 ]*62 e4 fc 08 f1 d0[	 ]+crc32[	 ]+r18,rax
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 da d1[	 ]+encodekey128[	 ]+edx,r25d
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 db d1[	 ]+encodekey256[	 ]+edx,r25d
 [	 ]*[a-f0-9]+:[	 ]*67 62 4c 7f 08 f8 8c 87 23 01 00 00[	 ]+enqcmd[	 ]+r25d,\[r31d\+eax\*4\+0x123\]
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7f 08 f8 bc 87 23 01 00 00[	 ]+enqcmd[	 ]+r31,\[r31\+rax\*4\+0x123\]
 [	 ]*[a-f0-9]+:[	 ]*67 62 4c 7e 08 f8 8c 87 23 01 00 00[	 ]+enqcmds[	 ]+r25d,\[r31d\+eax\*4\+0x123\]
@@ -133,13 +123,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 08 f5 df[	 ]+pext[	 ]+r11,r15,r31
 [	 ]*[a-f0-9]+:[	 ]*62 da 36 00 f5 94 87 23 01 00 00[	 ]+pext[	 ]+edx,r25d,DWORD PTR \[r31\+rax\*4\+0x123\]
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 00 f5 bc 87 23 01 00 00[	 ]+pext[	 ]+r15,r31,QWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d9 a4 87 23 01 00 00[	 ]+sha1msg1 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 da a4 87 23 01 00 00[	 ]+sha1msg2 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d8 a4 87 23 01 00 00[	 ]+sha1nexte xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d4 a4 87 23 01 00 00 7b[	 ]+sha1rnds4 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\],0x7b
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 dc a4 87 23 01 00 00[	 ]+sha256msg1 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 dd a4 87 23 01 00 00[	 ]+sha256msg2 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 db a4 87 23 01 00 00[	 ]+sha256rnds2 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\],xmm0
 [	 ]*[a-f0-9]+:[	 ]*62 72 35 00 f7 d2[	 ]+shlx[	 ]+r10d,edx,r25d
 [	 ]*[a-f0-9]+:[	 ]*62 da 35 00 f7 94 87 23 01 00 00[	 ]+shlx[	 ]+edx,DWORD PTR \[r31\+rax\*4\+0x123\],r25d
 [	 ]*[a-f0-9]+:[	 ]*62 52 85 00 f7 df[	 ]+shlx[	 ]+r11,r15,r31
@@ -170,14 +153,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 4c fc 08 fc bc 87 23 01 00 00[	 ]+aadd[	 ]+QWORD PTR \[r31\+rax\*4\+0x123\],r31
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7d 08 fc 8c 87 23 01 00 00[	 ]+aand[	 ]+DWORD PTR \[r31\+rax\*4\+0x123\],r25d
 [	 ]*[a-f0-9]+:[	 ]*62 4c fd 08 fc bc 87 23 01 00 00[	 ]+aand[	 ]+QWORD PTR \[r31\+rax\*4\+0x123\],r31
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 dd a4 87 23 01 00 00[	 ]+aesdec128kl xmm12,\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 df a4 87 23 01 00 00[	 ]+aesdec256kl xmm12,\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 8c 87 23 01 00 00[	 ]+aesdecwide128kl[	 ]+\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 9c 87 23 01 00 00[	 ]+aesdecwide256kl[	 ]+\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 dc a4 87 23 01 00 00[	 ]+aesenc128kl xmm12,\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 de a4 87 23 01 00 00[	 ]+aesenc256kl xmm12,\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 84 87 23 01 00 00[	 ]+aesencwide128kl[	 ]+\[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 94 87 23 01 00 00[	 ]+aesencwide256kl[	 ]+\[r31\+rax\*4\+0x123\]
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7f 08 fc 8c 87 23 01 00 00[	 ]+aor[	 ]+DWORD PTR \[r31\+rax\*4\+0x123\],r25d
 [	 ]*[a-f0-9]+:[	 ]*62 4c ff 08 fc bc 87 23 01 00 00[	 ]+aor[	 ]+QWORD PTR \[r31\+rax\*4\+0x123\],r31
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7e 08 fc 8c 87 23 01 00 00[	 ]+axor[	 ]+DWORD PTR \[r31\+rax\*4\+0x123\],r25d
@@ -242,8 +217,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 ef[	 ]+crc32[	 ]+r21d,r31w
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 2f[	 ]+crc32[	 ]+r21d,WORD PTR \[r31\]
 [	 ]*[a-f0-9]+:[	 ]*62 e4 fc 08 f1 d0[	 ]+crc32[	 ]+r18,rax
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 da d1[	 ]+encodekey128[	 ]+edx,r25d
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 db d1[	 ]+encodekey256[	 ]+edx,r25d
 [	 ]*[a-f0-9]+:[	 ]*67 62 4c 7f 08 f8 8c 87 23 01 00 00[	 ]+enqcmd[	 ]+r25d,\[r31d\+eax\*4\+0x123\]
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7f 08 f8 bc 87 23 01 00 00[	 ]+enqcmd[	 ]+r31,\[r31\+rax\*4\+0x123\]
 [	 ]*[a-f0-9]+:[	 ]*67 62 4c 7e 08 f8 8c 87 23 01 00 00[	 ]+enqcmds[	 ]+r25d,\[r31d\+eax\*4\+0x123\]
@@ -291,13 +264,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 08 f5 df[	 ]+pext[	 ]+r11,r15,r31
 [	 ]*[a-f0-9]+:[	 ]*62 da 36 00 f5 94 87 23 01 00 00[	 ]+pext[	 ]+edx,r25d,DWORD PTR \[r31\+rax\*4\+0x123\]
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 00 f5 bc 87 23 01 00 00[	 ]+pext[	 ]+r15,r31,QWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d9 a4 87 23 01 00 00[	 ]+sha1msg1 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 da a4 87 23 01 00 00[	 ]+sha1msg2 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d8 a4 87 23 01 00 00[	 ]+sha1nexte xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d4 a4 87 23 01 00 00 7b[	 ]+sha1rnds4 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\],0x7b
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 dc a4 87 23 01 00 00[	 ]+sha256msg1 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 dd a4 87 23 01 00 00[	 ]+sha256msg2 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\]
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 db a4 87 23 01 00 00[	 ]+sha256rnds2 xmm12,XMMWORD PTR \[r31\+rax\*4\+0x123\],xmm0
 [	 ]*[a-f0-9]+:[	 ]*62 72 35 00 f7 d2[	 ]+shlx[	 ]+r10d,edx,r25d
 [	 ]*[a-f0-9]+:[	 ]*62 da 35 00 f7 94 87 23 01 00 00[	 ]+shlx[	 ]+edx,DWORD PTR \[r31\+rax\*4\+0x123\],r25d
 [	 ]*[a-f0-9]+:[	 ]*62 52 85 00 f7 df[	 ]+shlx[	 ]+r11,r15,r31
diff --git a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-wig.d b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-wig.d
index db6860f30a6..9237c34c0be 100644
--- a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-wig.d
+++ b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-wig.d
@@ -12,14 +12,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 4c fc 08 fc bc 87 23 01 00 00[	 ]+aadd[	 ]+%r31,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7d 08 fc 8c 87 23 01 00 00[	 ]+aand[	 ]+%r25d,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c fd 08 fc bc 87 23 01 00 00[	 ]+aand[	 ]+%r31,0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 5c .e 08 dd a4 87 23 01 00 00[	 ]+aesdec128kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .e 08 df a4 87 23 01 00 00[	 ]+aesdec256kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 d8 8c 87 23 01 00 00[	 ]+aesdecwide128kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 d8 9c 87 23 01 00 00[	 ]+aesdecwide256kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 5c .e 08 dc a4 87 23 01 00 00[	 ]+aesenc128kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .e 08 de a4 87 23 01 00 00[	 ]+aesenc256kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 d8 84 87 23 01 00 00[	 ]+aesencwide128kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 d8 94 87 23 01 00 00[	 ]+aesencwide256kl[	 ]+0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7f 08 fc 8c 87 23 01 00 00[	 ]+aor[	 ]+%r25d,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c ff 08 fc bc 87 23 01 00 00[	 ]+aor[	 ]+%r31,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7e 08 fc 8c 87 23 01 00 00[	 ]+axor[	 ]+%r25d,0x123\(%r31,%rax,4\)
@@ -84,8 +76,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 ef[	 ]+crc32  %r31w,%r21d
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 2f[	 ]+crc32w \(%r31\),%r21d
 [	 ]*[a-f0-9]+:[	 ]*62 e4 fc 08 f1 d0[	 ]+crc32  %rax,%r18
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 da d1[	 ]+encodekey128[	 ]+%r25d,%edx
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 db d1[	 ]+encodekey256[	 ]+%r25d,%edx
 [	 ]*[a-f0-9]+:[	 ]*67 62 .c 7f 08 f8 8c 87 23 01 00 00[	 ]+enqcmd[	 ]+0x123\(%r31d,%eax,4\),%r25d
 [	 ]*[a-f0-9]+:[	 ]*62 4c .f 08 f8 bc 87 23 01 00 00[	 ]+enqcmd[	 ]+0x123\(%r31,%rax,4\),%r31
 [	 ]*[a-f0-9]+:[	 ]*67 62 .c 7e 08 f8 8c 87 23 01 00 00[	 ]+enqcmds[	 ]+0x123\(%r31d,%eax,4\),%r25d
@@ -133,13 +123,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 08 f5 df[	 ]+pext[	 ]+%r31,%r15,%r11
 [	 ]*[a-f0-9]+:[	 ]*62 da 36 00 f5 94 87 23 01 00 00[	 ]+pext[	 ]+0x123\(%r31,%rax,4\),%r25d,%edx
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 00 f5 bc 87 23 01 00 00[	 ]+pext[	 ]+0x123\(%r31,%rax,4\),%r31,%r15
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 d9 a4 87 23 01 00 00[	 ]+sha1msg1[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 da a4 87 23 01 00 00[	 ]+sha1msg2[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 d8 a4 87 23 01 00 00[	 ]+sha1nexte[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 d4 a4 87 23 01 00 00 7b[	 ]+sha1rnds4[	 ]+\$0x7b,0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 dc a4 87 23 01 00 00[	 ]+sha256msg1[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 dd a4 87 23 01 00 00[	 ]+sha256msg2[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 db a4 87 23 01 00 00[	 ]+sha256rnds2[	 ]+%xmm0,0x123\(%r31,%rax,4\),%xmm12
 [	 ]*[a-f0-9]+:[	 ]*62 72 35 00 f7 d2[	 ]+shlx[	 ]+%r25d,%edx,%r10d
 [	 ]*[a-f0-9]+:[	 ]*62 da 35 00 f7 94 87 23 01 00 00[	 ]+shlx[	 ]+%r25d,0x123\(%r31,%rax,4\),%edx
 [	 ]*[a-f0-9]+:[	 ]*62 52 85 00 f7 df[	 ]+shlx[	 ]+%r31,%r15,%r11
@@ -170,14 +153,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 4c fc 08 fc bc 87 23 01 00 00[	 ]+aadd[	 ]+%r31,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7d 08 fc 8c 87 23 01 00 00[	 ]+aand[	 ]+%r25d,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c fd 08 fc bc 87 23 01 00 00[	 ]+aand[	 ]+%r31,0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 5c .e 08 dd a4 87 23 01 00 00[	 ]+aesdec128kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .e 08 df a4 87 23 01 00 00[	 ]+aesdec256kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 d8 8c 87 23 01 00 00[	 ]+aesdecwide128kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 d8 9c 87 23 01 00 00[	 ]+aesdecwide256kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 5c .e 08 dc a4 87 23 01 00 00[	 ]+aesenc128kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .e 08 de a4 87 23 01 00 00[	 ]+aesenc256kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 d8 84 87 23 01 00 00[	 ]+aesencwide128kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 d8 94 87 23 01 00 00[	 ]+aesencwide256kl[	 ]+0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7f 08 fc 8c 87 23 01 00 00[	 ]+aor[	 ]+%r25d,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c ff 08 fc bc 87 23 01 00 00[	 ]+aor[	 ]+%r31,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7e 08 fc 8c 87 23 01 00 00[	 ]+axor[	 ]+%r25d,0x123\(%r31,%rax,4\)
@@ -242,8 +217,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 ef[	 ]+crc32  %r31w,%r21d
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 2f[	 ]+crc32w \(%r31\),%r21d
 [	 ]*[a-f0-9]+:[	 ]*62 e4 fc 08 f1 d0[	 ]+crc32  %rax,%r18
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 da d1[	 ]+encodekey128[	 ]+%r25d,%edx
-[	 ]*[a-f0-9]+:[	 ]*62 dc .e 08 db d1[	 ]+encodekey256[	 ]+%r25d,%edx
 [	 ]*[a-f0-9]+:[	 ]*67 62 .c 7f 08 f8 8c 87 23 01 00 00[	 ]+enqcmd[	 ]+0x123\(%r31d,%eax,4\),%r25d
 [	 ]*[a-f0-9]+:[	 ]*62 4c .f 08 f8 bc 87 23 01 00 00[	 ]+enqcmd[	 ]+0x123\(%r31,%rax,4\),%r31
 [	 ]*[a-f0-9]+:[	 ]*67 62 .c 7e 08 f8 8c 87 23 01 00 00[	 ]+enqcmds[	 ]+0x123\(%r31d,%eax,4\),%r25d
@@ -291,13 +264,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 08 f5 df[	 ]+pext[	 ]+%r31,%r15,%r11
 [	 ]*[a-f0-9]+:[	 ]*62 da 36 00 f5 94 87 23 01 00 00[	 ]+pext[	 ]+0x123\(%r31,%rax,4\),%r25d,%edx
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 00 f5 bc 87 23 01 00 00[	 ]+pext[	 ]+0x123\(%r31,%rax,4\),%r31,%r15
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 d9 a4 87 23 01 00 00[	 ]+sha1msg1[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 da a4 87 23 01 00 00[	 ]+sha1msg2[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 d8 a4 87 23 01 00 00[	 ]+sha1nexte[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 d4 a4 87 23 01 00 00 7b[	 ]+sha1rnds4[	 ]+\$0x7b,0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 dc a4 87 23 01 00 00[	 ]+sha256msg1[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 dd a4 87 23 01 00 00[	 ]+sha256msg2[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c .c 08 db a4 87 23 01 00 00[	 ]+sha256rnds2[	 ]+%xmm0,0x123\(%r31,%rax,4\),%xmm12
 [	 ]*[a-f0-9]+:[	 ]*62 72 35 00 f7 d2[	 ]+shlx[	 ]+%r25d,%edx,%r10d
 [	 ]*[a-f0-9]+:[	 ]*62 da 35 00 f7 94 87 23 01 00 00[	 ]+shlx[	 ]+%r25d,0x123\(%r31,%rax,4\),%edx
 [	 ]*[a-f0-9]+:[	 ]*62 52 85 00 f7 df[	 ]+shlx[	 ]+%r31,%r15,%r11
diff --git a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.d b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.d
index 3a9d712a346..9b103f569c0 100644
--- a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.d
+++ b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.d
@@ -12,14 +12,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 4c fc 08 fc bc 87 23 01 00 00[	 ]+aadd[	 ]+%r31,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7d 08 fc 8c 87 23 01 00 00[	 ]+aand[	 ]+%r25d,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c fd 08 fc bc 87 23 01 00 00[	 ]+aand[	 ]+%r31,0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 dd a4 87 23 01 00 00[	 ]+aesdec128kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 df a4 87 23 01 00 00[	 ]+aesdec256kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 8c 87 23 01 00 00[	 ]+aesdecwide128kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 9c 87 23 01 00 00[	 ]+aesdecwide256kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 dc a4 87 23 01 00 00[	 ]+aesenc128kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 de a4 87 23 01 00 00[	 ]+aesenc256kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 84 87 23 01 00 00[	 ]+aesencwide128kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 94 87 23 01 00 00[	 ]+aesencwide256kl[	 ]+0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7f 08 fc 8c 87 23 01 00 00[	 ]+aor[	 ]+%r25d,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c ff 08 fc bc 87 23 01 00 00[	 ]+aor[	 ]+%r31,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7e 08 fc 8c 87 23 01 00 00[	 ]+axor[	 ]+%r25d,0x123\(%r31,%rax,4\)
@@ -84,8 +76,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 ef[	 ]+crc32  %r31w,%r21d
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 2f[	 ]+crc32w \(%r31\),%r21d
 [	 ]*[a-f0-9]+:[	 ]*62 e4 fc 08 f1 d0[	 ]+crc32  %rax,%r18
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 da d1[	 ]+encodekey128[	 ]+%r25d,%edx
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 db d1[	 ]+encodekey256[	 ]+%r25d,%edx
 [	 ]*[a-f0-9]+:[	 ]*67 62 4c 7f 08 f8 8c 87 23 01 00 00[	 ]+enqcmd[	 ]+0x123\(%r31d,%eax,4\),%r25d
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7f 08 f8 bc 87 23 01 00 00[	 ]+enqcmd[	 ]+0x123\(%r31,%rax,4\),%r31
 [	 ]*[a-f0-9]+:[	 ]*67 62 4c 7e 08 f8 8c 87 23 01 00 00[	 ]+enqcmds[	 ]+0x123\(%r31d,%eax,4\),%r25d
@@ -133,13 +123,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 08 f5 df[	 ]+pext[	 ]+%r31,%r15,%r11
 [	 ]*[a-f0-9]+:[	 ]*62 da 36 00 f5 94 87 23 01 00 00[	 ]+pext[	 ]+0x123\(%r31,%rax,4\),%r25d,%edx
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 00 f5 bc 87 23 01 00 00[	 ]+pext[	 ]+0x123\(%r31,%rax,4\),%r31,%r15
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d9 a4 87 23 01 00 00[	 ]+sha1msg1[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 da a4 87 23 01 00 00[	 ]+sha1msg2[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d8 a4 87 23 01 00 00[	 ]+sha1nexte[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d4 a4 87 23 01 00 00 7b[	 ]+sha1rnds4[	 ]+\$0x7b,0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 dc a4 87 23 01 00 00[	 ]+sha256msg1[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 dd a4 87 23 01 00 00[	 ]+sha256msg2[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 db a4 87 23 01 00 00[	 ]+sha256rnds2[	 ]+%xmm0,0x123\(%r31,%rax,4\),%xmm12
 [	 ]*[a-f0-9]+:[	 ]*62 72 35 00 f7 d2[	 ]+shlx[	 ]+%r25d,%edx,%r10d
 [	 ]*[a-f0-9]+:[	 ]*62 da 35 00 f7 94 87 23 01 00 00[	 ]+shlx[	 ]+%r25d,0x123\(%r31,%rax,4\),%edx
 [	 ]*[a-f0-9]+:[	 ]*62 52 85 00 f7 df[	 ]+shlx[	 ]+%r31,%r15,%r11
@@ -170,14 +153,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 4c fc 08 fc bc 87 23 01 00 00[	 ]+aadd[	 ]+%r31,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7d 08 fc 8c 87 23 01 00 00[	 ]+aand[	 ]+%r25d,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c fd 08 fc bc 87 23 01 00 00[	 ]+aand[	 ]+%r31,0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 dd a4 87 23 01 00 00[	 ]+aesdec128kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 df a4 87 23 01 00 00[	 ]+aesdec256kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 8c 87 23 01 00 00[	 ]+aesdecwide128kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 9c 87 23 01 00 00[	 ]+aesdecwide256kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 dc a4 87 23 01 00 00[	 ]+aesenc128kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7e 08 de a4 87 23 01 00 00[	 ]+aesenc256kl[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 84 87 23 01 00 00[	 ]+aesencwide128kl[	 ]+0x123\(%r31,%rax,4\)
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 d8 94 87 23 01 00 00[	 ]+aesencwide256kl[	 ]+0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7f 08 fc 8c 87 23 01 00 00[	 ]+aor[	 ]+%r25d,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c ff 08 fc bc 87 23 01 00 00[	 ]+aor[	 ]+%r31,0x123\(%r31,%rax,4\)
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7e 08 fc 8c 87 23 01 00 00[	 ]+axor[	 ]+%r25d,0x123\(%r31,%rax,4\)
@@ -242,8 +217,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 ef[	 ]+crc32  %r31w,%r21d
 [	 ]*[a-f0-9]+:[	 ]*62 cc 7d 08 f1 2f[	 ]+crc32w \(%r31\),%r21d
 [	 ]*[a-f0-9]+:[	 ]*62 e4 fc 08 f1 d0[	 ]+crc32  %rax,%r18
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 da d1[	 ]+encodekey128[	 ]+%r25d,%edx
-[	 ]*[a-f0-9]+:[	 ]*62 dc 7e 08 db d1[	 ]+encodekey256[	 ]+%r25d,%edx
 [	 ]*[a-f0-9]+:[	 ]*67 62 4c 7f 08 f8 8c 87 23 01 00 00[	 ]+enqcmd[	 ]+0x123\(%r31d,%eax,4\),%r25d
 [	 ]*[a-f0-9]+:[	 ]*62 4c 7f 08 f8 bc 87 23 01 00 00[	 ]+enqcmd[	 ]+0x123\(%r31,%rax,4\),%r31
 [	 ]*[a-f0-9]+:[	 ]*67 62 4c 7e 08 f8 8c 87 23 01 00 00[	 ]+enqcmds[	 ]+0x123\(%r31d,%eax,4\),%r25d
@@ -291,13 +264,6 @@  Disassembly of section \.text:
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 08 f5 df[	 ]+pext[	 ]+%r31,%r15,%r11
 [	 ]*[a-f0-9]+:[	 ]*62 da 36 00 f5 94 87 23 01 00 00[	 ]+pext[	 ]+0x123\(%r31,%rax,4\),%r25d,%edx
 [	 ]*[a-f0-9]+:[	 ]*62 5a 86 00 f5 bc 87 23 01 00 00[	 ]+pext[	 ]+0x123\(%r31,%rax,4\),%r31,%r15
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d9 a4 87 23 01 00 00[	 ]+sha1msg1[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 da a4 87 23 01 00 00[	 ]+sha1msg2[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d8 a4 87 23 01 00 00[	 ]+sha1nexte[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 d4 a4 87 23 01 00 00 7b[	 ]+sha1rnds4[	 ]+\$0x7b,0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 dc a4 87 23 01 00 00[	 ]+sha256msg1[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 dd a4 87 23 01 00 00[	 ]+sha256msg2[	 ]+0x123\(%r31,%rax,4\),%xmm12
-[	 ]*[a-f0-9]+:[	 ]*62 5c 7c 08 db a4 87 23 01 00 00[	 ]+sha256rnds2[	 ]+%xmm0,0x123\(%r31,%rax,4\),%xmm12
 [	 ]*[a-f0-9]+:[	 ]*62 72 35 00 f7 d2[	 ]+shlx[	 ]+%r25d,%edx,%r10d
 [	 ]*[a-f0-9]+:[	 ]*62 da 35 00 f7 94 87 23 01 00 00[	 ]+shlx[	 ]+%r25d,0x123\(%r31,%rax,4\),%edx
 [	 ]*[a-f0-9]+:[	 ]*62 52 85 00 f7 df[	 ]+shlx[	 ]+%r31,%r15,%r11
diff --git a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.s b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.s
index 0773dc562ab..83806782e5e 100644
--- a/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.s
+++ b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted.s
@@ -6,14 +6,6 @@  _start:
 	aadd	%r31,0x123(%r31,%rax,4)
 	aand	%r25d,0x123(%r31,%rax,4)
 	aand	%r31,0x123(%r31,%rax,4)
-	aesdec128kl	0x123(%r31,%rax,4),%xmm12
-	aesdec256kl	0x123(%r31,%rax,4),%xmm12
-	aesdecwide128kl	0x123(%r31,%rax,4)
-	aesdecwide256kl	0x123(%r31,%rax,4)
-	aesenc128kl	0x123(%r31,%rax,4),%xmm12
-	aesenc256kl	0x123(%r31,%rax,4),%xmm12
-	aesencwide128kl	0x123(%r31,%rax,4)
-	aesencwide256kl	0x123(%r31,%rax,4)
 	aor	%r25d,0x123(%r31,%rax,4)
 	aor	%r31,0x123(%r31,%rax,4)
 	axor	%r25d,0x123(%r31,%rax,4)
@@ -78,8 +70,6 @@  _start:
 	crc32w	%r31w, %r21d
 	crc32w	(%r31),%r21d
 	crc32	%rax, %r18
-	encodekey128	%r25d,%edx
-	encodekey256	%r25d,%edx
 	enqcmd	0x123(%r31d,%eax,4),%r25d
 	enqcmd	0x123(%r31,%rax,4),%r31
 	enqcmds	0x123(%r31d,%eax,4),%r25d
@@ -127,13 +117,6 @@  _start:
 	pext	%r31,%r15,%r11
 	pext	0x123(%r31,%rax,4),%r25d,%edx
 	pext	0x123(%r31,%rax,4),%r31,%r15
-	sha1msg1	0x123(%r31,%rax,4),%xmm12
-	sha1msg2	0x123(%r31,%rax,4),%xmm12
-	sha1nexte	0x123(%r31,%rax,4),%xmm12
-	sha1rnds4	$0x7b,0x123(%r31,%rax,4),%xmm12
-	sha256msg1	0x123(%r31,%rax,4),%xmm12
-	sha256msg2	0x123(%r31,%rax,4),%xmm12
-	sha256rnds2	0x123(%r31,%rax,4),%xmm12
 	shlx	%r25d,%edx,%r10d
 	shlx	%r25d,0x123(%r31,%rax,4),%edx
 	shlx	%r31,%r15,%r11
@@ -166,14 +149,6 @@  _start:
 	aadd	[r31+rax*4+0x123],r31
 	aand	[r31+rax*4+0x123],r25d
 	aand	[r31+rax*4+0x123],r31
-	aesdec128kl	xmm12,[r31+rax*4+0x123]
-	aesdec256kl	xmm12,[r31+rax*4+0x123]
-	aesdecwide128kl	[r31+rax*4+0x123]
-	aesdecwide256kl	[r31+rax*4+0x123]
-	aesenc128kl	xmm12,[r31+rax*4+0x123]
-	aesenc256kl	xmm12,[r31+rax*4+0x123]
-	aesencwide128kl	[r31+rax*4+0x123]
-	aesencwide256kl	[r31+rax*4+0x123]
 	aor	[r31+rax*4+0x123],r25d
 	aor	[r31+rax*4+0x123],r31
 	axor	[r31+rax*4+0x123],r25d
@@ -238,8 +213,6 @@  _start:
 	crc32	r21d,r31w
 	crc32	r21d,WORD PTR [r31]
 	crc32	r18,rax
-	encodekey128	edx,r25d
-	encodekey256	edx,r25d
 	enqcmd	r25d,[r31d+eax*4+0x123]
 	enqcmd	r31,[r31+rax*4+0x123]
 	enqcmds	r25d,[r31d+eax*4+0x123]
@@ -287,13 +260,6 @@  _start:
 	pext	r11,r15,r31
 	pext	edx,r25d,DWORD PTR [r31+rax*4+0x123]
 	pext	r15,r31,QWORD PTR [r31+rax*4+0x123]
-	sha1msg1	xmm12,XMMWORD PTR [r31+rax*4+0x123]
-	sha1msg2	xmm12,XMMWORD PTR [r31+rax*4+0x123]
-	sha1nexte	xmm12,XMMWORD PTR [r31+rax*4+0x123]
-	sha1rnds4	xmm12,XMMWORD PTR [r31+rax*4+0x123],0x7b
-	sha256msg1	xmm12,XMMWORD PTR [r31+rax*4+0x123]
-	sha256msg2	xmm12,XMMWORD PTR [r31+rax*4+0x123]
-	sha256rnds2	xmm12,XMMWORD PTR [r31+rax*4+0x123]
 	shlx	r10d,edx,r25d
 	shlx	edx,DWORD PTR [r31+rax*4+0x123],r25d
 	shlx	r11,r15,r31
diff --git a/opcodes/i386-dis-evex-prefix.h b/opcodes/i386-dis-evex-prefix.h
index 37e64607ae6..5e6423790b5 100644
--- a/opcodes/i386-dis-evex-prefix.h
+++ b/opcodes/i386-dis-evex-prefix.h
@@ -338,41 +338,6 @@ 
     { "vcmpp%XH", { MaskG, Vex, EXxh, EXxEVexS, CMP }, 0 },
     { "vcmps%XH", { MaskG, VexScalar, EXw, EXxEVexS, CMP }, 0 },
   },
-  /* PREFIX_EVEX_MAP4_D8 */
-  {
-    { "sha1nexte", { XM, EXxmm }, 0 },
-    { REG_TABLE (REG_0F38D8_PREFIX_1) },
-  },
-  /* PREFIX_EVEX_MAP4_DA */
-  {
-    { "sha1msg2", { XM, EXxmm }, 0 },
-    { "encodekey128", { Gd, Rd }, 0 },
-  },
-  /* PREFIX_EVEX_MAP4_DB */
-  {
-    { "sha256rnds2", { XM, EXxmm, XMM0 }, 0 },
-    { "encodekey256", { Gd, Rd }, 0 },
-  },
-  /* PREFIX_EVEX_MAP4_DC */
-  {
-    { "sha256msg1", { XM, EXxmm }, 0 },
-    { "aesenc128kl", { XM, M }, 0 },
-  },
-  /* PREFIX_EVEX_MAP4_DD */
-  {
-    { "sha256msg2", { XM, EXxmm }, 0 },
-    { "aesdec128kl", { XM, M }, 0 },
-  },
-  /* PREFIX_EVEX_MAP4_DE */
-  {
-    { Bad_Opcode },
-    { "aesenc256kl", { XM, M }, 0 },
-  },
-  /* PREFIX_EVEX_MAP4_DF */
-  {
-    { Bad_Opcode },
-    { "aesdec256kl", { XM, M }, 0 },
-  },
   /* PREFIX_EVEX_MAP4_F0 */
   {
     { "crc32A", { Gdq, Eb }, 0 },
diff --git a/opcodes/i386-dis-evex.h b/opcodes/i386-dis-evex.h
index 45b52653808..b3258afa733 100644
--- a/opcodes/i386-dis-evex.h
+++ b/opcodes/i386-dis-evex.h
@@ -1113,19 +1113,19 @@  static const struct dis386 evex_table[][256] = {
     { REG_TABLE (REG_D1) },
     { REG_TABLE (REG_D2) },
     { REG_TABLE (REG_D3) },
-    { "sha1rnds4",	{ XM, EXxmm, Ib }, NO_PREFIX },
+    { Bad_Opcode },
     { Bad_Opcode },
     { Bad_Opcode },
     { Bad_Opcode },
     /* D8 */
-    { PREFIX_TABLE (PREFIX_EVEX_MAP4_D8) },
-    { "sha1msg1",	{ XM, EXxmm }, NO_PREFIX },
-    { PREFIX_TABLE (PREFIX_EVEX_MAP4_DA) },
-    { PREFIX_TABLE (PREFIX_EVEX_MAP4_DB) },
-    { PREFIX_TABLE (PREFIX_EVEX_MAP4_DC) },
-    { PREFIX_TABLE (PREFIX_EVEX_MAP4_DD) },
-    { PREFIX_TABLE (PREFIX_EVEX_MAP4_DE) },
-    { PREFIX_TABLE (PREFIX_EVEX_MAP4_DF) },
+    { Bad_Opcode },
+    { Bad_Opcode },
+    { Bad_Opcode },
+    { Bad_Opcode },
+    { Bad_Opcode },
+    { Bad_Opcode },
+    { Bad_Opcode },
+    { Bad_Opcode },
     /* E0 */
     { Bad_Opcode },
     { Bad_Opcode },
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index d06a918449c..b86e6ff6045 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -1198,13 +1198,6 @@  enum
   PREFIX_EVEX_0F3A67,
   PREFIX_EVEX_0F3AC2,
 
-  PREFIX_EVEX_MAP4_D8,
-  PREFIX_EVEX_MAP4_DA,
-  PREFIX_EVEX_MAP4_DB,
-  PREFIX_EVEX_MAP4_DC,
-  PREFIX_EVEX_MAP4_DD,
-  PREFIX_EVEX_MAP4_DE,
-  PREFIX_EVEX_MAP4_DF,
   PREFIX_EVEX_MAP4_F0,
   PREFIX_EVEX_MAP4_F1,
   PREFIX_EVEX_MAP4_F2,
@@ -12828,11 +12821,6 @@  print_vector_reg (instr_info *ins, unsigned int reg, int bytemode)
   else
     names = att_names_xmm;
   oappend_register (ins, names[reg]);
-
-  /* Legacy insns promoted to EVEX, like the legacy insns themselves, don't
-     allow use of the upper 16 vector registers.  */
-  if (ins->evex_type == evex_from_legacy && reg >= 16)
-    oappend (ins, "(bad)");
 }
 
 static bool
diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl
index 8aeb316b96b..e3123e77bfb 100644
--- a/opcodes/i386-opc.tbl
+++ b/opcodes/i386-opc.tbl
@@ -2074,21 +2074,13 @@  bndldx, 0x0f1a, MPX, Modrm|Anysize|IgnoreSize|NoSuf, { BaseIndex, RegBND }
 
 // SHA instructions.
 sha1rnds4, 0xf3acc, SHA, Modrm|NoSuf, { Imm8|Imm8S, RegXMM|Unspecified|BaseIndex, RegXMM }
-sha1rnds4, 0xd4, SHA&APX_F, Modrm|NoSuf|EVexMap4, { Imm8|Imm8S, RegXMM|Unspecified|BaseIndex, RegXMM }
 sha1nexte, 0xf38c8, SHA, Modrm|NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM }
-sha1nexte, 0xd8, SHA&APX_F, Modrm|NoSuf|EVexMap4, { RegXMM|Unspecified|BaseIndex, RegXMM }
 sha1msg1, 0xf38c9, SHA, Modrm|NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM }
-sha1msg1, 0xd9, SHA&APX_F, Modrm|NoSuf|EVexMap4, { RegXMM|Unspecified|BaseIndex, RegXMM }
 sha1msg2, 0xf38ca, SHA, Modrm|NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM }
-sha1msg2, 0xda, SHA&APX_F, Modrm|NoSuf|EVexMap4, { RegXMM|Unspecified|BaseIndex, RegXMM }
 sha256rnds2, 0xf38cb, SHA, Modrm|NoSuf, { Acc|Xmmword, RegXMM|Unspecified|BaseIndex, RegXMM }
-sha256rnds2, 0xdb, SHA&APX_F, Modrm|NoSuf|EVexMap4, { Acc|Xmmword, RegXMM|Unspecified|BaseIndex, RegXMM }
 sha256rnds2, 0xf38cb, SHA, Modrm|NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM }
-sha256rnds2, 0xdb, SHA&APX_F, Modrm|NoSuf|EVexMap4, { RegXMM|Unspecified|BaseIndex, RegXMM }
 sha256msg1, 0xf38cc, SHA, Modrm|NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM }
-sha256msg1, 0xdc, SHA&APX_F, Modrm|NoSuf|EVexMap4, { RegXMM|Unspecified|BaseIndex, RegXMM }
 sha256msg2, 0xf38cd, SHA, Modrm|NoSuf, { RegXMM|Unspecified|BaseIndex, RegXMM }
-sha256msg2, 0xdd, SHA&APX_F, Modrm|NoSuf|EVexMap4, { RegXMM|Unspecified|BaseIndex, RegXMM }
 
 // SHA512 instructions.
 
@@ -3203,25 +3195,15 @@  tilezero, 0xf249, AMX_TILE, Modrm|Vex128|Space0F38|VexW0|NoSuf, { RegTMM }
 
 loadiwkey, 0xf30f38dc, KL, Load|Modrm|NoSuf, { RegXMM, RegXMM }
 encodekey128, 0xf30f38fa, KL, Modrm|NoSuf, { Reg32, Reg32 }
-encodekey128, 0xf3da, KL&APX_F, Modrm|NoSuf|EVexMap4, { Reg32, Reg32 }
 encodekey256, 0xf30f38fb, KL, Modrm|NoSuf, { Reg32, Reg32 }
-encodekey256, 0xf3db, KL&APX_F, Modrm|NoSuf|EVexMap4, { Reg32, Reg32 }
 aesenc128kl, 0xf30f38dc, KL, Modrm|NoSuf, { Unspecified|BaseIndex, RegXMM }
-aesenc128kl, 0xf3dc, KL&APX_F, Modrm|NoSuf|EVexMap4, { Unspecified|BaseIndex, RegXMM }
 aesdec128kl, 0xf30f38dd, KL, Modrm|NoSuf, { Unspecified|BaseIndex, RegXMM }
-aesdec128kl, 0xf3dd, KL&APX_F, Modrm|NoSuf|EVexMap4, { Unspecified|BaseIndex, RegXMM }
 aesenc256kl, 0xf30f38de, KL, Modrm|NoSuf, { Unspecified|BaseIndex, RegXMM }
-aesenc256kl, 0xf3de, KL&APX_F, Modrm|NoSuf|EVexMap4, { Unspecified|BaseIndex, RegXMM }
 aesdec256kl, 0xf30f38df, KL, Modrm|NoSuf, { Unspecified|BaseIndex, RegXMM }
-aesdec256kl, 0xf3df, KL&APX_F, Modrm|NoSuf|EVexMap4, { Unspecified|BaseIndex, RegXMM }
 aesencwide128kl, 0xf30f38d8/0, WideKL, Modrm|NoSuf, { Unspecified|BaseIndex }
-aesencwide128kl, 0xf3d8/0, WideKL&APX_F, Modrm|NoSuf|EVexMap4, { Unspecified|BaseIndex }
 aesdecwide128kl, 0xf30f38d8/1, WideKL, Modrm|NoSuf, { Unspecified|BaseIndex }
-aesdecwide128kl, 0xf3d8/1, WideKL&APX_F, Modrm|NoSuf|EVexMap4, { Unspecified|BaseIndex }
 aesencwide256kl, 0xf30f38d8/2, WideKL, Modrm|NoSuf, { Unspecified|BaseIndex }
-aesencwide256kl, 0xf3d8/2, WideKL&APX_F, Modrm|NoSuf|EVexMap4, { Unspecified|BaseIndex }
 aesdecwide256kl, 0xf30f38d8/3, WideKL, Modrm|NoSuf, { Unspecified|BaseIndex }
-aesdecwide256kl, 0xf3d8/3, WideKL&APX_F, Modrm|NoSuf|EVexMap4, { Unspecified|BaseIndex }
 
 // KEYLOCKER instructions end.