78
86
/// IsBTMemSlow - True if BT (bit test) of memory instructions are slow.
89
/// IsUAMemFast - True if unaligned memory access is fast.
81
92
/// HasVectorUAMem - True if SIMD operations can have unaligned memory
82
/// operands. This may require setting a feature bit in the
93
/// operands. This may require setting a feature bit in the processor.
84
94
bool HasVectorUAMem;
86
/// DarwinVers - Nonzero if this is a darwin platform: the numeric
87
/// version of the platform, e.g. 8 = 10.4 (Tiger), 9 = 10.5 (Leopard), etc.
88
unsigned char DarwinVers; // Is any darwin-x86 platform.
90
96
/// stackAlignment - The minimum alignment known to hold of the stack frame on
91
97
/// entry to the function and which must be maintained by every function.
92
98
unsigned stackAlignment;
133
139
PICStyles::Style getPICStyle() const { return PICStyle; }
134
140
void setPICStyle(PICStyles::Style Style) { PICStyle = Style; }
142
bool hasCMov() const { return HasCMov; }
136
143
bool hasMMX() const { return X86SSELevel >= MMX; }
137
144
bool hasSSE1() const { return X86SSELevel >= SSE1; }
138
145
bool hasSSE2() const { return X86SSELevel >= SSE2; }
144
151
bool has3DNow() const { return X863DNowLevel >= ThreeDNow; }
145
152
bool has3DNowA() const { return X863DNowLevel >= ThreeDNowA; }
146
153
bool hasAVX() const { return HasAVX; }
154
bool hasAES() const { return HasAES; }
155
bool hasCLMUL() const { return HasCLMUL; }
147
156
bool hasFMA3() const { return HasFMA3; }
148
157
bool hasFMA4() const { return HasFMA4; }
149
158
bool isBTMemSlow() const { return IsBTMemSlow; }
159
bool isUnalignedMemAccessFast() const { return IsUAMemFast; }
150
160
bool hasVectorUAMem() const { return HasVectorUAMem; }
152
bool isTargetDarwin() const { return TargetType == isDarwin; }
153
bool isTargetELF() const { return TargetType == isELF; }
162
bool isTargetDarwin() const { return TargetTriple.getOS() == Triple::Darwin; }
164
// ELF is a reasonably sane default and the only other X86 targets we
165
// support are Darwin and Windows. Just use "not those".
166
bool isTargetELF() const {
167
return !isTargetDarwin() && !isTargetWindows() && !isTargetCygMing();
169
bool isTargetLinux() const { return TargetTriple.getOS() == Triple::Linux; }
155
bool isTargetWindows() const { return TargetType == isWindows; }
156
bool isTargetMingw() const { return TargetType == isMingw; }
157
bool isTargetCygwin() const { return TargetType == isCygwin; }
171
bool isTargetWindows() const { return TargetTriple.getOS() == Triple::Win32; }
172
bool isTargetMingw() const {
173
return TargetTriple.getOS() == Triple::MinGW32 ||
174
TargetTriple.getOS() == Triple::MinGW64; }
175
bool isTargetCygwin() const { return TargetTriple.getOS() == Triple::Cygwin; }
158
176
bool isTargetCygMing() const {
159
return TargetType == isMingw || TargetType == isCygwin;
177
return isTargetMingw() || isTargetCygwin();
162
180
/// isTargetCOFF - Return true if this is any COFF/Windows target variant.
163
181
bool isTargetCOFF() const {
164
return TargetType == isMingw || TargetType == isCygwin ||
165
TargetType == isWindows;
182
return isTargetMingw() || isTargetCygwin() || isTargetWindows();
168
185
bool isTargetWin64() const {
169
return Is64Bit && (TargetType == isMingw || TargetType == isWindows);
186
return Is64Bit && (isTargetMingw() || isTargetWindows());
189
bool isTargetWin32() const {
190
return !Is64Bit && (isTargetMingw() || isTargetWindows());
172
193
std::string getDataLayout() const {
201
222
/// getDarwinVers - Return the darwin version number, 8 = Tiger, 9 = Leopard,
202
223
/// 10 = Snow Leopard, etc.
203
unsigned getDarwinVers() const { return DarwinVers; }
224
unsigned getDarwinVers() const {
225
if (isTargetDarwin()) return TargetTriple.getDarwinMajorNumber();
205
229
/// ClassifyGlobalReference - Classify a global variable reference for the
206
230
/// current subtarget according to how we should reference it in a non-pcrel
230
254
/// should be attempted.
231
255
unsigned getSpecialAddressLatency() const;
233
/// enablePostRAScheduler - X86 target is enabling post-alloc scheduling
234
/// at 'More' optimization level.
235
bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
236
TargetSubtarget::AntiDepBreakMode& Mode,
237
RegClassVector& CriticalPathRCs) const;
257
/// IsCalleePop - Test whether a function should pop its own arguments.
258
bool IsCalleePop(bool isVarArg, CallingConv::ID CallConv) const;
240
261
} // End llvm namespace