clang 24.0.0git
PPC.h
Go to the documentation of this file.
1//===--- PPC.h - Declare PPC target feature support -------------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares PPC TargetInfo objects.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_PPC_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_PPC_H
15
16#include "OSTargets.h"
19#include "llvm/ADT/StringSwitch.h"
20#include "llvm/Support/Compiler.h"
21#include "llvm/TargetParser/Triple.h"
22
23namespace clang {
24namespace targets {
25
26// PPC abstract base class
27class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo {
28
29 /// Flags for architecture specific defines.
30 typedef enum {
31 ArchDefineNone = 0,
32 ArchDefineName = 1 << 0, // <name> is substituted for arch name.
33 ArchDefinePpcgr = 1 << 1,
34 ArchDefinePpcsq = 1 << 2,
35 ArchDefine440 = 1 << 3,
36 ArchDefine603 = 1 << 4,
37 ArchDefine604 = 1 << 5,
38 ArchDefinePwr4 = 1 << 6,
39 ArchDefinePwr5 = 1 << 7,
40 ArchDefinePwr5x = 1 << 8,
41 ArchDefinePwr6 = 1 << 9,
42 ArchDefinePwr6x = 1 << 10,
43 ArchDefinePwr7 = 1 << 11,
44 ArchDefinePwr8 = 1 << 12,
45 ArchDefinePwr9 = 1 << 13,
46 ArchDefinePwr10 = 1 << 14,
47 ArchDefinePwr11 = 1 << 15,
48 ArchDefineFuture = 1 << 16,
49 ArchDefineA2 = 1 << 17,
50 ArchDefineE500 = 1 << 18
51 } ArchDefineTypes;
52
53 ArchDefineTypes ArchDefs = ArchDefineNone;
54 static const char *const GCCRegNames[];
55 static const TargetInfo::GCCRegAlias GCCRegAliases[];
56 std::string CPU;
57 enum PPCFloatABI { HardFloat, SoftFloat } FloatABI;
58
59 // Target cpu features.
60 bool HasAltivec = false;
61 bool HasMMA = false;
62 bool HasROPProtect = false;
63 bool HasVSX = false;
64 bool HasP8Vector = false;
65 bool HasP8Crypto = false;
66 bool HasHTM = false;
67 bool HasP9Vector = false;
68 bool HasSPE = false;
69 bool HasFrsqrte = false;
70 bool HasFrsqrtes = false;
71 bool HasP10Vector = false;
72 bool HasFutureVector = false;
73 bool HasPCRelativeMemops = false;
74 bool HasQuadwordAtomics = false;
75 bool UseLongCalls = false;
76
77protected:
78 std::string ABI;
79
80public:
81 PPCTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
82 : TargetInfo(Triple) {
83 SuitableAlign = 128;
85 LongDoubleFormat = &llvm::APFloat::PPCDoubleDouble();
86 HasStrictFP = true;
87 HasIbm128 = true;
88 HasUnalignedAccess = true;
89 }
90
91 // Set the language option for altivec based on our value.
92 void adjust(DiagnosticsEngine &Diags, LangOptions &Opts,
93 const TargetInfo *Aux) override;
94
95 // Note: GCC recognizes the following additional cpus:
96 // 401, 403, 405, 405fp, 440fp, 464, 464fp, 476, 476fp, 505, 740, 801,
97 // 821, 823, 8540, e300c2, e300c3, e500mc64, e6500, 860, cell, titan, rs64.
98 bool isValidCPUName(StringRef Name) const override;
99 void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const override;
100
101 // Validate if given feature name is supported on target_clones
102 bool isValidClonesFeatureName(StringRef Name) const override;
103
104 bool setCPU(StringRef Name) override {
105 bool CPUKnown = isValidCPUName(Name);
106 if (CPUKnown) {
107 CPU = Name;
108
109 // CPU identification.
110 ArchDefs =
111 (ArchDefineTypes)llvm::StringSwitch<int>(CPU)
112 .Case("440", ArchDefineName)
113 .Case("450", ArchDefineName | ArchDefine440)
114 .Case("601", ArchDefineName)
115 .Case("602", ArchDefineName | ArchDefinePpcgr)
116 .Case("603", ArchDefineName | ArchDefinePpcgr)
117 .Case("603e", ArchDefineName | ArchDefine603 | ArchDefinePpcgr)
118 .Case("603ev", ArchDefineName | ArchDefine603 | ArchDefinePpcgr)
119 .Case("604", ArchDefineName | ArchDefinePpcgr)
120 .Case("604e", ArchDefineName | ArchDefine604 | ArchDefinePpcgr)
121 .Case("620", ArchDefineName | ArchDefinePpcgr)
122 .Case("630", ArchDefineName | ArchDefinePpcgr)
123 .Case("7400", ArchDefineName | ArchDefinePpcgr)
124 .Case("7450", ArchDefineName | ArchDefinePpcgr)
125 .Case("750", ArchDefineName | ArchDefinePpcgr)
126 .Case("970", ArchDefineName | ArchDefinePwr4 | ArchDefinePpcgr |
127 ArchDefinePpcsq)
128 .Case("a2", ArchDefineA2)
129 .Cases({"power3", "pwr3"}, ArchDefinePpcgr)
130 .Cases({"power4", "pwr4"},
131 ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq)
132 .Cases({"power5", "pwr5"}, ArchDefinePwr5 | ArchDefinePwr4 |
133 ArchDefinePpcgr | ArchDefinePpcsq)
134 .Cases({"power5x", "pwr5x"},
135 ArchDefinePwr5x | ArchDefinePwr5 | ArchDefinePwr4 |
136 ArchDefinePpcgr | ArchDefinePpcsq)
137 .Cases({"power6", "pwr6"}, ArchDefinePwr6 | ArchDefinePwr5x |
138 ArchDefinePwr5 | ArchDefinePwr4 |
139 ArchDefinePpcgr | ArchDefinePpcsq)
140 .Cases({"power6x", "pwr6x"},
141 ArchDefinePwr6x | ArchDefinePwr6 | ArchDefinePwr5x |
142 ArchDefinePwr5 | ArchDefinePwr4 | ArchDefinePpcgr |
143 ArchDefinePpcsq)
144 .Cases({"power7", "pwr7"}, ArchDefinePwr7 | ArchDefinePwr6 |
145 ArchDefinePwr5x | ArchDefinePwr5 |
146 ArchDefinePwr4 | ArchDefinePpcgr |
147 ArchDefinePpcsq)
148 // powerpc64le automatically defaults to at least power8.
149 .Cases({"power8", "pwr8", "ppc64le"},
150 ArchDefinePwr8 | ArchDefinePwr7 | ArchDefinePwr6 |
151 ArchDefinePwr5x | ArchDefinePwr5 | ArchDefinePwr4 |
152 ArchDefinePpcgr | ArchDefinePpcsq)
153 .Cases({"power9", "pwr9"},
154 ArchDefinePwr9 | ArchDefinePwr8 | ArchDefinePwr7 |
155 ArchDefinePwr6 | ArchDefinePwr5x | ArchDefinePwr5 |
156 ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq)
157 .Cases({"power10", "pwr10"},
158 ArchDefinePwr10 | ArchDefinePwr9 | ArchDefinePwr8 |
159 ArchDefinePwr7 | ArchDefinePwr6 | ArchDefinePwr5x |
160 ArchDefinePwr5 | ArchDefinePwr4 | ArchDefinePpcgr |
161 ArchDefinePpcsq)
162 .Cases({"power11", "pwr11"},
163 ArchDefinePwr11 | ArchDefinePwr10 | ArchDefinePwr9 |
164 ArchDefinePwr8 | ArchDefinePwr7 | ArchDefinePwr6 |
165 ArchDefinePwr5x | ArchDefinePwr5 | ArchDefinePwr4 |
166 ArchDefinePpcgr | ArchDefinePpcsq)
167 .Case("future",
168 ArchDefineFuture | ArchDefinePwr11 | ArchDefinePwr10 |
169 ArchDefinePwr9 | ArchDefinePwr8 | ArchDefinePwr7 |
170 ArchDefinePwr6 | ArchDefinePwr5x | ArchDefinePwr5 |
171 ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq)
172 .Cases({"8548", "e500"}, ArchDefineE500)
173 .Default(ArchDefineNone);
174 }
175 return CPUKnown;
176 }
177
178 StringRef getABI() const override { return ABI; }
179
180 llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const override;
181
182 bool isCLZForZeroUndef() const override { return false; }
183
184 void getTargetDefines(const LangOptions &Opts,
185 MacroBuilder &Builder) const override;
186
187 bool
188 initFeatureMap(llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags,
189 StringRef CPU,
190 const std::vector<std::string> &FeaturesVec) const override;
191
192 void addP10SpecificFeatures(llvm::StringMap<bool> &Features) const;
193 void addP11SpecificFeatures(llvm::StringMap<bool> &Features) const;
194 void addFutureSpecificFeatures(llvm::StringMap<bool> &Features) const;
195
196 bool handleTargetFeatures(std::vector<std::string> &Features,
197 DiagnosticsEngine &Diags) override;
198
199 bool hasFeature(StringRef Feature) const override;
200
201 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
202 bool Enabled) const override;
203
204 bool supportsTargetAttributeTune() const override { return true; }
205
206 ParsedTargetAttr parseTargetAttr(StringRef Str) const override;
207
208 bool isValidFeatureName(StringRef Name) const override;
209
210 llvm::APInt getFMVPriority(ArrayRef<StringRef> Features) const override;
211
212 ArrayRef<const char *> getGCCRegNames() const override;
213
214 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override;
215
216 ArrayRef<TargetInfo::AddlRegName> getGCCAddlRegNames() const override;
217
218 bool validateAsmConstraint(const char *&Name,
219 TargetInfo::ConstraintInfo &Info) const override {
220 switch (*Name) {
221 default:
222 return false;
223 case 'O': // Zero
224 break;
225 case 'f': // Floating point register
226 // Don't use floating point registers on soft float ABI.
227 if (FloatABI == SoftFloat)
228 return false;
229 [[fallthrough]];
230 case 'b': // Base register
231 Info.setAllowsRegister();
232 break;
233 // FIXME: The following are added to allow parsing.
234 // I just took a guess at what the actions should be.
235 // Also, is more specific checking needed? I.e. specific registers?
236 case 'd': // Floating point register (containing 64-bit value)
237 case 'v': // Altivec vector register
238 // Don't use floating point and altivec vector registers
239 // on soft float ABI
240 if (FloatABI == SoftFloat)
241 return false;
242 Info.setAllowsRegister();
243 break;
244 case 'w':
245 switch (Name[1]) {
246 case 'd': // VSX vector register to hold vector double data
247 case 'f': // VSX vector register to hold vector float data
248 case 's': // VSX vector register to hold scalar double data
249 case 'w': // VSX vector register to hold scalar double data
250 case 'a': // Any VSX register
251 case 'c': // An individual CR bit
252 case 'i': // FP or VSX register to hold 64-bit integers data
253 break;
254 default:
255 return false;
256 }
257 Info.setAllowsRegister();
258 Name++; // Skip over 'w'.
259 break;
260 case 'h': // `MQ', `CTR', or `LINK' register
261 case 'q': // `MQ' register
262 case 'c': // `CTR' register
263 case 'l': // `LINK' register
264 case 'x': // `CR' register (condition register) number 0
265 case 'y': // `CR' register (condition register)
266 case 'z': // `XER[CA]' carry bit (part of the XER register)
267 Info.setAllowsRegister();
268 break;
269 case 'I': // Signed 16-bit constant
270 case 'J': // Unsigned 16-bit constant shifted left 16 bits
271 // (use `L' instead for SImode constants)
272 case 'K': // Unsigned 16-bit constant
273 case 'L': // Signed 16-bit constant shifted left 16 bits
274 case 'M': // Constant larger than 31
275 case 'N': // Exact power of 2
276 case 'P': // Constant whose negation is a signed 16-bit constant
277 case 'G': // Floating point constant that can be loaded into a
278 // register with one instruction per word
279 case 'H': // Integer/Floating point constant that can be loaded
280 // into a register using three instructions
281 break;
282 case 'm': // Memory operand. Note that on PowerPC targets, m can
283 // include addresses that update the base register. It
284 // is therefore only safe to use `m' in an asm statement
285 // if that asm statement accesses the operand exactly once.
286 // The asm statement must also use `%U<opno>' as a
287 // placeholder for the "update" flag in the corresponding
288 // load or store instruction. For example:
289 // asm ("st%U0 %1,%0" : "=m" (mem) : "r" (val));
290 // is correct but:
291 // asm ("st %1,%0" : "=m" (mem) : "r" (val));
292 // is not. Use es rather than m if you don't want the base
293 // register to be updated.
294 case 'e':
295 if (Name[1] != 's')
296 return false;
297 // es: A "stable" memory operand; that is, one which does not
298 // include any automodification of the base register. Unlike
299 // `m', this constraint can be used in asm statements that
300 // might access the operand several times, or that might not
301 // access it at all.
302 Info.setAllowsMemory();
303 Name++; // Skip over 'e'.
304 break;
305 case 'Q': // Memory operand that is an offset from a register (it is
306 // usually better to use `m' or `es' in asm statements)
307 Info.setAllowsRegister();
308 [[fallthrough]];
309 case 'Z': // Memory operand that is an indexed or indirect from a
310 // register (it is usually better to use `m' or `es' in
311 // asm statements)
312 Info.setAllowsMemory();
313 break;
314 case 'a': // Address operand that is an indexed or indirect from a
315 // register (`p' is preferable for asm statements)
316 // TODO: Add full support for this constraint
317 return false;
318 case 'R': // AIX TOC entry
319 case 'S': // Constant suitable as a 64-bit mask operand
320 case 'T': // Constant suitable as a 32-bit mask operand
321 case 'U': // System V Release 4 small data area reference
322 case 't': // AND masks that can be performed by two rldic{l, r}
323 // instructions
324 case 'W': // Vector constant that does not require memory
325 case 'j': // Vector constant that is all zeros.
326 break;
327 // End FIXME.
328 }
329 return true;
330 }
331
332 std::string convertConstraint(const char *&Constraint) const override {
333 std::string R;
334 switch (*Constraint) {
335 case 'e':
336 case 'w':
337 // Two-character constraint; add "^" hint for later parsing.
338 R = std::string("^") + std::string(Constraint, 2);
339 Constraint++;
340 break;
341 default:
342 return TargetInfo::convertConstraint(Constraint);
343 }
344 return R;
345 }
346
347 std::string_view getClobbers() const override { return ""; }
348 int getEHDataRegisterNumber(unsigned RegNo) const override {
349 if (RegNo == 0)
350 return 3;
351 if (RegNo == 1)
352 return 4;
353 return -1;
354 }
355
356 bool hasSjLjLowering() const override { return true; }
357
358 const char *getLongDoubleMangling() const override {
359 if (LongDoubleWidth == 64)
360 return "e";
361 return LongDoubleFormat == &llvm::APFloat::PPCDoubleDouble()
362 ? "g"
363 : "u9__ieee128";
364 }
365 const char *getFloat128Mangling() const override { return "u9__ieee128"; }
366 const char *getIbm128Mangling() const override { return "g"; }
367
368 bool hasBitIntType() const override { return true; }
369
370 bool isSPRegName(StringRef RegName) const override {
371 return RegName == "r1" || RegName == "x1";
372 }
373
374 // We support __builtin_cpu_supports/__builtin_cpu_is on targets that
375 // have Glibc since it is Glibc that provides the HWCAP[2] in the auxv.
376 static constexpr int MINIMUM_AIX_OS_MAJOR = 7;
377 static constexpr int MINIMUM_AIX_OS_MINOR = 2;
378 bool supportsCpuSupports() const override {
379 llvm::Triple Triple = getTriple();
380 // AIX 7.2 is the minimum requirement to support __builtin_cpu_supports().
381 return Triple.isOSGlibc() || Triple.isMusl() ||
382 (Triple.isOSAIX() &&
383 !Triple.isOSVersionLT(MINIMUM_AIX_OS_MAJOR, MINIMUM_AIX_OS_MINOR));
384 }
385
386 bool supportsCpuIs() const override {
387 llvm::Triple Triple = getTriple();
388 // AIX 7.2 is the minimum requirement to support __builtin_cpu_is().
389 return Triple.isOSGlibc() || Triple.isMusl() ||
390 (Triple.isOSAIX() &&
391 !Triple.isOSVersionLT(MINIMUM_AIX_OS_MAJOR, MINIMUM_AIX_OS_MINOR));
392 }
393 bool validateCpuSupports(StringRef Feature) const override;
394 bool validateCpuIs(StringRef Name) const override;
395};
396
397class LLVM_LIBRARY_VISIBILITY PPC32TargetInfo : public PPCTargetInfo {
398public:
399 PPC32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
400 : PPCTargetInfo(Triple, Opts) {
402
403 switch (getTriple().getOS()) {
404 case llvm::Triple::Linux:
405 case llvm::Triple::FreeBSD:
406 case llvm::Triple::NetBSD:
410 break;
411 case llvm::Triple::AIX:
415 LongDoubleWidth = 64;
417 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
418 break;
419 default:
420 break;
421 }
422
423 if (Triple.isOSFreeBSD() || Triple.isOSNetBSD() || Triple.isOSOpenBSD() ||
424 Triple.isMusl()) {
426 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
427 }
428
429 // PPC32 supports atomics up to 4 bytes.
431 }
432
434 // This is the ELF definition
436 }
437
438 std::pair<unsigned, unsigned> hardwareInterferenceSizes() const override {
439 return std::make_pair(32, 32);
440 }
441};
442
443// Note: ABI differences may eventually require us to have a separate
444// TargetInfo for little endian.
445class LLVM_LIBRARY_VISIBILITY PPC64TargetInfo : public PPCTargetInfo {
446public:
447 PPC64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
448 : PPCTargetInfo(Triple, Opts) {
452
453 if (Triple.isOSAIX()) {
454 // TODO: Set appropriate ABI for AIX platform.
455 LongDoubleWidth = 64;
456 LongDoubleAlign = DoubleAlign = 32;
457 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
458 } else if ((Triple.getArch() == llvm::Triple::ppc64le) ||
459 Triple.isPPC64ELFv2ABI()) {
460 ABI = "elfv2";
461 } else {
462 ABI = "elfv1";
463 }
464
465 if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
466 LongDoubleWidth = LongDoubleAlign = 64;
467 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
468 }
469
470 // Newer PPC64 instruction sets support atomics up to 16 bytes.
472 // Baseline PPC64 supports inlining atomics up to 8 bytes.
474
476 }
477
478 void setMaxAtomicWidth() override {
479 // For power8 and up, backend is able to inline 16-byte atomic lock free
480 // code.
481 // TODO: We should allow AIX to inline quadword atomics in the future.
482 if (!getTriple().isOSAIX() && hasFeature("quadword-atomics"))
484 }
485
489
490 // PPC64 Linux-specific ABI options.
491 bool setABI(const std::string &Name) override {
492 if (Name == "elfv1" || Name == "elfv2") {
493 ABI = Name;
495 return true;
496 }
497 return false;
498 }
499
501 switch (CC) {
502 case CC_Swift:
503 return CCCR_OK;
504 case CC_SwiftAsync:
505 return CCCR_Error;
506 default:
507 return CCCR_Warning;
508 }
509 }
510
511 std::pair<unsigned, unsigned> hardwareInterferenceSizes() const override {
512 return std::make_pair(128, 128);
513 }
514};
515
516class LLVM_LIBRARY_VISIBILITY AIXPPC32TargetInfo :
517 public AIXTargetInfo<PPC32TargetInfo> {
518public:
523};
524
525class LLVM_LIBRARY_VISIBILITY AIXPPC64TargetInfo :
526 public AIXTargetInfo<PPC64TargetInfo> {
527public:
529};
530
531} // namespace targets
532} // namespace clang
533#endif // LLVM_CLANG_LIB_BASIC_TARGETS_PPC_H
static llvm::APInt getFMVPriority(const TargetInfo &TI, const CodeGenFunction::FMVResolverOption &RO)
static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target)
Determine whether a translation unit built using the current language options has the given feature.
Definition Module.cpp:95
static StringRef getTriple(const Command &Job)
Defines the clang::TargetOptions class.
Concrete class used by the front-end to report problems and issues.
Definition Diagnostic.h:232
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Exposes information about the current target.
Definition TargetInfo.h:226
TargetInfo(const llvm::Triple &T)
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition TargetInfo.h:339
@ PowerABIBuiltinVaList
__builtin_va_list as defined by the Power ABI: https://www.power.org /resources/downloads/Power-Arch-...
Definition TargetInfo.h:353
@ CharPtrBuiltinVaList
typedef char* __builtin_va_list;
Definition TargetInfo.h:341
unsigned HasUnalignedAccess
Definition TargetInfo.h:287
unsigned char MaxAtomicPromoteWidth
Definition TargetInfo.h:252
void resetDataLayout(StringRef DL)
Set the data layout to the given string.
virtual std::string convertConstraint(const char *&Constraint) const
unsigned char MaxAtomicInlineWidth
Definition TargetInfo.h:252
Options for controlling the target.
AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition OSTargets.h:807
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition PPC.h:520
AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition OSTargets.h:807
AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition OSTargets.h:807
std::pair< unsigned, unsigned > hardwareInterferenceSizes() const override
The first value in the pair is the minimum offset between two objects to avoid false sharing (destruc...
Definition PPC.h:438
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition PPC.h:433
PPC32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition PPC.h:399
std::pair< unsigned, unsigned > hardwareInterferenceSizes() const override
The first value in the pair is the minimum offset between two objects to avoid false sharing (destruc...
Definition PPC.h:511
bool setABI(const std::string &Name) override
Use the specified ABI.
Definition PPC.h:491
void setMaxAtomicWidth() override
Set the maximum inline or promote width lock-free atomic operation for the given target.
Definition PPC.h:478
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
Definition PPC.h:500
PPC64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition PPC.h:447
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition PPC.h:486
bool isSPRegName(StringRef RegName) const override
Definition PPC.h:370
PPCTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
Definition PPC.h:81
bool setCPU(StringRef Name) override
Target the specified CPU.
Definition PPC.h:104
bool supportsTargetAttributeTune() const override
Determine whether this TargetInfo supports tune in target attribute.
Definition PPC.h:204
bool supportsCpuIs() const override
Definition PPC.h:386
void addP10SpecificFeatures(llvm::StringMap< bool > &Features) const
static constexpr int MINIMUM_AIX_OS_MAJOR
Definition PPC.h:376
bool isValidCPUName(StringRef Name) const override
Determine whether this TargetInfo supports the given CPU name.
Definition PPC.cpp:862
const char * getLongDoubleMangling() const override
Return the mangled code of long double.
Definition PPC.h:358
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
handleTargetFeatures - Perform initialization based on the user configured set of features.
Definition PPC.cpp:42
bool supportsCpuSupports() const override
Definition PPC.h:378
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override
Definition PPC.h:218
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
Definition PPC.h:348
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
Definition PPC.h:368
void addFutureSpecificFeatures(llvm::StringMap< bool > &Features) const
std::string convertConstraint(const char *&Constraint) const override
Definition PPC.h:332
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
Definition PPC.h:347
void setFeatureEnabled(llvm::StringMap< bool > &Features, StringRef Name, bool Enabled) const override
Enable or disable a specific target feature; the feature name must be valid.
Definition PPC.cpp:628
static constexpr int MINIMUM_AIX_OS_MINOR
Definition PPC.h:377
const char * getIbm128Mangling() const override
Return the mangled code of __ibm128.
Definition PPC.h:366
bool hasSjLjLowering() const override
Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm....
Definition PPC.h:356
bool isCLZForZeroUndef() const override
The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for ...
Definition PPC.h:182
StringRef getABI() const override
Get the ABI currently in use.
Definition PPC.h:178
void addP11SpecificFeatures(llvm::StringMap< bool > &Features) const
const char * getFloat128Mangling() const override
Return the mangled code of __float128.
Definition PPC.h:365
Defines the clang::TargetInfo interface.
Top level wrappers for InstallAPI frontend operations.
if(T->getSizeExpr()) TRY_TO(TraverseStmt(const_cast< Expr * >(T -> getSizeExpr())))
@ Default
Set to the current date and time.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition Specifiers.h:279
@ CC_Swift
Definition Specifiers.h:293
@ CC_SwiftAsync
Definition Specifiers.h:294
Contains information gathered from parsing the contents of TargetAttr.
Definition TargetInfo.h:59
const llvm::fltSemantics * LongDoubleFormat
Definition TargetInfo.h:143