blob: 5dc1863a0b2d6150c90af429ae240d70422ae323 [file] [log] [blame]
Chris Lattner1911fd42006-09-04 04:14:57 +00001//===-- PPC.h - Top-level interface for PowerPC Target ----------*- C++ -*-===//
Misha Brukmanb5f662f2005-04-21 23:30:14 +00002//
Misha Brukman5dfe3a92004-06-21 16:55:25 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukmanb5f662f2005-04-21 23:30:14 +00007//
Misha Brukman5dfe3a92004-06-21 16:55:25 +00008//===----------------------------------------------------------------------===//
9//
10// This file contains the entry points for global functions defined in the LLVM
11// PowerPC back-end.
12//
13//===----------------------------------------------------------------------===//
14
Chris Lattner1911fd42006-09-04 04:14:57 +000015#ifndef LLVM_TARGET_POWERPC_H
16#define LLVM_TARGET_POWERPC_H
Misha Brukman5dfe3a92004-06-21 16:55:25 +000017
Evan Cheng966aeb52011-07-25 19:53:23 +000018#include "MCTargetDesc/PPCBaseInfo.h"
Evan Chengc60f9b72011-07-14 20:59:42 +000019#include "MCTargetDesc/PPCMCTargetDesc.h"
Chris Lattnerb46443a2010-11-15 08:49:58 +000020#include <string>
21
Chris Lattneraf53a872006-11-04 05:27:39 +000022// GCC #defines PPC on Linux but we use it as our namespace name
23#undef PPC
24
Misha Brukman5dfe3a92004-06-21 16:55:25 +000025namespace llvm {
Chris Lattneraf53a872006-11-04 05:27:39 +000026 class PPCTargetMachine;
Chris Lattneraf53a872006-11-04 05:27:39 +000027 class FunctionPass;
David Greene71847812009-07-14 20:18:05 +000028 class formatted_raw_ostream;
Chris Lattner8d63ba82010-11-14 21:09:28 +000029 class JITCodeEmitter;
30 class Target;
Chris Lattnera7217c82010-11-14 21:12:33 +000031 class MachineInstr;
Chris Lattnera7217c82010-11-14 21:12:33 +000032 class AsmPrinter;
Chris Lattner5ffe38e2010-11-15 04:16:32 +000033 class MCInst;
Chris Lattner5ffe38e2010-11-15 04:16:32 +000034 class TargetMachine;
Chris Lattneraf53a872006-11-04 05:27:39 +000035
Chris Lattner6d2ff122010-11-15 03:13:19 +000036 FunctionPass *createPPCBranchSelectionPass();
37 FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
38 FunctionPass *createPPCJITCodeEmitterPass(PPCTargetMachine &TM,
39 JITCodeEmitter &MCE);
Chris Lattner6d2ff122010-11-15 03:13:19 +000040 void LowerPPCMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
Roman Divackya1000742011-06-09 20:25:38 +000041 AsmPrinter &AP, bool isDarwin);
Chris Lattner6d2ff122010-11-15 03:13:19 +000042
Chris Lattnerb9082582010-11-14 23:42:06 +000043 namespace PPCII {
44
45 /// Target Operand Flag enum.
46 enum TOF {
47 //===------------------------------------------------------------------===//
48 // PPC Specific MachineOperand flags.
49 MO_NO_FLAG,
50
51 /// MO_DARWIN_STUB - On a symbol operand "FOO", this indicates that the
52 /// reference is actually to the "FOO$stub" symbol. This is used for calls
53 /// and jumps to external functions on Tiger and earlier.
Chris Lattner6d2ff122010-11-15 03:13:19 +000054 MO_DARWIN_STUB = 1,
Chris Lattnerb9082582010-11-14 23:42:06 +000055
Chris Lattner6d2ff122010-11-15 03:13:19 +000056 /// MO_LO16, MO_HA16 - lo16(symbol) and ha16(symbol)
57 MO_LO16 = 4, MO_HA16 = 8,
Chris Lattner1e61e692010-11-15 02:46:57 +000058
Chris Lattner6d2ff122010-11-15 03:13:19 +000059 /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
60 /// the function's picbase, e.g. lo16(symbol-picbase).
61 MO_PIC_FLAG = 16,
62
63 /// MO_NLP_FLAG - If this bit is set, the symbol reference is actually to
64 /// the non_lazy_ptr for the global, e.g. lo16(symbol$non_lazy_ptr-picbase).
65 MO_NLP_FLAG = 32,
Chris Lattner1e61e692010-11-15 02:46:57 +000066
Chris Lattner6d2ff122010-11-15 03:13:19 +000067 /// MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a
68 /// symbol with hidden visibility. This causes a different kind of
69 /// non-lazy-pointer to be generated.
70 MO_NLP_HIDDEN_FLAG = 64
Chris Lattnerb9082582010-11-14 23:42:06 +000071 };
72 } // end namespace PPCII
73
Misha Brukman5dfe3a92004-06-21 16:55:25 +000074} // end namespace llvm;
75
Misha Brukman5dfe3a92004-06-21 16:55:25 +000076#endif