aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-07-26 00:24:13 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-07-26 00:24:13 +0000
commit94b9550a32d189704a8eae55505edf62662c0534 (patch)
tree5d1353ef699f1f47f8ffad6bbaa926501d53946c /lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp
parentfcf5a8341f522d95ecbe5af8b1214bf1ea8931dd (diff)
Rename TargetAsmParser to MCTargetAsmParser and TargetAsmLexer to MCTargetAsmLexer; rename createAsmLexer to createMCAsmLexer and createAsmParser to createMCAsmParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136027 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp')
-rw-r--r--lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp b/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp
new file mode 100644
index 0000000000..12bb0a1434
--- /dev/null
+++ b/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp
@@ -0,0 +1,31 @@
+//===-- PPCPredicates.cpp - PPC Branch Predicate Information --------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the PowerPC branch predicates.
+//
+//===----------------------------------------------------------------------===//
+
+#include "PPCPredicates.h"
+#include "llvm/Support/ErrorHandling.h"
+#include <cassert>
+using namespace llvm;
+
+PPC::Predicate PPC::InvertPredicate(PPC::Predicate Opcode) {
+ switch (Opcode) {
+ default: llvm_unreachable("Unknown PPC branch opcode!");
+ case PPC::PRED_EQ: return PPC::PRED_NE;
+ case PPC::PRED_NE: return PPC::PRED_EQ;
+ case PPC::PRED_LT: return PPC::PRED_GE;
+ case PPC::PRED_GE: return PPC::PRED_LT;
+ case PPC::PRED_GT: return PPC::PRED_LE;
+ case PPC::PRED_LE: return PPC::PRED_GT;
+ case PPC::PRED_NU: return PPC::PRED_UN;
+ case PPC::PRED_UN: return PPC::PRED_NU;
+ }
+}