x86: convert testcases to use .insn
authorJan Beulich <jbeulich@suse.com>
Fri, 31 Mar 2023 06:26:06 +0000 (08:26 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 31 Mar 2023 06:26:06 +0000 (08:26 +0200)
commit6967633c8b4902a7576e64c4ecf2ab6098c888f0
treed6e3bfd227488c15a8829a5528ce15977d1e9884
parent695a8c347a3de35b29c2184d487a487a1b0348cd
x86: convert testcases to use .insn

This can't be done for all insns currently encoded with .byte. For one
outside of 64-bit mode unused (typically ignored) register encoding bits
in VEX/XOP/EVEX prefixes can't be set to their non-default values, since
the necessary registers cannot be specified (and some of these bits
can't even be used outside of 64-bit mode). And then there are odd tests
like the first one in bad-bcast.s: Its purpose is to illegaly set EVEX.b
together with EVEX.W (which could be expressed; note though EVEX.W set
is invalid on its own), but then it also clears EVEX.B and EVEX.R' plus
it sets EVEX.vvvv to other than 0xf (rendering the test ambiguous,
because that's another #UD reason).

In {,x86-64-}disassem.s many bogus encodings exist - some with ModR/M
byte but insufficient displacement bytes, some using SIB encoding with
the SIB byte actually being the supposed immediate. Some of these could
be expressed by .insn, but I don't want to introduce bogus examples.
These will all need adjustment anyway once the disassembler is improved
in the way it deals with unrecognized encodings.

Generally generated code is meant to remain the same. {,x86-64-}nops.d
are exceptions because insn prefixes are emitted in a different order.
opcode{,-intel,-suffix}.d are also adjusted (along with an according
correction to opcode.s) to cover an apparent typo in the original tests
(xor when or was meant).

Where necessary --divide is added as gas option, to allow for the use
of the extension opcode functionality.

Comments are being adjusted where obviously wrong/misleading.
39 files changed:
gas/testsuite/gas/i386/amd.s
gas/testsuite/gas/i386/avx512f-nondef.s
gas/testsuite/gas/i386/cdr.s
gas/testsuite/gas/i386/disassem.d
gas/testsuite/gas/i386/disassem.s
gas/testsuite/gas/i386/evex.s
gas/testsuite/gas/i386/fpu-bad.d
gas/testsuite/gas/i386/fpu-bad.s
gas/testsuite/gas/i386/ilp32/x86-64-nops.d
gas/testsuite/gas/i386/katmai.d
gas/testsuite/gas/i386/katmai.s
gas/testsuite/gas/i386/mpx.s
gas/testsuite/gas/i386/nops.d
gas/testsuite/gas/i386/nops.s
gas/testsuite/gas/i386/opcode-intel.d
gas/testsuite/gas/i386/opcode-suffix.d
gas/testsuite/gas/i386/opcode.d
gas/testsuite/gas/i386/opcode.s
gas/testsuite/gas/i386/pr29483.s
gas/testsuite/gas/i386/prefetch-intel.d
gas/testsuite/gas/i386/prefetch.d
gas/testsuite/gas/i386/prefetch.s
gas/testsuite/gas/i386/prefix.s
gas/testsuite/gas/i386/x86-64-amx-bad.s
gas/testsuite/gas/i386/x86-64-amx-fp16-bad.s
gas/testsuite/gas/i386/x86-64-avx512_fp16-bad.s
gas/testsuite/gas/i386/x86-64-avx512f-nondef.s
gas/testsuite/gas/i386/x86-64-disassem.d
gas/testsuite/gas/i386/x86-64-disassem.s
gas/testsuite/gas/i386/x86-64-mpx.s
gas/testsuite/gas/i386/x86-64-nops.d
gas/testsuite/gas/i386/x86-64-nops.s
gas/testsuite/gas/i386/x86-64-opcode-bad.s
gas/testsuite/gas/i386/x86-64-opcode.d
gas/testsuite/gas/i386/x86-64-opcode.s
gas/testsuite/gas/i386/x86-64-prefetch-intel.d
gas/testsuite/gas/i386/x86-64-prefetch.d
gas/testsuite/gas/i386/x86-64-prefetchi-inval-register.d
gas/testsuite/gas/i386/x86-64-prefetchi-inval-register.s