Index: lib/Target/X86/AsmParser/X86AsmParser.cpp =================================================================== --- lib/Target/X86/AsmParser/X86AsmParser.cpp +++ lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -2382,6 +2382,17 @@ } } + // Transforms "xlat mem8" into "xlatb" + if ((Name == "xlat" || Name == "xlatb") && Operands.size() == 2) { + X86Operand &Op1 = static_cast(*Operands[1]); + if (Op1.isMem8()) { + Warning(Op1.getStartLoc(), "memory operand is only for determining the " + "size, (R|E)BX will be used for the location"); + Operands.pop_back(); + static_cast(*Operands[0]).setTokenValue("xlatb"); + } + } + return false; } Index: test/MC/X86/intel-syntax.s =================================================================== --- test/MC/X86/intel-syntax.s +++ test/MC/X86/intel-syntax.s @@ -751,3 +751,7 @@ sidt fword ptr [eax] // CHECK: sidtq (%eax) + +xlat byte ptr [eax] +// CHECK: xlatb +// CHECK-STDERR: memory operand is only for determining the size, (R|E)BX will be used for the location