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_LIB_TARGET_POWERPC_PPC_H
00016 #define LLVM_LIB_TARGET_POWERPC_PPC_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 PassRegistry;
00027   class FunctionPass;
00028   class ImmutablePass;
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 *createPPCVSXCopyPass();
00039   FunctionPass *createPPCVSXCopyCleanupPass();
00040   FunctionPass *createPPCVSXFMAMutatePass();
00041   FunctionPass *createPPCBranchSelectionPass();
00042   FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
00043   void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
00044                                     AsmPrinter &AP, bool isDarwin);
00045 
00046   /// \brief Creates an PPC-specific Target Transformation Info pass.
00047   ImmutablePass *createPPCTargetTransformInfoPass(const PPCTargetMachine *TM);
00048 
00049   void initializePPCVSXFMAMutatePass(PassRegistry&);
00050   extern char &PPCVSXFMAMutateID;
00051 
00052   namespace PPCII {
00053     
00054   /// Target Operand Flag enum.
00055   enum TOF {
00056     //===------------------------------------------------------------------===//
00057     // PPC Specific MachineOperand flags.
00058     MO_NO_FLAG,
00059     
00060     /// MO_PLT_OR_STUB - On a symbol operand "FOO", this indicates that the
00061     /// reference is actually to the "FOO$stub" or "FOO@plt" symbol.  This is
00062     /// used for calls and jumps to external functions on Tiger and earlier, and
00063     /// for PIC calls on Linux and ELF systems.
00064     MO_PLT_OR_STUB = 1,
00065     
00066     /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
00067     /// the function's picbase, e.g. lo16(symbol-picbase).
00068     MO_PIC_FLAG = 2,
00069 
00070     /// MO_NLP_FLAG - If this bit is set, the symbol reference is actually to
00071     /// the non_lazy_ptr for the global, e.g. lo16(symbol$non_lazy_ptr-picbase).
00072     MO_NLP_FLAG = 4,
00073     
00074     /// MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a
00075     /// symbol with hidden visibility.  This causes a different kind of
00076     /// non-lazy-pointer to be generated.
00077     MO_NLP_HIDDEN_FLAG = 8,
00078 
00079     /// The next are not flags but distinct values.
00080     MO_ACCESS_MASK = 0xf0,
00081 
00082     /// MO_LO, MO_HA - lo16(symbol) and ha16(symbol)
00083     MO_LO = 1 << 4,
00084     MO_HA = 2 << 4,
00085 
00086     MO_TPREL_LO = 4 << 4,
00087     MO_TPREL_HA = 3 << 4,
00088 
00089     /// These values identify relocations on immediates folded
00090     /// into memory operations.
00091     MO_DTPREL_LO = 5 << 4,
00092     MO_TLSLD_LO  = 6 << 4,
00093     MO_TOC_LO    = 7 << 4,
00094 
00095     // Symbol for VK_PPC_TLS fixup attached to an ADD instruction
00096     MO_TLS       = 8 << 4
00097   };
00098   } // end namespace PPCII
00099   
00100 } // end namespace llvm;
00101 
00102 #endif