move setcc and jcc aliases from .cpp to .td

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117817 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-10-30 17:51:45 +00:00
parent 537ca844dd
commit b69fc28e92
2 changed files with 28 additions and 14 deletions

View File

@ -640,20 +640,6 @@ ParseInstruction(StringRef Name, SMLoc NameLoc,
.Case("popfd", "popfl")
.Case("retl", Is64Bit ? "retl" : "ret")
.Case("retq", Is64Bit ? "ret" : "retq")
.Case("setz", "sete") .Case("setnz", "setne")
.Case("setc", "setb") .Case("setna", "setbe")
.Case("setnae", "setb").Case("setnb", "setae")
.Case("setnbe", "seta").Case("setnc", "setae")
.Case("setng", "setle").Case("setnge", "setl")
.Case("setnl", "setge").Case("setnle", "setg")
.Case("setpe", "setp") .Case("setpo", "setnp")
.Case("jz", "je") .Case("jnz", "jne")
.Case("jc", "jb") .Case("jna", "jbe")
.Case("jnae", "jb").Case("jnb", "jae")
.Case("jnbe", "ja").Case("jnc", "jae")
.Case("jng", "jle").Case("jnge", "jl")
.Case("jnl", "jge").Case("jnle", "jg")
.Case("jpe", "jp") .Case("jpo", "jnp")
// 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")

View File

@ -1276,4 +1276,32 @@ def : MnemonicAlias<"ud2a", "ud2">;
def : MnemonicAlias<"verrw", "verr">;
class CondCodeAlias<string Prefix, string OldCond, string NewCond>
: MnemonicAlias<!strconcat(Prefix, OldCond), !strconcat(Prefix, NewCond)>;
/// 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
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
}
// Aliases for set<CC>
defm : IntegerCondCodeMnemonicAlias<"set">;
// Aliases for j<CC>
defm : IntegerCondCodeMnemonicAlias<"j">;