[X86] Teach assembler to accept vmsave/vmload/vmrun/invlpga/skinit with or without...
authorCraig Topper <craig.topper@sifive.com>
Fri, 18 Dec 2020 08:54:45 +0000 (00:54 -0800)
committerCraig Topper <craig.topper@sifive.com>
Sat, 19 Dec 2020 19:01:55 +0000 (11:01 -0800)
commitf47b07315a3c308a214119244b216602c537a1b2
treeddbaabd0f41777906fda0b3c418286f2607fa817
parenta6516a820d3548065654dabbaa95012162c74d99
[X86] Teach assembler to accept vmsave/vmload/vmrun/invlpga/skinit with or without the fixed register operands

These instructions read their inputs from fixed registers rather
than using a modrm byte. We shouldn't require the user to list them
when parsing assembly. This matches the GNU assembler.

This patch adds InstAliases so we can accept either form. It also
changes the printing code to use the form without registers. This
will change the behavior of llvm-objdump, but should be consistent
with binutils objdump. This also matches what we already do in LLVM for
clzero and monitorx which also used fixed registers.

I need to add and improve tests before this can be commited. The
disassembler tests exist, but weren't checking the fixed register
so they pass before and after this change.

Fixes https://github.com/ClangBuiltLinux/linux/issues/1216

Differential Revision: https://reviews.llvm.org/D93524
19 files changed:
llvm/lib/Target/X86/X86InstrSVM.td
llvm/test/MC/Disassembler/X86/simple-tests.txt
llvm/test/MC/X86/SVM-32.s
llvm/test/MC/X86/SVM-64.s
llvm/test/MC/X86/x86-32-coverage.s
llvm/test/MC/X86/x86-32.s
llvm/test/tools/llvm-mca/X86/Atom/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/Barcelona/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/BdVer2/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/Broadwell/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/BtVer2/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/Generic/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/Haswell/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/SLM/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/SandyBridge/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/SkylakeClient/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/SkylakeServer/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/Znver1/resources-x86_64.s
llvm/test/tools/llvm-mca/X86/Znver2/resources-x86_64.s