add support for branch on ordered/unordered.
authorChris Lattner <sabre@nondot.org>
Fri, 28 Oct 2005 20:32:44 +0000 (20:32 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 28 Oct 2005 20:32:44 +0000 (20:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24067 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/PowerPC/PPCInstrInfo.td

index d078bdcd5f0128e344a05f1ebfefcc5b73466a24..3d9cd8dc3fbbb79470137ed512ef935d84825a5c 100644 (file)
@@ -489,6 +489,15 @@ static unsigned getBCCForSetCC(ISD::CondCode CC) {
   case ISD::SETGT:  return PPC::BGT;
   case ISD::SETUGE:
   case ISD::SETGE:  return PPC::BGE;
+    
+  case ISD::SETO:   return PPC::BUN;
+  case ISD::SETUO:  return PPC::BNU;
+  case ISD::SETOEQ:
+  case ISD::SETOGT:
+  case ISD::SETOGE:
+  case ISD::SETOLT:
+  case ISD::SETOLE:
+  case ISD::SETONE: assert(0 && "Unknown condition!"); abort();
   }
   return 0;
 }
@@ -509,6 +518,14 @@ static unsigned getCRIdxForSetCC(ISD::CondCode CC, bool& Inv) {
   case ISD::SETLE:  Inv = true;   return 1;
   case ISD::SETEQ:  Inv = false;  return 2;
   case ISD::SETNE:  Inv = true;   return 2;
+  case ISD::SETO:   Inv = true;   return 3;
+  case ISD::SETUO:  Inv = false;  return 3;
+  case ISD::SETOEQ:
+  case ISD::SETOGT:
+  case ISD::SETOGE:
+  case ISD::SETOLT:
+  case ISD::SETOLE:
+  case ISD::SETONE: assert(0 && "Unknown condition!"); abort();
   }
   return 0;
 }
index e858440f35dae1458ef6691eb9ce7950a8293adb..73362a9846f529c983a62f88ab0a0a024de089f6 100644 (file)
@@ -204,6 +204,10 @@ let isBranch = 1, isTerminator = 1 in {
                   "bgt $crS, $block", BrB>;
   def BNE : BForm<16, 0, 0, 4,  2, (ops CRRC:$crS, target:$block),
                   "bne $crS, $block", BrB>;
+  def BUN : BForm<16, 0, 0, 12, 3, (ops CRRC:$crS, target:$block),
+                  "bun $crS, $block", BrB>;
+  def BNU : BForm<16, 0, 0, 4,  3, (ops CRRC:$crS, target:$block),
+                  "bnu $crS, $block", BrB>;
 }
 
 let isCall = 1,