This is an archive of the discontinued LLVM Phabricator instance.

[X86] Fix disassembly of x86-64 GDTLS code sequence
ClosedPublic

Authored by andrewng on Jan 29 2021, 7:14 AM.

Details

Summary

For x86-64 the REX.w prefix takes precedence over any other size
override (i.e. 0x66). Therefore, for x86-64 when REX.w is present set
'hasOpSize' to false to ensure that any size override is ignored.

Fixes PR48901.

Diff Detail

Event Timeline

andrewng created this revision.Jan 29 2021, 7:14 AM
andrewng requested review of this revision.Jan 29 2021, 7:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2021, 7:14 AM

LG

llvm/test/MC/Disassembler/X86/x86-64.txt
332–335

Add a TODO comment that this should display data16 prefixes.

llvm/test/tools/llvm-objdump/X86/disassemble-gdtls.s
2

llvm-mc %s -filetype=obj -triple=x86_64

This is not tied to Linux.

4

Add a TODO comment that this should display data16 prefixes.

RKSimon added a subscriber: RKSimon.Feb 1 2021, 5:01 AM
RKSimon added inline comments.
llvm/test/tools/llvm-objdump/X86/disassemble-gdtls.s
9

Please can you rename 'foo' to 'PR48901' - it greatly speeds up tracking back through tests if we know which bug it came from.

andrewng updated this revision to Diff 320450.Feb 1 2021, 6:25 AM

Updated to address review comments.

andrewng marked 4 inline comments as done.Feb 1 2021, 6:26 AM
MaskRay accepted this revision.Feb 1 2021, 9:41 AM

Thanks! I'd let @RKSimon sign off as well.

This revision is now accepted and ready to land.Feb 1 2021, 9:41 AM
MaskRay added inline comments.Feb 1 2021, 9:42 AM
llvm/test/MC/Disassembler/X86/x86-64.txt
332–335

This perhaps needs a CHECK-NOT: data16 to enforce this.

RKSimon accepted this revision.Feb 1 2021, 10:26 AM

LGTM - cheers

andrewng marked an inline comment as done.Feb 2 2021, 3:34 AM
This revision was automatically updated to reflect the committed changes.