move cmov aliases to .td file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117818 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-10-30 17:56:50 +00:00
parent b69fc28e92
commit 8cb441c9e0
2 changed files with 24 additions and 48 deletions

View File

@ -640,35 +640,6 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
.Case("popfd", "popfl")
.Case("retl", Is64Bit ? "retl" : "ret")
.Case("retq", Is64Bit ? "ret" : "retq")
// Condition code aliases for 16-bit, 32-bit, 64-bit and unspec operands.
.Case("cmovcw", "cmovbw") .Case("cmovcl", "cmovbl")
.Case("cmovcq", "cmovbq") .Case("cmovc", "cmovb")
.Case("cmovnaew","cmovbw") .Case("cmovnael","cmovbl")
.Case("cmovnaeq","cmovbq") .Case("cmovnae", "cmovb")
.Case("cmovnaw", "cmovbew").Case("cmovnal", "cmovbel")
.Case("cmovnaq", "cmovbeq").Case("cmovna", "cmovbe")
.Case("cmovnbw", "cmovaew").Case("cmovnbl", "cmovael")
.Case("cmovnbq", "cmovaeq").Case("cmovnb", "cmovae")
.Case("cmovnbew","cmovaw") .Case("cmovnbel","cmoval")
.Case("cmovnbeq","cmovaq") .Case("cmovnbe", "cmova")
.Case("cmovncw", "cmovaew").Case("cmovncl", "cmovael")
.Case("cmovncq", "cmovaeq").Case("cmovnc", "cmovae")
.Case("cmovngw", "cmovlew").Case("cmovngl", "cmovlel")
.Case("cmovngq", "cmovleq").Case("cmovng", "cmovle")
.Case("cmovnw", "cmovgew").Case("cmovnl", "cmovgel")
.Case("cmovnq", "cmovgeq").Case("cmovn", "cmovge")
.Case("cmovngw", "cmovlew").Case("cmovngl", "cmovlel")
.Case("cmovngq", "cmovleq").Case("cmovng", "cmovle")
.Case("cmovngew","cmovlw") .Case("cmovngel","cmovll")
.Case("cmovngeq","cmovlq") .Case("cmovnge", "cmovl")
.Case("cmovnlw", "cmovgew").Case("cmovnll", "cmovgel")
.Case("cmovnlq", "cmovgeq").Case("cmovnl", "cmovge")
.Case("cmovnlew","cmovgw") .Case("cmovnlel","cmovgl")
.Case("cmovnleq","cmovgq") .Case("cmovnle", "cmovg")
.Case("cmovnzw", "cmovnew").Case("cmovnzl", "cmovnel")
.Case("cmovnzq", "cmovneq").Case("cmovnz", "cmovne")
.Case("cmovzw", "cmovew") .Case("cmovzl", "cmovel")
.Case("cmovzq", "cmoveq") .Case("cmovz", "cmove")
// Floating point stack cmov aliases.
.Case("fcmovz", "fcmove")
.Case("fcmova", "fcmovnbe")

View File

@ -1276,32 +1276,37 @@ def : MnemonicAlias<"ud2a", "ud2">;
def : MnemonicAlias<"verrw", "verr">;
class CondCodeAlias<string Prefix, string OldCond, string NewCond>
: MnemonicAlias<!strconcat(Prefix, OldCond), !strconcat(Prefix, NewCond)>;
class CondCodeAlias<string Prefix,string Suffix, string OldCond, string NewCond>
: MnemonicAlias<!strconcat(Prefix, OldCond, Suffix),
!strconcat(Prefix, NewCond, Suffix)>;
/// IntegerCondCodeMnemonicAlias - This multiclass defines a bunch of
/// MnemonicAlias's that canonicalize the condition code in a mnemonic, for
/// example "setz" -> "sete".
multiclass IntegerCondCodeMnemonicAlias<string Prefix> {
def C : CondCodeAlias<Prefix, "c", "b">; // setc -> setb
def Z : CondCodeAlias<Prefix, "z" , "e">; // setz -> sete
def NA : CondCodeAlias<Prefix, "na", "be">; // setna -> setbe
def NB : CondCodeAlias<Prefix, "nb", "ae">; // setnb -> setae
def NC : CondCodeAlias<Prefix, "nc", "ae">; // setnc -> setae
def NG : CondCodeAlias<Prefix, "ng", "le">; // setng -> setle
def NL : CondCodeAlias<Prefix, "nl", "ge">; // setnl -> setge
def NZ : CondCodeAlias<Prefix, "nz", "ne">; // setnz -> setne
def PE : CondCodeAlias<Prefix, "pe", "p">; // setpe -> setp
def PO : CondCodeAlias<Prefix, "po", "np">; // setpo -> setnp
multiclass IntegerCondCodeMnemonicAlias<string Prefix, string Suffix> {
def C : CondCodeAlias<Prefix, Suffix, "c", "b">; // setc -> setb
def Z : CondCodeAlias<Prefix, Suffix, "z" , "e">; // setz -> sete
def NA : CondCodeAlias<Prefix, Suffix, "na", "be">; // setna -> setbe
def NB : CondCodeAlias<Prefix, Suffix, "nb", "ae">; // setnb -> setae
def NC : CondCodeAlias<Prefix, Suffix, "nc", "ae">; // setnc -> setae
def NG : CondCodeAlias<Prefix, Suffix, "ng", "le">; // setng -> setle
def NL : CondCodeAlias<Prefix, Suffix, "nl", "ge">; // setnl -> setge
def NZ : CondCodeAlias<Prefix, Suffix, "nz", "ne">; // setnz -> setne
def PE : CondCodeAlias<Prefix, Suffix, "pe", "p">; // setpe -> setp
def PO : CondCodeAlias<Prefix, Suffix, "po", "np">; // setpo -> setnp
def NAE : CondCodeAlias<Prefix, "nae", "b">; // setnae -> setb
def NBE : CondCodeAlias<Prefix, "nbe", "a">; // setnbe -> seta
def NGE : CondCodeAlias<Prefix, "nge", "l">; // setnge -> setl
def NLE : CondCodeAlias<Prefix, "nle", "g">; // setnle -> setg
def NAE : CondCodeAlias<Prefix, Suffix, "nae", "b">; // setnae -> setb
def NBE : CondCodeAlias<Prefix, Suffix, "nbe", "a">; // setnbe -> seta
def NGE : CondCodeAlias<Prefix, Suffix, "nge", "l">; // setnge -> setl
def NLE : CondCodeAlias<Prefix, Suffix, "nle", "g">; // setnle -> setg
}
// Aliases for set<CC>
defm : IntegerCondCodeMnemonicAlias<"set">;
defm : IntegerCondCodeMnemonicAlias<"set", "">;
// Aliases for j<CC>
defm : IntegerCondCodeMnemonicAlias<"j">;
defm : IntegerCondCodeMnemonicAlias<"j", "">;
// Aliases for cmov<CC>{w,l,q}
defm : IntegerCondCodeMnemonicAlias<"cmov", "w">;
defm : IntegerCondCodeMnemonicAlias<"cmov", "l">;
defm : IntegerCondCodeMnemonicAlias<"cmov", "q">;