This is an archive of the discontinued LLVM Phabricator instance.

[X86] Teach assembler to accept vmsave/vmload/vmrun/invlpga/skinit with or without the fixed register operands
ClosedPublic

Authored by craig.topper on Dec 18 2020, 1:02 AM.

Details

Summary

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.

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

Diff Detail

Event Timeline

craig.topper created this revision.Dec 18 2020, 1:02 AM
craig.topper requested review of this revision.Dec 18 2020, 1:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 18 2020, 1:02 AM
RKSimon added inline comments.Dec 18 2020, 3:41 AM
llvm/lib/Target/X86/X86InstrSVM.td
61

Why didn't you need to edit these?

craig.topper added inline comments.Dec 18 2020, 9:12 AM
llvm/lib/Target/X86/X86InstrSVM.td
61

Mistake. Thanks

Update tests. Fix various copy/paste mistakes

craig.topper edited the summary of this revision. (Show Details)Dec 19 2020, 12:12 AM
craig.topper retitled this revision from [X86] WIP Teach assembler to accept vmsave/vmload/vmrun/invlpga/skinit with or without the fixed register operands to [X86] Teach assembler to accept vmsave/vmload/vmrun/invlpga/skinit with or without the fixed register operands.Dec 19 2020, 12:39 AM
pengfei accepted this revision.Dec 19 2020, 4:49 AM

LGTM.

This revision is now accepted and ready to land.Dec 19 2020, 4:49 AM