[llvm-commits] [llvm] r117818 - in /llvm/trunk/lib/Target/X86: AsmParser/X86AsmParser.cpp X86InstrInfo.td

Chris Lattner sabre at nondot.org
Sat Oct 30 10:56:50 PDT 2010


Author: lattner
Date: Sat Oct 30 12:56:50 2010
New Revision: 117818

URL: http://llvm.org/viewvc/llvm-project?rev=117818&view=rev
Log:
move cmov aliases to .td file.

Modified:
    llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
    llvm/trunk/lib/Target/X86/X86InstrInfo.td

Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=117818&r1=117817&r2=117818&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Sat Oct 30 12:56:50 2010
@@ -640,35 +640,6 @@
     .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")

Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=117818&r1=117817&r2=117818&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Sat Oct 30 12:56:50 2010
@@ -1276,32 +1276,37 @@
 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
-
-  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
+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, 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">;
 





More information about the llvm-commits mailing list