1 //===-- PPC.h - Top-level interface for PowerPC Target ----------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file contains the entry points for global functions defined in the LLVM
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_POWERPC_PPC_H
15 #define LLVM_LIB_TARGET_POWERPC_PPC_H
17 #include "llvm/Support/CodeGen.h"
19 // GCC #defines PPC on Linux but we use it as our namespace name
23 class PPCTargetMachine
;
32 FunctionPass
*createPPCCTRLoops();
34 FunctionPass
*createPPCCTRLoopsVerify();
36 FunctionPass
*createPPCLoopPreIncPrepPass(PPCTargetMachine
&TM
);
37 FunctionPass
*createPPCTOCRegDepsPass();
38 FunctionPass
*createPPCEarlyReturnPass();
39 FunctionPass
*createPPCVSXCopyPass();
40 FunctionPass
*createPPCVSXFMAMutatePass();
41 FunctionPass
*createPPCVSXSwapRemovalPass();
42 FunctionPass
*createPPCReduceCRLogicalsPass();
43 FunctionPass
*createPPCMIPeepholePass();
44 FunctionPass
*createPPCBranchSelectionPass();
45 FunctionPass
*createPPCBranchCoalescingPass();
46 FunctionPass
*createPPCQPXLoadSplatPass();
47 FunctionPass
*createPPCISelDag(PPCTargetMachine
&TM
, CodeGenOpt::Level OL
);
48 FunctionPass
*createPPCTLSDynamicCallPass();
49 FunctionPass
*createPPCBoolRetToIntPass();
50 FunctionPass
*createPPCExpandISELPass();
51 FunctionPass
*createPPCPreEmitPeepholePass();
52 void LowerPPCMachineInstrToMCInst(const MachineInstr
*MI
, MCInst
&OutMI
,
53 AsmPrinter
&AP
, bool isDarwin
);
54 bool LowerPPCMachineOperandToMCOperand(const MachineOperand
&MO
,
55 MCOperand
&OutMO
, AsmPrinter
&AP
,
58 void initializePPCCTRLoopsPass(PassRegistry
&);
60 void initializePPCCTRLoopsVerifyPass(PassRegistry
&);
62 void initializePPCLoopPreIncPrepPass(PassRegistry
&);
63 void initializePPCTOCRegDepsPass(PassRegistry
&);
64 void initializePPCEarlyReturnPass(PassRegistry
&);
65 void initializePPCVSXCopyPass(PassRegistry
&);
66 void initializePPCVSXFMAMutatePass(PassRegistry
&);
67 void initializePPCVSXSwapRemovalPass(PassRegistry
&);
68 void initializePPCReduceCRLogicalsPass(PassRegistry
&);
69 void initializePPCBSelPass(PassRegistry
&);
70 void initializePPCBranchCoalescingPass(PassRegistry
&);
71 void initializePPCQPXLoadSplatPass(PassRegistry
&);
72 void initializePPCBoolRetToIntPass(PassRegistry
&);
73 void initializePPCExpandISELPass(PassRegistry
&);
74 void initializePPCPreEmitPeepholePass(PassRegistry
&);
75 void initializePPCTLSDynamicCallPass(PassRegistry
&);
76 void initializePPCMIPeepholePass(PassRegistry
&);
78 extern char &PPCVSXFMAMutateID
;
82 /// Target Operand Flag enum.
84 //===------------------------------------------------------------------===//
85 // PPC Specific MachineOperand flags.
88 /// On a symbol operand "FOO", this indicates that the reference is actually
89 /// to "FOO@plt". This is used for calls and jumps to external functions
90 /// and for PIC calls on 32-bit ELF systems.
93 /// MO_PIC_FLAG - If this bit is set, the symbol reference is relative to
94 /// the function's picbase, e.g. lo16(symbol-picbase).
97 /// MO_NLP_FLAG - If this bit is set, the symbol reference is actually to
98 /// the non_lazy_ptr for the global, e.g. lo16(symbol$non_lazy_ptr-picbase).
101 /// MO_NLP_HIDDEN_FLAG - If this bit is set, the symbol reference is to a
102 /// symbol with hidden visibility. This causes a different kind of
103 /// non-lazy-pointer to be generated.
104 MO_NLP_HIDDEN_FLAG
= 8,
106 /// The next are not flags but distinct values.
107 MO_ACCESS_MASK
= 0xf0,
109 /// MO_LO, MO_HA - lo16(symbol) and ha16(symbol)
113 MO_TPREL_LO
= 4 << 4,
114 MO_TPREL_HA
= 3 << 4,
116 /// These values identify relocations on immediates folded
117 /// into memory operations.
118 MO_DTPREL_LO
= 5 << 4,
119 MO_TLSLD_LO
= 6 << 4,
122 // Symbol for VK_PPC_TLS fixup attached to an ADD instruction
125 } // end namespace PPCII
127 } // end namespace llvm;