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