[PATCH] x86/APX: INV{EPT,PCID,VPID} are WIG

Jan Beulich jbeulich@suse.com
Mon Feb 19 07:52:35 GMT 2024


On 18.02.2024 05:06, Cui, Lili wrote:
>> While various other entries in version 003 of the spec aren't quite as explicit
>> (due to simply leaving the respective field blank), all three have a clear
>> IGNORED there. IOW they ought to be emitted with EVEX.W=0 by default (and
>> respect -mevexwig=).
>> ---
>> For those other insns (at least SHA* and KeyLocker ones) likely VexWIG is also
>> missing. But the spec needs clarifying first; respective testcase expectations are
>> added here with '.' instead of a specific digit. Yet more issues exist, but those
>> cannot simply be dealt with by adding VexWIG in the opcode table.
>>
> 
> Jan, I have a question, are these valid test cases? After adding "-mevexwig=1", all test results look the same as x86-64-apx-evex-promoted.d without any changes.

Did you look at merely the decoded insns and their operands? They ought
to be identifcal. The difference is only visible in the hex encodings,
e.g. ...

>> --- /dev/null
>> +++ b/gas/testsuite/gas/i386/x86-64-apx-evex-promoted-wig.d
>> @@ -0,0 +1,329 @@
>> +#as: -mevexwig=1
>> +#objdump: -dw
>> +#name: x86_64 APX_F EVEX-Promoted insns w/ -mevexwig=1
>> +#source: x86-64-apx-evex-promoted.s
>> +
>> +.*: +file format .*
>> +
>> +Disassembly of section \.text:
>> +
>> +0+ <_start>:
>> +[	 ]*[a-f0-9]+:[	 ]*62 4c 7c 08 fc 8c 87 23 01 00 00[	 ]+aadd[
>> 	 ]+%r25d,0x123\(%r31,%rax,4\)
>> +[	 ]*[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 cc .e 08 dd b4 87 23 01 00 00[
>> 	 ]+aesdec128kl[	 ]+0x123\(%r31,%rax,4\),%xmm22
>> +[	 ]*[a-f0-9]+:[	 ]*62 cc .e 08 df b4 87 23 01 00 00[
>> 	 ]+aesdec256kl[	 ]+0x123\(%r31,%rax,4\),%xmm22
>> +[	 ]*[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 cc .e 08 dc b4 87 23 01 00 00[
>> 	 ]+aesenc128kl[	 ]+0x123\(%r31,%rax,4\),%xmm22
>> +[	 ]*[a-f0-9]+:[	 ]*62 cc .e 08 de b4 87 23 01 00 00[
>> 	 ]+aesenc256kl[	 ]+0x123\(%r31,%rax,4\),%xmm22
>> +[	 ]*[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\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 4c fe 08 fc bc 87 23 01 00 00[	 ]+axor[
>> 	 ]+%r31,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 72 34 00 f7 d2[	 ]+bextr[
>> 	 ]+%r25d,%edx,%r10d
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 34 00 f7 94 87 23 01 00 00[	 ]+bextr[
>> 	 ]+%r25d,0x123\(%r31,%rax,4\),%edx
>> +[	 ]*[a-f0-9]+:[	 ]*62 52 84 00 f7 df[	 ]+bextr[
>> 	 ]+%r31,%r15,%r11
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 84 00 f7 bc 87 23 01 00 00[	 ]+bextr[
>> 	 ]+%r31,0x123\(%r31,%rax,4\),%r15
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 6c 08 f3 d9[	 ]+blsi[	 ]+%r25d,%edx
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 84 08 f3 df[	 ]+blsi[	 ]+%r31,%r15
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 34 00 f3 9c 87 23 01 00 00[	 ]+blsi[
>> 	 ]+0x123\(%r31,%rax,4\),%r25d
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 84 00 f3 9c 87 23 01 00 00[	 ]+blsi[
>> 	 ]+0x123\(%r31,%rax,4\),%r31
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 6c 08 f3 d1[	 ]+blsmsk[
>> 	 ]+%r25d,%edx
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 84 08 f3 d7[	 ]+blsmsk[	 ]+%r31,%r15
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 34 00 f3 94 87 23 01 00 00[	 ]+blsmsk[
>> 	 ]+0x123\(%r31,%rax,4\),%r25d
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 84 00 f3 94 87 23 01 00 00[	 ]+blsmsk[
>> 	 ]+0x123\(%r31,%rax,4\),%r31
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 6c 08 f3 c9[	 ]+blsr[	 ]+%r25d,%edx
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 84 08 f3 cf[	 ]+blsr[	 ]+%r31,%r15
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 34 00 f3 8c 87 23 01 00 00[	 ]+blsr[
>> 	 ]+0x123\(%r31,%rax,4\),%r25d
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 84 00 f3 8c 87 23 01 00 00[	 ]+blsr[
>> 	 ]+0x123\(%r31,%rax,4\),%r31
>> +[	 ]*[a-f0-9]+:[	 ]*62 72 34 00 f5 d2[	 ]+bzhi[
>> 	 ]+%r25d,%edx,%r10d
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 34 00 f5 94 87 23 01 00 00[	 ]+bzhi[
>> 	 ]+%r25d,0x123\(%r31,%rax,4\),%edx
>> +[	 ]*[a-f0-9]+:[	 ]*62 52 84 00 f5 df[	 ]+bzhi[	 ]+%r31,%r15,%r11
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 84 00 f5 bc 87 23 01 00 00[	 ]+bzhi[
>> 	 ]+%r31,0x123\(%r31,%rax,4\),%r15
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 e6 94 87 23 01 00 00[
>> 	 ]+cmpbexadd[	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 e6 bc 87 23 01 00 00[
>> 	 ]+cmpbexadd[	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 e2 94 87 23 01 00 00[	 ]+cmpbxadd[
>> 	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 e2 bc 87 23 01 00 00[	 ]+cmpbxadd[
>> 	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 ec 94 87 23 01 00 00[	 ]+cmplxadd[
>> 	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 ec bc 87 23 01 00 00[	 ]+cmplxadd[
>> 	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 e7 94 87 23 01 00 00[
>> 	 ]+cmpnbexadd[	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 e7 bc 87 23 01 00 00[
>> 	 ]+cmpnbexadd[	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 e3 94 87 23 01 00 00[
>> 	 ]+cmpnbxadd[	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 e3 bc 87 23 01 00 00[
>> 	 ]+cmpnbxadd[	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 ef 94 87 23 01 00 00[
>> 	 ]+cmpnlexadd[	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 ef bc 87 23 01 00 00[
>> 	 ]+cmpnlexadd[	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 ed 94 87 23 01 00 00[	 ]+cmpnlxadd[
>> 	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 ed bc 87 23 01 00 00[	 ]+cmpnlxadd[
>> 	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 e1 94 87 23 01 00 00[
>> 	 ]+cmpnoxadd[	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 e1 bc 87 23 01 00 00[
>> 	 ]+cmpnoxadd[	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 eb 94 87 23 01 00 00[
>> 	 ]+cmpnpxadd[	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 eb bc 87 23 01 00 00[
>> 	 ]+cmpnpxadd[	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 e9 94 87 23 01 00 00[
>> 	 ]+cmpnsxadd[	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 e9 bc 87 23 01 00 00[
>> 	 ]+cmpnsxadd[	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 e5 94 87 23 01 00 00[
>> 	 ]+cmpnzxadd[	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 e5 bc 87 23 01 00 00[
>> 	 ]+cmpnzxadd[	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 e0 94 87 23 01 00 00[	 ]+cmpoxadd[
>> 	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 e0 bc 87 23 01 00 00[	 ]+cmpoxadd[
>> 	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 ea 94 87 23 01 00 00[	 ]+cmppxadd[
>> 	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 ea bc 87 23 01 00 00[	 ]+cmppxadd[
>> 	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 e8 94 87 23 01 00 00[	 ]+cmpsxadd[
>> 	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 e8 bc 87 23 01 00 00[	 ]+cmpsxadd[
>> 	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 da 35 00 e4 94 87 23 01 00 00[	 ]+cmpzxadd[
>> 	 ]+%r25d,%edx,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 5a 85 00 e4 bc 87 23 01 00 00[	 ]+cmpzxadd[
>> 	 ]+%r31,%r15,0x123\(%r31,%rax,4\)
>> +[	 ]*[a-f0-9]+:[	 ]*62 cc fc 08 f1 f7[	 ]+crc32  %r31,%r22
>> +[	 ]*[a-f0-9]+:[	 ]*62 cc fc 08 f1 37[	 ]+crc32q \(%r31\),%r22
>> +[	 ]*[a-f0-9]+:[	 ]*62 ec fc 08 f0 cb[	 ]+crc32  %r19b,%r17
>> +[	 ]*[a-f0-9]+:[	 ]*62 ec 7c 08 f0 eb[	 ]+crc32  %r19b,%r21d
>> +[	 ]*[a-f0-9]+:[	 ]*62 fc 7c 08 f0 1b[	 ]+crc32b \(%r19\),%ebx
>> +[	 ]*[a-f0-9]+:[	 ]*62 cc 7c 08 f1 ff[	 ]+crc32  %r31d,%r23d
>> +[	 ]*[a-f0-9]+:[	 ]*62 cc 7c 08 f1 3f[	 ]+crc32l \(%r31\),%r23d
>> +[	 ]*[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
>> +[	 ]*[a-f0-9]+:[	 ]*62 4c .e 08 f8 bc 87 23 01 00 00[	 ]+enqcmds[
>> 	 ]+0x123\(%r31,%rax,4\),%r31
>> +[	 ]*[a-f0-9]+:[	 ]*62 4c fe 08 f0 bc 87 23 01 00 00[	 ]+invept[
>> 	 ]+0x123\(%r31,%rax,4\),%r31
>> +[	 ]*[a-f0-9]+:[	 ]*62 4c fe 08 f2 bc 87 23 01 00 00[	 ]+invpcid[
>> 	 ]+0x123\(%r31,%rax,4\),%r31
>> +[	 ]*[a-f0-9]+:[	 ]*62 4c fe 08 f1 bc 87 23 01 00 00[	 ]+invvpid[
>> 	 ]+0x123\(%r31,%rax,4\),%r31

... for these three: EVEX.W is now set, when it's clear in the test
without the -mevexwig=1. As said in the remark, the use of . where
the spec doesn't clearly state how EVEX.W is treated is intentional.

Jan


More information about the Binutils mailing list