Fix emission of PPC64 assembler on non-darwin platforms by splitting
[oota-llvm.git] / lib / Target / PowerPC / PPC.h
1 //===-- PPC.h - Top-level interface for PowerPC Target ----------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the entry points for global functions defined in the LLVM
11 // PowerPC back-end.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_TARGET_POWERPC_H
16 #define LLVM_TARGET_POWERPC_H
17
18 #include <string>
19
20 // GCC #defines PPC on Linux but we use it as our namespace name
21 #undef PPC
22
23 namespace llvm {
24   class PPCTargetMachine;
25   class FunctionPass;
26   class formatted_raw_ostream;
27   class JITCodeEmitter;
28   class Target;
29   class MachineInstr;
30   class AsmPrinter;
31   class MCInst;
32   class MCCodeEmitter;
33   class MCContext;
34   class TargetMachine;
35   class TargetAsmBackend;
36   
37   FunctionPass *createPPCBranchSelectionPass();
38   FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
39   FunctionPass *createPPCJITCodeEmitterPass(PPCTargetMachine &TM,
40                                             JITCodeEmitter &MCE);
41   MCCodeEmitter *createPPCMCCodeEmitter(const Target &, TargetMachine &TM,
42                                         MCContext &Ctx);
43   TargetAsmBackend *createPPCAsmBackend(const Target &, const std::string &);
44   
45   void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
46                                     AsmPrinter &AP, bool isDarwin);
47   
48   extern Target ThePPC32Target;
49   extern Target ThePPC64Target;
50   
51   namespace PPCII {
52     
53   /// Target Operand Flag enum.
54   enum TOF {
55     //===------------------------------------------------------------------===//
56     // PPC Specific MachineOperand flags.
57     MO_NO_FLAG,
58     
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.
62     MO_DARWIN_STUB = 1,
63     
64     /// MO_LO16, MO_HA16 - lo16(symbol) and ha16(symbol)
65     MO_LO16 = 4, MO_HA16 = 8,
66
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).
69     MO_PIC_FLAG = 16,
70
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).
73     MO_NLP_FLAG = 32,
74     
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
79   };
80   } // end namespace PPCII
81   
82 } // end namespace llvm;
83
84 // Defines symbolic names for PowerPC registers.  This defines a mapping from
85 // register name to register number.
86 //
87 #include "PPCGenRegisterNames.inc"
88
89 // Defines symbolic names for the PowerPC instructions.
90 //
91 #include "PPCGenInstrNames.inc"
92
93 #endif