summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPC.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-04 05:27:39 +0000
committerChris Lattner <sabre@nondot.org>2006-11-04 05:27:39 +0000
commit6be726048e854b1aa495333cb72d4f3a3ce40952 (patch)
tree2909cd8a9a138497eaa1e16a36078520b8343177 /llvm/lib/Target/PowerPC/PPC.h
parented07f23c52fa0506cd5ab34604eb6742ddc06de8 (diff)
downloadbcm5719-llvm-6be726048e854b1aa495333cb72d4f3a3ce40952.tar.gz
bcm5719-llvm-6be726048e854b1aa495333cb72d4f3a3ce40952.zip
Go through all kinds of trouble to mark 'blr' as having a predicate operand
that takes a register and condition code. Print these pieces of BLR the right way, even though it is currently set to 'always'. Next up: get the JIT encoding right, then enhance branch folding to produce predicated blr for simple examples. llvm-svn: 31449
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPC.h')
-rw-r--r--llvm/lib/Target/PowerPC/PPC.h31
1 files changed, 23 insertions, 8 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC.h b/llvm/lib/Target/PowerPC/PPC.h
index 8fef9662010..c8ea2829c46 100644
--- a/llvm/lib/Target/PowerPC/PPC.h
+++ b/llvm/lib/Target/PowerPC/PPC.h
@@ -17,13 +17,31 @@
#include <iosfwd>
-namespace llvm {
-class PPCTargetMachine;
-class FunctionPassManager;
-class FunctionPass;
-class MachineCodeEmitter;
+// GCC #defines PPC on Linux but we use it as our namespace name
+#undef PPC
+namespace llvm {
+ class PPCTargetMachine;
+ class FunctionPassManager;
+ class FunctionPass;
+ class MachineCodeEmitter;
+
+ namespace PPC {
+ /// Predicate - These are "(BO << 5) | BI" for various predicates.
+ enum Predicate {
+ PRED_ALWAYS = (20 << 5) | 0,
+ PRED_LT = (12 << 5) | 0,
+ PRED_LE = ( 4 << 5) | 1,
+ PRED_EQ = (12 << 5) | 2,
+ PRED_GE = ( 4 << 5) | 0,
+ PRED_GT = (12 << 5) | 1,
+ PRED_NE = ( 4 << 5) | 2,
+ PRED_UN = (12 << 5) | 3,
+ PRED_NU = ( 4 << 5) | 3
+ };
+ }
+
FunctionPass *createPPCBranchSelectionPass();
FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
FunctionPass *createPPCAsmPrinterPass(std::ostream &OS,
@@ -34,9 +52,6 @@ void addPPCMachOObjectWriterPass(FunctionPassManager &FPM, std::ostream &o,
PPCTargetMachine &tm);
} // end namespace llvm;
-// GCC #defines PPC on Linux but we use it as our namespace name
-#undef PPC
-
// Defines symbolic names for PowerPC registers. This defines a mapping from
// register name to register number.
//
OpenPOWER on IntegriCloud