[PATCH] D120871: [X86] Emit REX prefix immediately before the opcode

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 2 23:25:36 PST 2022


Amir created this revision.
Amir added reviewers: skan, craig.topper.
Herald added subscribers: pengfei, arphaman, hiraditya.
Herald added a project: All.
Amir requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Fix prefix emission order to emit REX immediately before the opcode
(SDM vol2, 2.1, Figure 2-1). 
According to SDM vol2 2.2.1, "Other placements are ignored".

This fix has a side effect of outputting segment override prefix in a different
order than previously (benigh effect).

Follow-up to https://reviews.llvm.org/D120592


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120871

Files:
  llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
  llvm/test/MC/Disassembler/X86/moffs.txt
  llvm/test/MC/X86/I186-32.s
  llvm/test/MC/X86/I186-64.s
  llvm/test/MC/X86/I386-32.s
  llvm/test/MC/X86/I386-64.s
  llvm/test/MC/X86/I86-32.s
  llvm/test/MC/X86/I86-64.s
  llvm/test/MC/X86/code16gcc.s
  llvm/test/MC/X86/index-operations.s
  llvm/test/MC/X86/x86-16.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120871.412610.patch
Type: text/x-patch
Size: 20144 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220303/506d72f4/attachment.bin>


More information about the llvm-commits mailing list