Index: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp =================================================================== --- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -2475,6 +2475,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: llvm/trunk/test/MC/X86/intel-syntax.s =================================================================== --- llvm/trunk/test/MC/X86/intel-syntax.s +++ llvm/trunk/test/MC/X86/intel-syntax.s @@ -775,3 +775,7 @@ // CHECK: movsl (%esi), %es:(%edi) // CHECK-STDERR: memory operand is only for determining the size, ES:(R|E)DI will be used for the location // CHECK-STDERR: memory operand is only for determining the size, ES:(R|E)SI will be used for the location + +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