[PATCH] D15150: Add support for "xlat m8"
Marina Yatsina via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 2 05:53:20 PST 2015
myatsina created this revision.
myatsina added a reviewer: rnk.
myatsina added a subscriber: llvm-commits.
myatsina set the repository for this revision to rL LLVM.
According to x86 spec "xlat m8" is a legal instruction and it is equivalent to "xlatb".
Repository:
rL LLVM
http://reviews.llvm.org/D15150
Files:
lib/Target/X86/AsmParser/X86AsmParser.cpp
test/MC/X86/intel-syntax.s
Index: lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -2372,6 +2372,15 @@
}
}
+ // Transforms "xlat mem8" into "xlatb"
+ if ((Name == "xlat" || Name == "xlatb") && Operands.size() == 2) {
+ X86Operand &Op1 = static_cast<X86Operand &>(*Operands[1]);
+ if (Op1.isMem8()) {
+ Operands.pop_back();
+ static_cast<X86Operand &>(*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
@@ -736,3 +736,6 @@
fbstp tbyte ptr [eax]
// CHECK: fbld (%eax)
// CHECK: fbstp (%eax)
+
+xlat byte ptr [eax]
+// CHECK: xlatb
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15150.41618.patch
Type: text/x-patch
Size: 880 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151202/352d7841/attachment.bin>
More information about the llvm-commits
mailing list