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 TargetAsmBackend;
37 FunctionPass *createPPCBranchSelectionPass();
38 FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
39 FunctionPass *createPPCJITCodeEmitterPass(PPCTargetMachine &TM,
41 MCCodeEmitter *createPPCMCCodeEmitter(const Target &, TargetMachine &TM,
43 TargetAsmBackend *createPPCAsmBackend(const Target &, const std::string &);
45 void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
48 extern Target ThePPC32Target;
49 extern Target ThePPC64Target;
53 /// Target Operand Flag enum.
55 //===------------------------------------------------------------------===//
56 // PPC Specific MachineOperand flags.
59 /// MO_DARWIN_STUB - On a symbol operand "FOO", this indicates that the
60 /// reference is actually to the "FOO$stub" symbol. This is used for calls
61 /// and jumps to external functions on Tiger and earlier.
64 /// MO_LO16, MO_HA16 - lo16(symbol) and ha16(symbol)
65 MO_LO16 = 4, MO_HA16 = 8,
67 /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
68 /// the function's picbase, e.g. lo16(symbol-picbase).
71 /// MO_NLP_FLAG - If this bit is set, the symbol reference is actually to
72 /// the non_lazy_ptr for the global, e.g. lo16(symbol$non_lazy_ptr-picbase).
75 /// MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a
76 /// symbol with hidden visibility. This causes a different kind of
77 /// non-lazy-pointer to be generated.
78 MO_NLP_HIDDEN_FLAG = 64
80 } // end namespace PPCII
82 } // end namespace llvm;
84 // Defines symbolic names for PowerPC registers. This defines a mapping from
85 // register name to register number.
87 #include "PPCGenRegisterNames.inc"
89 // Defines symbolic names for the PowerPC instructions.
91 #include "PPCGenInstrNames.inc"