[PATCH] D89837: [X86] Error on using h-registers with REX prefix in the assembler instead of leaving it to a fatal error in the encoder.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 18:53:47 PDT 2020


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3634
+      HReg = Reg;
+    if (X86II::isX86_64NonExtLowByteReg(Reg) || X86II::isX86_64ExtendedReg(Reg))
+      UsesRex = true;
----------------
pengfei wrote:
> It seems X86MCCodeEmitter::emitREXPrefix has more detailed check for each form. Especially, the commens says "Emit REX prefix ... 2) non-default operand size". Is it not covered by this case?
I'm not sure what the difference is between "1) 64-bit instructions" and "2) non-default operand size". 

I think the form code is just mapping registers to different bits in the REX prefix. I don't think the assembler error needs to care about the exact bits, just that some bit will be affected by the operands. But I might be wrong.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89837/new/

https://reviews.llvm.org/D89837



More information about the llvm-commits mailing list