clang 23.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 bool setCPU(StringRef Name) override {
102 bool CPUKnown = isValidCPUName(Name);
103 if (CPUKnown) {
104 CPU = Name;
105
106 // CPU identification.
107 ArchDefs =
108 (ArchDefineTypes)llvm::StringSwitch<int>(CPU)
109 .Case("440", ArchDefineName)
110 .Case("450", ArchDefineName | ArchDefine440)
111 .Case("601", ArchDefineName)
112 .Case("602", ArchDefineName | ArchDefinePpcgr)
113 .Case("603", ArchDefineName | ArchDefinePpcgr)
114 .Case("603e", ArchDefineName | ArchDefine603 | ArchDefinePpcgr)
115 .Case("603ev", ArchDefineName | ArchDefine603 | ArchDefinePpcgr)
116 .Case("604", ArchDefineName | ArchDefinePpcgr)
117 .Case("604e", ArchDefineName | ArchDefine604 | ArchDefinePpcgr)
118 .Case("620", ArchDefineName | ArchDefinePpcgr)
119 .Case("630", ArchDefineName | ArchDefinePpcgr)
120 .Case("7400", ArchDefineName | ArchDefinePpcgr)
121 .Case("7450", ArchDefineName | ArchDefinePpcgr)
122 .Case("750", ArchDefineName | ArchDefinePpcgr)
123 .Case("970", ArchDefineName | ArchDefinePwr4 | ArchDefinePpcgr |
124 ArchDefinePpcsq)
125 .Case("a2", ArchDefineA2)
126 .Cases({"power3", "pwr3"}, ArchDefinePpcgr)
127 .Cases({"power4", "pwr4"},
128 ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq)
129 .Cases({"power5", "pwr5"}, ArchDefinePwr5 | ArchDefinePwr4 |
130 ArchDefinePpcgr | ArchDefinePpcsq)
131 .Cases({"power5x", "pwr5x"},
132 ArchDefinePwr5x | ArchDefinePwr5 | ArchDefinePwr4 |
133 ArchDefinePpcgr | ArchDefinePpcsq)
134 .Cases({"power6", "pwr6"}, ArchDefinePwr6 | ArchDefinePwr5x |
135 ArchDefinePwr5 | ArchDefinePwr4 |
136 ArchDefinePpcgr | ArchDefinePpcsq)
137 .Cases({"power6x", "pwr6x"},
138 ArchDefinePwr6x | ArchDefinePwr6 | ArchDefinePwr5x |
139 ArchDefinePwr5 | ArchDefinePwr4 | ArchDefinePpcgr |
140 ArchDefinePpcsq)
141 .Cases({"power7", "pwr7"}, ArchDefinePwr7 | ArchDefinePwr6 |
142 ArchDefinePwr5x | ArchDefinePwr5 |
143 ArchDefinePwr4 | ArchDefinePpcgr |
144 ArchDefinePpcsq)
145 // powerpc64le automatically defaults to at least power8.
146 .Cases({"power8", "pwr8", "ppc64le"},
147 ArchDefinePwr8 | ArchDefinePwr7 | ArchDefinePwr6 |
148 ArchDefinePwr5x | ArchDefinePwr5 | ArchDefinePwr4 |
149 ArchDefinePpcgr | ArchDefinePpcsq)
150 .Cases({"power9", "pwr9"},
151 ArchDefinePwr9 | ArchDefinePwr8 | ArchDefinePwr7 |
152 ArchDefinePwr6 | ArchDefinePwr5x | ArchDefinePwr5 |
153 ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq)
154 .Cases({"power10", "pwr10"},
155 ArchDefinePwr10 | ArchDefinePwr9 | ArchDefinePwr8 |
156 ArchDefinePwr7 | ArchDefinePwr6 | ArchDefinePwr5x |
157 ArchDefinePwr5 | ArchDefinePwr4 | ArchDefinePpcgr |
158 ArchDefinePpcsq)
159 .Cases({"power11", "pwr11"},
160 ArchDefinePwr11 | ArchDefinePwr10 | ArchDefinePwr9 |
161 ArchDefinePwr8 | ArchDefinePwr7 | ArchDefinePwr6 |
162 ArchDefinePwr5x | ArchDefinePwr5 | ArchDefinePwr4 |
163 ArchDefinePpcgr | ArchDefinePpcsq)
164 .Case("future",
165 ArchDefineFuture | ArchDefinePwr11 | ArchDefinePwr10 |
166 ArchDefinePwr9 | ArchDefinePwr8 | ArchDefinePwr7 |
167 ArchDefinePwr6 | ArchDefinePwr5x | ArchDefinePwr5 |
168 ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq)
169 .Cases({"8548", "e500"}, ArchDefineE500)
170 .Default(ArchDefineNone);
171 }
172 return CPUKnown;
173 }
174
175 StringRef getABI() const override { return ABI; }
176
177 llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const override;
178
179 bool isCLZForZeroUndef() const override { return false; }
180
181 void getTargetDefines(const LangOptions &Opts,
182 MacroBuilder &Builder) const override;
183
184 bool
185 initFeatureMap(llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags,
186 StringRef CPU,
187 const std::vector<std::string> &FeaturesVec) const override;
188
189 void addP10SpecificFeatures(llvm::StringMap<bool> &Features) const;
190 void addP11SpecificFeatures(llvm::StringMap<bool> &Features) const;
191 void addFutureSpecificFeatures(llvm::StringMap<bool> &Features) const;
192
193 bool handleTargetFeatures(std::vector<std::string> &Features,
194 DiagnosticsEngine &Diags) override;
195
196 bool hasFeature(StringRef Feature) const override;
197
198 void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
199 bool Enabled) const override;
200
201 bool supportsTargetAttributeTune() const override { return true; }
202
203 ParsedTargetAttr parseTargetAttr(StringRef Str) const override;
204
205 bool isValidFeatureName(StringRef Name) const override;
206
207 llvm::APInt getFMVPriority(ArrayRef<StringRef> Features) const override;
208
209 ArrayRef<const char *> getGCCRegNames() const override;
210
211 ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override;
212
213 ArrayRef<TargetInfo::AddlRegName> getGCCAddlRegNames() const override;
214
215 bool validateAsmConstraint(const char *&Name,
216 TargetInfo::ConstraintInfo &Info) const override {
217 switch (*Name) {
218 default:
219 return false;
220 case 'O': // Zero
221 break;
222 case 'f': // Floating point register
223 // Don't use floating point registers on soft float ABI.
224 if (FloatABI == SoftFloat)
225 return false;
226 [[fallthrough]];
227 case 'b': // Base register
228 Info.setAllowsRegister();
229 break;
230 // FIXME: The following are added to allow parsing.
231 // I just took a guess at what the actions should be.
232 // Also, is more specific checking needed? I.e. specific registers?
233 case 'd': // Floating point register (containing 64-bit value)
234 case 'v': // Altivec vector register
235 // Don't use floating point and altivec vector registers
236 // on soft float ABI
237 if (FloatABI == SoftFloat)
238 return false;
239 Info.setAllowsRegister();
240 break;
241 case 'w':
242 switch (Name[1]) {
243 case 'd': // VSX vector register to hold vector double data
244 case 'f': // VSX vector register to hold vector float data
245 case 's': // VSX vector register to hold scalar double data
246 case 'w': // VSX vector register to hold scalar double data
247 case 'a': // Any VSX register
248 case 'c': // An individual CR bit
249 case 'i': // FP or VSX register to hold 64-bit integers data
250 break;
251 default:
252 return false;
253 }
254 Info.setAllowsRegister();
255 Name++; // Skip over 'w'.
256 break;
257 case 'h': // `MQ', `CTR', or `LINK' register
258 case 'q': // `MQ' register
259 case 'c': // `CTR' register
260 case 'l': // `LINK' register
261 case 'x': // `CR' register (condition register) number 0
262 case 'y': // `CR' register (condition register)
263 case 'z': // `XER[CA]' carry bit (part of the XER register)
264 Info.setAllowsRegister();
265 break;
266 case 'I': // Signed 16-bit constant
267 case 'J': // Unsigned 16-bit constant shifted left 16 bits
268 // (use `L' instead for SImode constants)
269 case 'K': // Unsigned 16-bit constant
270 case 'L': // Signed 16-bit constant shifted left 16 bits
271 case 'M': // Constant larger than 31
272 case 'N': // Exact power of 2
273 case 'P': // Constant whose negation is a signed 16-bit constant
274 case 'G': // Floating point constant that can be loaded into a
275 // register with one instruction per word
276 case 'H': // Integer/Floating point constant that can be loaded
277 // into a register using three instructions
278 break;
279 case 'm': // Memory operand. Note that on PowerPC targets, m can
280 // include addresses that update the base register. It
281 // is therefore only safe to use `m' in an asm statement
282 // if that asm statement accesses the operand exactly once.
283 // The asm statement must also use `%U<opno>' as a
284 // placeholder for the "update" flag in the corresponding
285 // load or store instruction. For example:
286 // asm ("st%U0 %1,%0" : "=m" (mem) : "r" (val));
287 // is correct but:
288 // asm ("st %1,%0" : "=m" (mem) : "r" (val));
289 // is not. Use es rather than m if you don't want the base
290 // register to be updated.
291 case 'e':
292 if (Name[1] != 's')
293 return false;
294 // es: A "stable" memory operand; that is, one which does not
295 // include any automodification of the base register. Unlike
296 // `m', this constraint can be used in asm statements that
297 // might access the operand several times, or that might not
298 // access it at all.
299 Info.setAllowsMemory();
300 Name++; // Skip over 'e'.
301 break;
302 case 'Q': // Memory operand that is an offset from a register (it is
303 // usually better to use `m' or `es' in asm statements)
304 Info.setAllowsRegister();
305 [[fallthrough]];
306 case 'Z': // Memory operand that is an indexed or indirect from a
307 // register (it is usually better to use `m' or `es' in
308 // asm statements)
309 Info.setAllowsMemory();
310 break;
311 case 'a': // Address operand that is an indexed or indirect from a
312 // register (`p' is preferable for asm statements)
313 // TODO: Add full support for this constraint
314 return false;
315 case 'R': // AIX TOC entry
316 case 'S': // Constant suitable as a 64-bit mask operand
317 case 'T': // Constant suitable as a 32-bit mask operand
318 case 'U': // System V Release 4 small data area reference
319 case 't': // AND masks that can be performed by two rldic{l, r}
320 // instructions
321 case 'W': // Vector constant that does not require memory
322 case 'j': // Vector constant that is all zeros.
323 break;
324 // End FIXME.
325 }
326 return true;
327 }
328
329 std::string convertConstraint(const char *&Constraint) const override {
330 std::string R;
331 switch (*Constraint) {
332 case 'e':
333 case 'w':
334 // Two-character constraint; add "^" hint for later parsing.
335 R = std::string("^") + std::string(Constraint, 2);
336 Constraint++;
337 break;
338 default:
339 return TargetInfo::convertConstraint(Constraint);
340 }
341 return R;
342 }
343
344 std::string_view getClobbers() const override { return ""; }
345 int getEHDataRegisterNumber(unsigned RegNo) const override {
346 if (RegNo == 0)
347 return 3;
348 if (RegNo == 1)
349 return 4;
350 return -1;
351 }
352
353 bool hasSjLjLowering() const override { return true; }
354
355 const char *getLongDoubleMangling() const override {
356 if (LongDoubleWidth == 64)
357 return "e";
358 return LongDoubleFormat == &llvm::APFloat::PPCDoubleDouble()
359 ? "g"
360 : "u9__ieee128";
361 }
362 const char *getFloat128Mangling() const override { return "u9__ieee128"; }
363 const char *getIbm128Mangling() const override { return "g"; }
364
365 bool hasBitIntType() const override { return true; }
366
367 bool isSPRegName(StringRef RegName) const override {
368 return RegName == "r1" || RegName == "x1";
369 }
370
371 // We support __builtin_cpu_supports/__builtin_cpu_is on targets that
372 // have Glibc since it is Glibc that provides the HWCAP[2] in the auxv.
373 static constexpr int MINIMUM_AIX_OS_MAJOR = 7;
374 static constexpr int MINIMUM_AIX_OS_MINOR = 2;
375 bool supportsCpuSupports() const override {
376 llvm::Triple Triple = getTriple();
377 // AIX 7.2 is the minimum requirement to support __builtin_cpu_supports().
378 return Triple.isOSGlibc() || Triple.isMusl() ||
379 (Triple.isOSAIX() &&
380 !Triple.isOSVersionLT(MINIMUM_AIX_OS_MAJOR, MINIMUM_AIX_OS_MINOR));
381 }
382
383 bool supportsCpuIs() const override {
384 llvm::Triple Triple = getTriple();
385 // AIX 7.2 is the minimum requirement to support __builtin_cpu_is().
386 return Triple.isOSGlibc() || Triple.isMusl() ||
387 (Triple.isOSAIX() &&
388 !Triple.isOSVersionLT(MINIMUM_AIX_OS_MAJOR, MINIMUM_AIX_OS_MINOR));
389 }
390 bool validateCpuSupports(StringRef Feature) const override;
391 bool validateCpuIs(StringRef Name) const override;
392};
393
394class LLVM_LIBRARY_VISIBILITY PPC32TargetInfo : public PPCTargetInfo {
395public:
396 PPC32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
397 : PPCTargetInfo(Triple, Opts) {
399
400 switch (getTriple().getOS()) {
401 case llvm::Triple::Linux:
402 case llvm::Triple::FreeBSD:
403 case llvm::Triple::NetBSD:
407 break;
408 case llvm::Triple::AIX:
412 LongDoubleWidth = 64;
414 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
415 break;
416 default:
417 break;
418 }
419
420 if (Triple.isOSFreeBSD() || Triple.isOSNetBSD() || Triple.isOSOpenBSD() ||
421 Triple.isMusl()) {
423 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
424 }
425
426 // PPC32 supports atomics up to 4 bytes.
428 }
429
431 // This is the ELF definition
433 }
434
435 std::pair<unsigned, unsigned> hardwareInterferenceSizes() const override {
436 return std::make_pair(32, 32);
437 }
438};
439
440// Note: ABI differences may eventually require us to have a separate
441// TargetInfo for little endian.
442class LLVM_LIBRARY_VISIBILITY PPC64TargetInfo : public PPCTargetInfo {
443public:
444 PPC64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
445 : PPCTargetInfo(Triple, Opts) {
449
450 if (Triple.isOSAIX()) {
451 // TODO: Set appropriate ABI for AIX platform.
452 LongDoubleWidth = 64;
453 LongDoubleAlign = DoubleAlign = 32;
454 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
455 } else if ((Triple.getArch() == llvm::Triple::ppc64le) ||
456 Triple.isPPC64ELFv2ABI()) {
457 ABI = "elfv2";
458 } else {
459 ABI = "elfv1";
460 }
461
462 if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
463 LongDoubleWidth = LongDoubleAlign = 64;
464 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
465 }
466
467 // Newer PPC64 instruction sets support atomics up to 16 bytes.
469 // Baseline PPC64 supports inlining atomics up to 8 bytes.
471
473 }
474
475 void setMaxAtomicWidth() override {
476 // For power8 and up, backend is able to inline 16-byte atomic lock free
477 // code.
478 // TODO: We should allow AIX to inline quadword atomics in the future.
479 if (!getTriple().isOSAIX() && hasFeature("quadword-atomics"))
481 }
482
486
487 // PPC64 Linux-specific ABI options.
488 bool setABI(const std::string &Name) override {
489 if (Name == "elfv1" || Name == "elfv2") {
490 ABI = Name;
492 return true;
493 }
494 return false;
495 }
496
498 switch (CC) {
499 case CC_Swift:
500 return CCCR_OK;
501 case CC_SwiftAsync:
502 return CCCR_Error;
503 default:
504 return CCCR_Warning;
505 }
506 }
507
508 std::pair<unsigned, unsigned> hardwareInterferenceSizes() const override {
509 return std::make_pair(128, 128);
510 }
511};
512
513class LLVM_LIBRARY_VISIBILITY AIXPPC32TargetInfo :
514 public AIXTargetInfo<PPC32TargetInfo> {
515public:
520};
521
522class LLVM_LIBRARY_VISIBILITY AIXPPC64TargetInfo :
523 public AIXTargetInfo<PPC64TargetInfo> {
524public:
526};
527
528} // namespace targets
529} // namespace clang
530#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:234
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:227
TargetInfo(const llvm::Triple &T)
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition TargetInfo.h:337
@ PowerABIBuiltinVaList
__builtin_va_list as defined by the Power ABI: https://www.power.org /resources/downloads/Power-Arch-...
Definition TargetInfo.h:351
@ CharPtrBuiltinVaList
typedef char* __builtin_va_list;
Definition TargetInfo.h:339
unsigned HasUnalignedAccess
Definition TargetInfo.h:288
unsigned char MaxAtomicPromoteWidth
Definition TargetInfo.h:253
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:253
Options for controlling the target.
AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition OSTargets.h:782
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition PPC.h:517
AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition OSTargets.h:782
AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition OSTargets.h:782
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:435
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition PPC.h:430
PPC32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition PPC.h:396
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:508
bool setABI(const std::string &Name) override
Use the specified ABI.
Definition PPC.h:488
void setMaxAtomicWidth() override
Set the maximum inline or promote width lock-free atomic operation for the given target.
Definition PPC.h:475
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
Definition PPC.h:497
PPC64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition PPC.h:444
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition PPC.h:483
bool isSPRegName(StringRef RegName) const override
Definition PPC.h:367
PPCTargetInfo(const llvm::Triple &Triple, const TargetOptions &)
Definition PPC.h:81
bool setCPU(StringRef Name) override
Target the specified CPU.
Definition PPC.h:101
bool supportsTargetAttributeTune() const override
Determine whether this TargetInfo supports tune in target attribute.
Definition PPC.h:201
bool supportsCpuIs() const override
Definition PPC.h:383
void addP10SpecificFeatures(llvm::StringMap< bool > &Features) const
static constexpr int MINIMUM_AIX_OS_MAJOR
Definition PPC.h:373
bool isValidCPUName(StringRef Name) const override
Determine whether this TargetInfo supports the given CPU name.
Definition PPC.cpp:825
const char * getLongDoubleMangling() const override
Return the mangled code of long double.
Definition PPC.h:355
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:375
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override
Definition PPC.h:215
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
Definition PPC.h:345
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
Definition PPC.h:365
void addFutureSpecificFeatures(llvm::StringMap< bool > &Features) const
std::string convertConstraint(const char *&Constraint) const override
Definition PPC.h:329
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
Definition PPC.h:344
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:374
const char * getIbm128Mangling() const override
Return the mangled code of __ibm128.
Definition PPC.h:363
bool hasSjLjLowering() const override
Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm....
Definition PPC.h:353
bool isCLZForZeroUndef() const override
The __builtin_clz* and __builtin_ctz* built-in functions are specified to have undefined results for ...
Definition PPC.h:179
StringRef getABI() const override
Get the ABI currently in use.
Definition PPC.h:175
void addP11SpecificFeatures(llvm::StringMap< bool > &Features) const
const char * getFloat128Mangling() const override
Return the mangled code of __float128.
Definition PPC.h:362
Defines the clang::TargetInfo interface.
The JSON file list parser is used to communicate input to InstallAPI.
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:294
@ CC_SwiftAsync
Definition Specifiers.h:295
Contains information gathered from parsing the contents of TargetAttr.
Definition TargetInfo.h:60
const llvm::fltSemantics * LongDoubleFormat
Definition TargetInfo.h:144