1 //===-- PPC.h - Top-level interface for PowerPC Target ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the entry points for global functions defined in the LLVM
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_TARGET_POWERPC_H
16 #define LLVM_TARGET_POWERPC_H
20 // GCC #defines PPC on Linux but we use it as our namespace name
24 class PPCTargetMachine;
26 class formatted_raw_ostream;
35 class MCSubtargetInfo;
37 class TargetAsmBackend;
39 FunctionPass *createPPCBranchSelectionPass();
40 FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
41 FunctionPass *createPPCJITCodeEmitterPass(PPCTargetMachine &TM,
43 MCCodeEmitter *createPPCMCCodeEmitter(const MCInstrInfo &MCII,
44 const MCSubtargetInfo &STI,
46 TargetAsmBackend *createPPCAsmBackend(const Target &, const std::string &);
48 void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
49 AsmPrinter &AP, bool isDarwin);
51 extern Target ThePPC32Target;
52 extern Target ThePPC64Target;
56 /// Target Operand Flag enum.
58 //===------------------------------------------------------------------===//
59 // PPC Specific MachineOperand flags.
62 /// MO_DARWIN_STUB - On a symbol operand "FOO", this indicates that the
63 /// reference is actually to the "FOO$stub" symbol. This is used for calls
64 /// and jumps to external functions on Tiger and earlier.
67 /// MO_LO16, MO_HA16 - lo16(symbol) and ha16(symbol)
68 MO_LO16 = 4, MO_HA16 = 8,
70 /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
71 /// the function's picbase, e.g. lo16(symbol-picbase).
74 /// MO_NLP_FLAG - If this bit is set, the symbol reference is actually to
75 /// the non_lazy_ptr for the global, e.g. lo16(symbol$non_lazy_ptr-picbase).
78 /// MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a
79 /// symbol with hidden visibility. This causes a different kind of
80 /// non-lazy-pointer to be generated.
81 MO_NLP_HIDDEN_FLAG = 64
83 } // end namespace PPCII
85 } // end namespace llvm;
87 // Defines symbolic names for PowerPC registers. This defines a mapping from
88 // register name to register number.
90 #define GET_REGINFO_ENUM
91 #include "PPCGenRegisterInfo.inc"
93 // Defines symbolic names for the PowerPC instructions.
95 #define GET_INSTRINFO_ENUM
96 #include "PPCGenInstrInfo.inc"