[X86][AsmParser] Don't allow X86::DX in CheckBaseRegAndIndexRegAndScale.
authorCraig Topper <craig.topper@intel.com>
Sat, 5 Jan 2019 23:30:28 +0000 (23:30 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 5 Jan 2019 23:30:28 +0000 (23:30 +0000)
This was here because out and in instructions allow '(%dx)' even though its not a memory reference. To handle this we build a special operand for the DX register reference before we get to the call to CheckBaseRegAndIndexRegAndScale. So we no longer need this special case.

llvm-svn: 350483

llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp

index 4801078..8f7b24f 100644 (file)
@@ -1011,8 +1011,7 @@ static bool CheckBaseRegAndIndexRegAndScale(unsigned BaseReg, unsigned IndexReg,
   // and then only in non-64-bit modes.
   if (X86MCRegisterClasses[X86::GR16RegClassID].contains(BaseReg) &&
       (Is64BitMode || (BaseReg != X86::BX && BaseReg != X86::BP &&
-                       BaseReg != X86::SI && BaseReg != X86::DI)) &&
-      BaseReg != X86::DX) {
+                       BaseReg != X86::SI && BaseReg != X86::DI))) {
     ErrMsg = "invalid 16-bit base register";
     return true;
   }