[llvm] [X86][MC][AsmParser] Reject H-byte regs with VEX/EVEX-encoded 8-bit RR (NDD) (PR #160039)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 24 01:03:10 PDT 2025


================
@@ -4036,11 +4041,19 @@ bool X86AsmParser::validateInstruction(MCInst &Inst, const OperandVector &Ops) {
         UsesRex = true;
     }
 
-    if (UsesRex && HReg) {
-      StringRef RegName = X86IntelInstPrinter::getRegisterName(HReg);
-      return Error(Ops[0]->getStartLoc(),
-                   "can't encode '" + RegName + "' in an instruction requiring "
-                   "REX prefix");
+    if (HReg) {
+      if (Enc == X86II::EVEX || ForcedOpcodePrefix == OpcodePrefix_REX2) {
----------------
phoebewang wrote:

https://godbolt.org/z/EM87o65Ws

https://github.com/llvm/llvm-project/pull/160039


More information about the llvm-commits mailing list