0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 //===-- PPCSubtarget.h - Define Subtarget for the PPC ----------*- C++ -*--===//
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 // The LLVM Compiler Infrastructure
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 // This file is distributed under the University of Illinois Open Source
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 // License. See LICENSE.TXT for details.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 //===----------------------------------------------------------------------===//
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 // This file declares the PowerPC specific subclass of TargetSubtargetInfo.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 //===----------------------------------------------------------------------===//
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13
|
77
|
14 #ifndef LLVM_LIB_TARGET_POWERPC_PPCSUBTARGET_H
|
|
15 #define LLVM_LIB_TARGET_POWERPC_PPCSUBTARGET_H
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16
|
77
|
17 #include "PPCFrameLowering.h"
|
83
|
18 #include "PPCISelLowering.h"
|
77
|
19 #include "PPCInstrInfo.h"
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 #include "llvm/ADT/Triple.h"
|
120
|
21 #include "llvm/CodeGen/SelectionDAGTargetInfo.h"
|
77
|
22 #include "llvm/IR/DataLayout.h"
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 #include "llvm/MC/MCInstrItineraries.h"
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 #include "llvm/Target/TargetSubtargetInfo.h"
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 #include <string>
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 #define GET_SUBTARGETINFO_HEADER
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 #include "PPCGenSubtargetInfo.inc"
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 // GCC #defines PPC on Linux but we use it as our namespace name
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 #undef PPC
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 namespace llvm {
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 class StringRef;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 namespace PPC {
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 // -m directive values.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 enum {
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 DIR_NONE,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 DIR_32,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 DIR_440,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 DIR_601,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 DIR_602,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 DIR_603,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 DIR_7400,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 DIR_750,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 DIR_970,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 DIR_A2,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 DIR_E500mc,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 DIR_E5500,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 DIR_PWR3,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 DIR_PWR4,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 DIR_PWR5,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 DIR_PWR5X,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 DIR_PWR6,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 DIR_PWR6X,
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 DIR_PWR7,
|
77
|
58 DIR_PWR8,
|
120
|
59 DIR_PWR9,
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 DIR_64
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 };
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 class GlobalValue;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
65 class TargetMachine;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 class PPCSubtarget : public PPCGenSubtargetInfo {
|
120
|
68 public:
|
|
69 enum POPCNTDKind {
|
|
70 POPCNTD_Unavailable,
|
|
71 POPCNTD_Slow,
|
|
72 POPCNTD_Fast
|
|
73 };
|
|
74
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 protected:
|
77
|
76 /// TargetTriple - What processor and OS we're targeting.
|
|
77 Triple TargetTriple;
|
|
78
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 /// stackAlignment - The minimum alignment known to hold of the stack frame on
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 /// entry to the function and which must be maintained by every function.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 unsigned StackAlignment;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 /// Selected instruction itineraries (one entry per itinerary class.)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 InstrItineraryData InstrItins;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 /// Which cpu directive was used.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 unsigned DarwinDirective;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 /// Used by the ISel to turn in optimizations for POWER4-derived architectures
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 bool HasMFOCRF;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 bool Has64BitSupport;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 bool Use64BitRegs;
|
77
|
93 bool UseCRBits;
|
120
|
94 bool HasHardFloat;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 bool IsPPC64;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 bool HasAltivec;
|
77
|
97 bool HasSPE;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 bool HasQPX;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 bool HasVSX;
|
83
|
100 bool HasP8Vector;
|
|
101 bool HasP8Altivec;
|
95
|
102 bool HasP8Crypto;
|
120
|
103 bool HasP9Vector;
|
|
104 bool HasP9Altivec;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 bool HasFCPSGN;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106 bool HasFSQRT;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 bool HasFRE, HasFRES, HasFRSQRTE, HasFRSQRTES;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 bool HasRecipPrec;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 bool HasSTFIWX;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 bool HasLFIWAX;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 bool HasFPRND;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 bool HasFPCVT;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 bool HasISEL;
|
95
|
114 bool HasBPERMD;
|
|
115 bool HasExtDiv;
|
83
|
116 bool HasCMPB;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 bool HasLDBRX;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 bool IsBookE;
|
83
|
119 bool HasOnlyMSYNC;
|
77
|
120 bool IsE500;
|
|
121 bool IsPPC4xx;
|
|
122 bool IsPPC6xx;
|
95
|
123 bool FeatureMFTB;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 bool DeprecatedDST;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
125 bool HasLazyResolverStubs;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
126 bool IsLittleEndian;
|
83
|
127 bool HasICBT;
|
|
128 bool HasInvariantFunctionDescriptors;
|
95
|
129 bool HasPartwordAtomics;
|
|
130 bool HasDirectMove;
|
|
131 bool HasHTM;
|
100
|
132 bool HasFusion;
|
|
133 bool HasFloat128;
|
120
|
134 bool IsISA3_0;
|
|
135 bool UseLongCalls;
|
|
136
|
|
137 POPCNTDKind HasPOPCNTD;
|
95
|
138
|
|
139 /// When targeting QPX running a stock PPC64 Linux kernel where the stack
|
|
140 /// alignment has not been changed, we need to keep the 16-byte alignment
|
|
141 /// of the stack.
|
|
142 bool IsQPXStackUnaligned;
|
77
|
143
|
83
|
144 const PPCTargetMachine &TM;
|
77
|
145 PPCFrameLowering FrameLowering;
|
|
146 PPCInstrInfo InstrInfo;
|
|
147 PPCTargetLowering TLInfo;
|
120
|
148 SelectionDAGTargetInfo TSInfo;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
149
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
150 public:
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
151 /// This constructor initializes the data members to match that
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
152 /// of the specified triple.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
153 ///
|
95
|
154 PPCSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
|
|
155 const PPCTargetMachine &TM);
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
156
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
157 /// ParseSubtargetFeatures - Parses features string setting specified
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
158 /// subtarget options. Definition of function is auto generated by tblgen.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
159 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
160
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
161 /// getStackAlignment - Returns the minimum alignment known to hold of the
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
162 /// stack frame on entry to the function and which must be maintained by every
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
163 /// function for this subtarget.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
164 unsigned getStackAlignment() const { return StackAlignment; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
165
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
166 /// getDarwinDirective - Returns the -m directive specified for the cpu.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
167 ///
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
168 unsigned getDarwinDirective() const { return DarwinDirective; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
169
|
77
|
170 /// getInstrItins - Return the instruction itineraries based on subtarget
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
171 /// selection.
|
77
|
172 const InstrItineraryData *getInstrItineraryData() const override {
|
|
173 return &InstrItins;
|
|
174 }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
175
|
77
|
176 const PPCFrameLowering *getFrameLowering() const override {
|
|
177 return &FrameLowering;
|
|
178 }
|
|
179 const PPCInstrInfo *getInstrInfo() const override { return &InstrInfo; }
|
|
180 const PPCTargetLowering *getTargetLowering() const override {
|
|
181 return &TLInfo;
|
|
182 }
|
120
|
183 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
|
77
|
184 return &TSInfo;
|
|
185 }
|
|
186 const PPCRegisterInfo *getRegisterInfo() const override {
|
|
187 return &getInstrInfo()->getRegisterInfo();
|
|
188 }
|
83
|
189 const PPCTargetMachine &getTargetMachine() const { return TM; }
|
77
|
190
|
|
191 /// initializeSubtargetDependencies - Initializes using a CPU and feature string
|
|
192 /// so that we can use initializer lists for subtarget initialization.
|
|
193 PPCSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
|
|
194
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
195 private:
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
196 void initializeEnvironment();
|
77
|
197 void initSubtargetFeatures(StringRef CPU, StringRef FS);
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
198
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
199 public:
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
200 /// isPPC64 - Return true if we are generating code for 64-bit pointer mode.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
201 ///
|
83
|
202 bool isPPC64() const;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
203
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
204 /// has64BitSupport - Return true if the selected CPU supports 64-bit
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
205 /// instructions, regardless of whether we are in 32-bit or 64-bit mode.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
206 bool has64BitSupport() const { return Has64BitSupport; }
|
100
|
207 // useSoftFloat - Return true if soft-float option is turned on.
|
120
|
208 bool useSoftFloat() const { return !HasHardFloat; }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
209
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
210 /// use64BitRegs - Return true if in 64-bit mode or if we should use 64-bit
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
211 /// registers in 32-bit mode when possible. This can only true if
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
212 /// has64BitSupport() returns true.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
213 bool use64BitRegs() const { return Use64BitRegs; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
214
|
77
|
215 /// useCRBits - Return true if we should store and manipulate i1 values in
|
|
216 /// the individual condition register bits.
|
|
217 bool useCRBits() const { return UseCRBits; }
|
|
218
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
219 /// hasLazyResolverStub - Return true if accesses to the specified global have
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
220 /// to go through a dyld lazy resolution stub. This means that an extra load
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
221 /// is required to get the address of the global.
|
83
|
222 bool hasLazyResolverStub(const GlobalValue *GV) const;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
223
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
224 // isLittleEndian - True if generating little-endian code
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
225 bool isLittleEndian() const { return IsLittleEndian; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
226
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
227 // Specific obvious features.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
228 bool hasFCPSGN() const { return HasFCPSGN; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
229 bool hasFSQRT() const { return HasFSQRT; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
230 bool hasFRE() const { return HasFRE; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
231 bool hasFRES() const { return HasFRES; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
232 bool hasFRSQRTE() const { return HasFRSQRTE; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
233 bool hasFRSQRTES() const { return HasFRSQRTES; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
234 bool hasRecipPrec() const { return HasRecipPrec; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
235 bool hasSTFIWX() const { return HasSTFIWX; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
236 bool hasLFIWAX() const { return HasLFIWAX; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
237 bool hasFPRND() const { return HasFPRND; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
238 bool hasFPCVT() const { return HasFPCVT; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
239 bool hasAltivec() const { return HasAltivec; }
|
77
|
240 bool hasSPE() const { return HasSPE; }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
241 bool hasQPX() const { return HasQPX; }
|
77
|
242 bool hasVSX() const { return HasVSX; }
|
83
|
243 bool hasP8Vector() const { return HasP8Vector; }
|
|
244 bool hasP8Altivec() const { return HasP8Altivec; }
|
95
|
245 bool hasP8Crypto() const { return HasP8Crypto; }
|
120
|
246 bool hasP9Vector() const { return HasP9Vector; }
|
|
247 bool hasP9Altivec() const { return HasP9Altivec; }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
248 bool hasMFOCRF() const { return HasMFOCRF; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
249 bool hasISEL() const { return HasISEL; }
|
95
|
250 bool hasBPERMD() const { return HasBPERMD; }
|
|
251 bool hasExtDiv() const { return HasExtDiv; }
|
83
|
252 bool hasCMPB() const { return HasCMPB; }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
253 bool hasLDBRX() const { return HasLDBRX; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
254 bool isBookE() const { return IsBookE; }
|
83
|
255 bool hasOnlyMSYNC() const { return HasOnlyMSYNC; }
|
77
|
256 bool isPPC4xx() const { return IsPPC4xx; }
|
|
257 bool isPPC6xx() const { return IsPPC6xx; }
|
|
258 bool isE500() const { return IsE500; }
|
95
|
259 bool isFeatureMFTB() const { return FeatureMFTB; }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
260 bool isDeprecatedDST() const { return DeprecatedDST; }
|
83
|
261 bool hasICBT() const { return HasICBT; }
|
|
262 bool hasInvariantFunctionDescriptors() const {
|
|
263 return HasInvariantFunctionDescriptors;
|
|
264 }
|
95
|
265 bool hasPartwordAtomics() const { return HasPartwordAtomics; }
|
|
266 bool hasDirectMove() const { return HasDirectMove; }
|
|
267
|
|
268 bool isQPXStackUnaligned() const { return IsQPXStackUnaligned; }
|
|
269 unsigned getPlatformStackAlignment() const {
|
|
270 if ((hasQPX() || isBGQ()) && !isQPXStackUnaligned())
|
|
271 return 32;
|
|
272
|
|
273 return 16;
|
|
274 }
|
121
|
275
|
|
276 // DarwinABI has a 224-byte red zone. PPC32 SVR4ABI(Non-DarwinABI) has no
|
|
277 // red zone and PPC64 SVR4ABI has a 288-byte red zone.
|
|
278 unsigned getRedZoneSize() const {
|
|
279 return isDarwinABI() ? 224 : (isPPC64() ? 288 : 0);
|
|
280 }
|
|
281
|
95
|
282 bool hasHTM() const { return HasHTM; }
|
100
|
283 bool hasFusion() const { return HasFusion; }
|
|
284 bool hasFloat128() const { return HasFloat128; }
|
120
|
285 bool isISA3_0() const { return IsISA3_0; }
|
|
286 bool useLongCalls() const { return UseLongCalls; }
|
|
287 bool needsSwapsForVSXMemOps() const {
|
|
288 return hasVSX() && isLittleEndian() && !hasP9Vector();
|
|
289 }
|
|
290
|
|
291 POPCNTDKind hasPOPCNTD() const { return HasPOPCNTD; }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
292
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
293 const Triple &getTargetTriple() const { return TargetTriple; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
294
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
295 /// isDarwin - True if this is any darwin platform.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
296 bool isDarwin() const { return TargetTriple.isMacOSX(); }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
297 /// isBGQ - True if this is a BG/Q platform.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
298 bool isBGQ() const { return TargetTriple.getVendor() == Triple::BGQ; }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
299
|
77
|
300 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
|
|
301 bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
|
120
|
302 bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
|
77
|
303
|
83
|
304 bool isDarwinABI() const { return isTargetMachO() || isDarwin(); }
|
|
305 bool isSVR4ABI() const { return !isDarwinABI(); }
|
|
306 bool isELFv2ABI() const;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
307
|
121
|
308 /// Originally, this function return hasISEL(). Now we always enable it,
|
|
309 /// but may expand the ISEL instruction later.
|
|
310 bool enableEarlyIfConversion() const override { return true; }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
311
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
312 // Scheduling customization.
|
77
|
313 bool enableMachineScheduler() const override;
|
|
314 // This overrides the PostRAScheduler bit in the SchedModel for each CPU.
|
95
|
315 bool enablePostRAScheduler() const override;
|
77
|
316 AntiDepBreakMode getAntiDepBreakMode() const override;
|
|
317 void getCriticalPathRCs(RegClassVector &CriticalPathRCs) const override;
|
|
318
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
319 void overrideSchedPolicy(MachineSchedPolicy &Policy,
|
77
|
320 unsigned NumRegionInstrs) const override;
|
|
321 bool useAA() const override;
|
83
|
322
|
|
323 bool enableSubRegLiveness() const override;
|
100
|
324
|
|
325 /// classifyGlobalReference - Classify a global variable reference for the
|
|
326 /// current subtarget accourding to how we should reference it.
|
|
327 unsigned char classifyGlobalReference(const GlobalValue *GV) const;
|
121
|
328
|
|
329 bool isXRaySupported() const override { return IsPPC64 && IsLittleEndian; }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
330 };
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
331 } // End llvm namespace
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
332
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
333 #endif
|