diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-10-30 18:17:33 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-10-30 18:17:33 +0000 |
| commit | daae9eea8a42beefd6abb2efe94871037c0bb223 (patch) | |
| tree | 7775d3cc5f9746573691fd980e17382e782e1558 | |
| parent | fa40aee8716fb5023dde73e69a7dbb5cfc9d050d (diff) | |
| download | bcm5719-llvm-daae9eea8a42beefd6abb2efe94871037c0bb223.tar.gz bcm5719-llvm-daae9eea8a42beefd6abb2efe94871037c0bb223.zip | |
move rep aliases to td file
llvm-svn: 117822
| -rw-r--r-- | llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.td | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index 9e31833fca9..111afbf47a6 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -620,13 +620,10 @@ X86Operand *X86ATTAsmParser::ParseMemOperand(unsigned SegReg, SMLoc MemStart) { bool X86ATTAsmParser:: ParseInstruction(StringRef Name, SMLoc NameLoc, SmallVectorImpl<MCParsedAsmOperand*> &Operands) { - // FIXME: Hack to recognize "sal..." and "rep..." for now. We need a way to - // represent alternative syntaxes in the .td file, without requiring - // instruction duplication. + // FIXME: Hack to recognize some aliases. StringRef PatchedName = StringSwitch<StringRef>(Name) .Case("repe", "rep") .Case("repz", "rep") - .Case("repnz", "repne") .Case("push", Is64Bit ? "pushq" : "pushl") .Case("pop", Is64Bit ? "popq" : "popl") .Case("pushf", Is64Bit ? "pushfq" : "pushfl") @@ -721,7 +718,8 @@ ParseInstruction(StringRef Name, SMLoc NameLoc, // Determine whether this is an instruction prefix. bool isPrefix = PatchedName == "lock" || PatchedName == "rep" || - PatchedName == "repne"; + PatchedName == "repe" || PatchedName == "repz" || + PatchedName == "repne" || PatchedName == "repnz"; // This does the actual operand parsing. Don't parse any more if we have a diff --git a/llvm/lib/Target/X86/X86InstrInfo.td b/llvm/lib/Target/X86/X86InstrInfo.td index 71e90c0ae6d..9df65293890 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.td +++ b/llvm/lib/Target/X86/X86InstrInfo.td @@ -1269,6 +1269,10 @@ def : MnemonicAlias<"cdqe", "cltq">; def : MnemonicAlias<"pushfd", "pushfl">; def : MnemonicAlias<"popfd", "popfl">; +def : MnemonicAlias<"repe", "rep">; +def : MnemonicAlias<"repz", "rep">; +def : MnemonicAlias<"repnz", "repne">; + def : MnemonicAlias<"salb", "shlb">; def : MnemonicAlias<"salw", "shlw">; def : MnemonicAlias<"sall", "shll">; |

