[llvm-branch-commits] [llvm-branch] r119193 - in /llvm/branches/Apple/whitney/lib/Target/X86: AsmParser/X86AsmParser.cpp X86InstrInfo.td
Daniel Dunbar
daniel at zuster.org
Mon Nov 15 13:42:56 PST 2010
Author: ddunbar
Date: Mon Nov 15 15:42:56 2010
New Revision: 119193
URL: http://llvm.org/viewvc/llvm-project?rev=119193&view=rev
Log:
Merge r117817:
--
Author: Chris Lattner <clattner at apple.com>
Date: Sat Oct 30 17:51:45 2010 +0000
move setcc and jcc aliases from .cpp to .td
Modified:
llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/branches/Apple/whitney/lib/Target/X86/X86InstrInfo.td
Modified: llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=119193&r1=119192&r2=119193&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/branches/Apple/whitney/lib/Target/X86/AsmParser/X86AsmParser.cpp Mon Nov 15 15:42:56 2010
@@ -640,20 +640,6 @@
.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")
Modified: llvm/branches/Apple/whitney/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Target/X86/X86InstrInfo.td?rev=119193&r1=119192&r2=119193&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/branches/Apple/whitney/lib/Target/X86/X86InstrInfo.td Mon Nov 15 15:42:56 2010
@@ -1276,4 +1276,32 @@
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">;
More information about the llvm-branch-commits
mailing list