LLVM API Documentation

PPC.h
Go to the documentation of this file.
00001 //===-- PPC.h - Top-level interface for PowerPC Target ----------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file contains the entry points for global functions defined in the LLVM
00011 // PowerPC back-end.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 #ifndef LLVM_TARGET_POWERPC_H
00016 #define LLVM_TARGET_POWERPC_H
00017 
00018 #include "MCTargetDesc/PPCMCTargetDesc.h"
00019 #include <string>
00020 
00021 // GCC #defines PPC on Linux but we use it as our namespace name
00022 #undef PPC
00023 
00024 namespace llvm {
00025   class PPCTargetMachine;
00026   class FunctionPass;
00027   class ImmutablePass;
00028   class JITCodeEmitter;
00029   class MachineInstr;
00030   class AsmPrinter;
00031   class MCInst;
00032 
00033   FunctionPass *createPPCCTRLoops(PPCTargetMachine &TM);
00034 #ifndef NDEBUG
00035   FunctionPass *createPPCCTRLoopsVerify();
00036 #endif
00037   FunctionPass *createPPCEarlyReturnPass();
00038   FunctionPass *createPPCBranchSelectionPass();
00039   FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
00040   FunctionPass *createPPCJITCodeEmitterPass(PPCTargetMachine &TM,
00041                                             JITCodeEmitter &MCE);
00042   void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
00043                                     AsmPrinter &AP, bool isDarwin);
00044 
00045   /// \brief Creates an PPC-specific Target Transformation Info pass.
00046   ImmutablePass *createPPCTargetTransformInfoPass(const PPCTargetMachine *TM);
00047 
00048   namespace PPCII {
00049     
00050   /// Target Operand Flag enum.
00051   enum TOF {
00052     //===------------------------------------------------------------------===//
00053     // PPC Specific MachineOperand flags.
00054     MO_NO_FLAG,
00055     
00056     /// MO_DARWIN_STUB - On a symbol operand "FOO", this indicates that the
00057     /// reference is actually to the "FOO$stub" symbol.  This is used for calls
00058     /// and jumps to external functions on Tiger and earlier.
00059     MO_DARWIN_STUB = 1,
00060     
00061     /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
00062     /// the function's picbase, e.g. lo16(symbol-picbase).
00063     MO_PIC_FLAG = 2,
00064 
00065     /// MO_NLP_FLAG - If this bit is set, the symbol reference is actually to
00066     /// the non_lazy_ptr for the global, e.g. lo16(symbol$non_lazy_ptr-picbase).
00067     MO_NLP_FLAG = 4,
00068     
00069     /// MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a
00070     /// symbol with hidden visibility.  This causes a different kind of
00071     /// non-lazy-pointer to be generated.
00072     MO_NLP_HIDDEN_FLAG = 8,
00073 
00074     /// The next are not flags but distinct values.
00075     MO_ACCESS_MASK = 0xf0,
00076 
00077     /// MO_LO16, MO_HA16 - lo16(symbol) and ha16(symbol)
00078     MO_LO16 = 1 << 4,
00079     MO_HA16 = 2 << 4,
00080 
00081     MO_TPREL16_HA = 3 << 4,
00082     MO_TPREL16_LO = 4 << 4,
00083 
00084     /// These values identify relocations on immediates folded
00085     /// into memory operations.
00086     MO_DTPREL16_LO = 5 << 4,
00087     MO_TLSLD16_LO  = 6 << 4,
00088     MO_TOC16_LO    = 7 << 4
00089   };
00090   } // end namespace PPCII
00091   
00092 } // end namespace llvm;
00093 
00094 #endif