clang  16.0.0git
X86.h
Go to the documentation of this file.
1 //===--- X86.h - Declare X86 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 X86 TargetInfo objects.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_X86_H
14 #define LLVM_CLANG_LIB_BASIC_TARGETS_X86_H
15 
16 #include "OSTargets.h"
18 #include "clang/Basic/TargetInfo.h"
20 #include "llvm/ADT/Triple.h"
21 #include "llvm/Support/Compiler.h"
22 #include "llvm/Support/X86TargetParser.h"
23 
24 namespace clang {
25 namespace targets {
26 
27 static const unsigned X86AddrSpaceMap[] = {
28  0, // Default
29  0, // opencl_global
30  0, // opencl_local
31  0, // opencl_constant
32  0, // opencl_private
33  0, // opencl_generic
34  0, // opencl_global_device
35  0, // opencl_global_host
36  0, // cuda_device
37  0, // cuda_constant
38  0, // cuda_shared
39  0, // sycl_global
40  0, // sycl_global_device
41  0, // sycl_global_host
42  0, // sycl_local
43  0, // sycl_private
44  270, // ptr32_sptr
45  271, // ptr32_uptr
46  272, // ptr64
47  0, // hlsl_groupshared
48 };
49 
50 // X86 target abstract base class; x86-32 and x86-64 are very close, so
51 // most of the implementation can be shared.
52 class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public TargetInfo {
53 
54  enum X86SSEEnum {
55  NoSSE,
56  SSE1,
57  SSE2,
58  SSE3,
59  SSSE3,
60  SSE41,
61  SSE42,
62  AVX,
63  AVX2,
64  AVX512F
65  } SSELevel = NoSSE;
66  enum MMX3DNowEnum {
67  NoMMX3DNow,
68  MMX,
69  AMD3DNow,
70  AMD3DNowAthlon
71  } MMX3DNowLevel = NoMMX3DNow;
72  enum XOPEnum { NoXOP, SSE4A, FMA4, XOP } XOPLevel = NoXOP;
73  enum AddrSpace { ptr32_sptr = 270, ptr32_uptr = 271, ptr64 = 272 };
74 
75  bool HasAES = false;
76  bool HasVAES = false;
77  bool HasPCLMUL = false;
78  bool HasVPCLMULQDQ = false;
79  bool HasGFNI = false;
80  bool HasLZCNT = false;
81  bool HasRDRND = false;
82  bool HasFSGSBASE = false;
83  bool HasBMI = false;
84  bool HasBMI2 = false;
85  bool HasPOPCNT = false;
86  bool HasRTM = false;
87  bool HasPRFCHW = false;
88  bool HasRDSEED = false;
89  bool HasADX = false;
90  bool HasTBM = false;
91  bool HasLWP = false;
92  bool HasFMA = false;
93  bool HasF16C = false;
94  bool HasAVX512CD = false;
95  bool HasAVX512VPOPCNTDQ = false;
96  bool HasAVX512VNNI = false;
97  bool HasAVX512FP16 = false;
98  bool HasAVX512BF16 = false;
99  bool HasAVX512ER = false;
100  bool HasAVX512PF = false;
101  bool HasAVX512DQ = false;
102  bool HasAVX512BITALG = false;
103  bool HasAVX512BW = false;
104  bool HasAVX512VL = false;
105  bool HasAVX512VBMI = false;
106  bool HasAVX512VBMI2 = false;
107  bool HasAVXIFMA = false;
108  bool HasAVX512IFMA = false;
109  bool HasAVX512VP2INTERSECT = false;
110  bool HasSHA = false;
111  bool HasSHSTK = false;
112  bool HasSGX = false;
113  bool HasCX8 = false;
114  bool HasCX16 = false;
115  bool HasFXSR = false;
116  bool HasXSAVE = false;
117  bool HasXSAVEOPT = false;
118  bool HasXSAVEC = false;
119  bool HasXSAVES = false;
120  bool HasMWAITX = false;
121  bool HasCLZERO = false;
122  bool HasCLDEMOTE = false;
123  bool HasPCONFIG = false;
124  bool HasPKU = false;
125  bool HasCLFLUSHOPT = false;
126  bool HasCLWB = false;
127  bool HasMOVBE = false;
128  bool HasPREFETCHI = false;
129  bool HasPREFETCHWT1 = false;
130  bool HasRDPID = false;
131  bool HasRDPRU = false;
132  bool HasRetpolineExternalThunk = false;
133  bool HasLAHFSAHF = false;
134  bool HasWBNOINVD = false;
135  bool HasWAITPKG = false;
136  bool HasMOVDIRI = false;
137  bool HasMOVDIR64B = false;
138  bool HasPTWRITE = false;
139  bool HasINVPCID = false;
140  bool HasENQCMD = false;
141  bool HasAMXFP16 = false;
142  bool HasCMPCCXADD = false;
143  bool HasRAOINT = false;
144  bool HasAVXVNNIINT8 = false;
145  bool HasAVXNECONVERT = false;
146  bool HasKL = false; // For key locker
147  bool HasWIDEKL = false; // For wide key locker
148  bool HasHRESET = false;
149  bool HasAVXVNNI = false;
150  bool HasAMXTILE = false;
151  bool HasAMXINT8 = false;
152  bool HasAMXBF16 = false;
153  bool HasSERIALIZE = false;
154  bool HasTSXLDTRK = false;
155  bool HasUINTR = false;
156  bool HasCRC32 = false;
157  bool HasX87 = false;
158 
159 protected:
160  llvm::X86::CPUKind CPU = llvm::X86::CK_None;
161 
162  enum FPMathKind { FP_Default, FP_SSE, FP_387 } FPMath = FP_Default;
163 
164 public:
165  X86TargetInfo(const llvm::Triple &Triple, const TargetOptions &)
166  : TargetInfo(Triple) {
167  BFloat16Width = BFloat16Align = 16;
168  BFloat16Format = &llvm::APFloat::BFloat();
169  LongDoubleFormat = &llvm::APFloat::x87DoubleExtended();
170  AddrSpaceMap = &X86AddrSpaceMap;
171  HasStrictFP = true;
172 
173  bool IsWinCOFF =
174  getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
175  if (IsWinCOFF)
176  MaxVectorAlign = MaxTLSAlign = 8192u * getCharWidth();
177  }
178 
179  const char *getLongDoubleMangling() const override {
180  return LongDoubleFormat == &llvm::APFloat::IEEEquad() ? "g" : "e";
181  }
182 
184  // X87 evaluates with 80 bits "long double" precision.
185  return SSELevel == NoSSE ? LangOptions::FPEvalMethodKind::FEM_Extended
186  : LangOptions::FPEvalMethodKind::FEM_Source;
187  }
188 
189  // EvalMethod `source` is not supported for targets with `NoSSE` feature.
190  bool supportSourceEvalMethod() const override { return SSELevel > NoSSE; }
191 
192  ArrayRef<const char *> getGCCRegNames() const override;
193 
195  return None;
196  }
197 
198  ArrayRef<TargetInfo::AddlRegName> getGCCAddlRegNames() const override;
199 
200  bool isSPRegName(StringRef RegName) const override {
201  return RegName.equals("esp") || RegName.equals("rsp");
202  }
203 
204  bool validateCpuSupports(StringRef Name) const override;
205 
206  bool validateCpuIs(StringRef Name) const override;
207 
208  bool validateCPUSpecificCPUDispatch(StringRef Name) const override;
209 
210  char CPUSpecificManglingCharacter(StringRef Name) const override;
211 
212  void getCPUSpecificCPUDispatchFeatures(
213  StringRef Name,
214  llvm::SmallVectorImpl<StringRef> &Features) const override;
215 
216  StringRef getCPUSpecificTuneName(StringRef Name) const override;
217 
218  Optional<unsigned> getCPUCacheLineSize() const override;
219 
220  bool validateAsmConstraint(const char *&Name,
221  TargetInfo::ConstraintInfo &info) const override;
222 
223  bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize,
224  bool &HasSizeMismatch) const override {
225  // esp and ebp are the only 32-bit registers the x86 backend can currently
226  // handle.
227  if (RegName.equals("esp") || RegName.equals("ebp")) {
228  // Check that the register size is 32-bit.
229  HasSizeMismatch = RegSize != 32;
230  return true;
231  }
232 
233  return false;
234  }
235 
236  bool validateOutputSize(const llvm::StringMap<bool> &FeatureMap,
237  StringRef Constraint, unsigned Size) const override;
238 
239  bool validateInputSize(const llvm::StringMap<bool> &FeatureMap,
240  StringRef Constraint, unsigned Size) const override;
241 
242  bool
244  if (CPU == llvm::X86::CK_None || CPU >= llvm::X86::CK_PentiumPro)
245  return true;
247  };
248 
249  bool
251  if (CPU == llvm::X86::CK_None || CPU >= llvm::X86::CK_PentiumPro)
252  return true;
254  };
255 
256  virtual bool validateOperandSize(const llvm::StringMap<bool> &FeatureMap,
257  StringRef Constraint, unsigned Size) const;
258 
259  std::string convertConstraint(const char *&Constraint) const override;
260  const char *getClobbers() const override {
261  return "~{dirflag},~{fpsr},~{flags}";
262  }
263 
264  StringRef getConstraintRegister(StringRef Constraint,
265  StringRef Expression) const override {
266  StringRef::iterator I, E;
267  for (I = Constraint.begin(), E = Constraint.end(); I != E; ++I) {
268  if (isalpha(*I) || *I == '@')
269  break;
270  }
271  if (I == E)
272  return "";
273  switch (*I) {
274  // For the register constraints, return the matching register name
275  case 'a':
276  return "ax";
277  case 'b':
278  return "bx";
279  case 'c':
280  return "cx";
281  case 'd':
282  return "dx";
283  case 'S':
284  return "si";
285  case 'D':
286  return "di";
287  // In case the constraint is 'r' we need to return Expression
288  case 'r':
289  return Expression;
290  // Double letters Y<x> constraints
291  case 'Y':
292  if ((++I != E) && ((*I == '0') || (*I == 'z')))
293  return "xmm0";
294  break;
295  default:
296  break;
297  }
298  return "";
299  }
300 
301  bool useFP16ConversionIntrinsics() const override {
302  return false;
303  }
304 
305  bool shouldEmitFloat16WithExcessPrecision() const override {
306  return HasFloat16 && !hasLegalHalfType();
307  }
308 
309  void getTargetDefines(const LangOptions &Opts,
310  MacroBuilder &Builder) const override;
311 
312  void setFeatureEnabled(llvm::StringMap<bool> &Features, StringRef Name,
313  bool Enabled) const final;
314 
315  bool
316  initFeatureMap(llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags,
317  StringRef CPU,
318  const std::vector<std::string> &FeaturesVec) const override;
319 
320  bool isValidFeatureName(StringRef Name) const override;
321 
322  bool hasFeature(StringRef Feature) const final;
323 
324  bool handleTargetFeatures(std::vector<std::string> &Features,
325  DiagnosticsEngine &Diags) override;
326 
327  StringRef getABI() const override {
328  if (getTriple().getArch() == llvm::Triple::x86_64 && SSELevel >= AVX512F)
329  return "avx512";
330  if (getTriple().getArch() == llvm::Triple::x86_64 && SSELevel >= AVX)
331  return "avx";
332  if (getTriple().getArch() == llvm::Triple::x86 &&
333  MMX3DNowLevel == NoMMX3DNow)
334  return "no-mmx";
335  return "";
336  }
337 
338  bool supportsTargetAttributeTune() const override {
339  return true;
340  }
341 
342  bool isValidCPUName(StringRef Name) const override {
343  bool Only64Bit = getTriple().getArch() != llvm::Triple::x86;
344  return llvm::X86::parseArchX86(Name, Only64Bit) != llvm::X86::CK_None;
345  }
346 
347  bool isValidTuneCPUName(StringRef Name) const override {
348  if (Name == "generic")
349  return true;
350 
351  // Allow 32-bit only CPUs regardless of 64-bit mode unlike isValidCPUName.
352  // NOTE: gcc rejects 32-bit mtune CPUs in 64-bit mode. But being lenient
353  // since mtune was ignored by clang for so long.
354  return llvm::X86::parseTuneCPU(Name) != llvm::X86::CK_None;
355  }
356 
357  void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const override;
358  void fillValidTuneCPUList(SmallVectorImpl<StringRef> &Values) const override;
359 
360  bool setCPU(const std::string &Name) override {
361  bool Only64Bit = getTriple().getArch() != llvm::Triple::x86;
362  CPU = llvm::X86::parseArchX86(Name, Only64Bit);
363  return CPU != llvm::X86::CK_None;
364  }
365 
366  unsigned multiVersionSortPriority(StringRef Name) const override;
367 
368  bool setFPMath(StringRef Name) override;
369 
370  bool supportsExtendIntArgs() const override {
371  return getTriple().getArch() != llvm::Triple::x86;
372  }
373 
375  // Most of the non-ARM calling conventions are i386 conventions.
376  switch (CC) {
377  case CC_X86ThisCall:
378  case CC_X86FastCall:
379  case CC_X86StdCall:
380  case CC_X86VectorCall:
381  case CC_X86RegCall:
382  case CC_C:
383  case CC_PreserveMost:
384  case CC_Swift:
385  case CC_X86Pascal:
386  case CC_IntelOclBicc:
387  case CC_OpenCLKernel:
388  return CCCR_OK;
389  case CC_SwiftAsync:
390  return CCCR_Error;
391  default:
392  return CCCR_Warning;
393  }
394  }
395 
396  bool checkArithmeticFenceSupported() const override { return true; }
397 
399  return CC_C;
400  }
401 
402  bool hasSjLjLowering() const override { return true; }
403 
404  void setSupportedOpenCLOpts() override { supportAllOpenCLOpts(); }
405 
406  uint64_t getPointerWidthV(unsigned AddrSpace) const override {
407  if (AddrSpace == ptr32_sptr || AddrSpace == ptr32_uptr)
408  return 32;
409  if (AddrSpace == ptr64)
410  return 64;
411  return PointerWidth;
412  }
413 
414  uint64_t getPointerAlignV(unsigned AddrSpace) const override {
415  return getPointerWidthV(AddrSpace);
416  }
417 
418  const char *getBFloat16Mangling() const override { return "u6__bf16"; };
419 };
420 
421 // X86-32 generic target
422 class LLVM_LIBRARY_VISIBILITY X86_32TargetInfo : public X86TargetInfo {
423 public:
424  X86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
425  : X86TargetInfo(Triple, Opts) {
426  DoubleAlign = LongLongAlign = 32;
427  LongDoubleWidth = 96;
428  LongDoubleAlign = 32;
429  SuitableAlign = 128;
430  resetDataLayout(
431  Triple.isOSBinFormatMachO()
432  ? "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-"
433  "f80:32-n8:16:32-S128"
434  : "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-"
435  "f80:32-n8:16:32-S128",
436  Triple.isOSBinFormatMachO() ? "_" : "");
437  SizeType = UnsignedInt;
438  PtrDiffType = SignedInt;
439  IntPtrType = SignedInt;
440  RegParmMax = 3;
441 
442  // Use fpret for all types.
443  RealTypeUsesObjCFPRetMask =
446 
447  // x86-32 has atomics up to 8 bytes
448  MaxAtomicPromoteWidth = 64;
449  MaxAtomicInlineWidth = 32;
450  }
451 
454  }
455 
456  int getEHDataRegisterNumber(unsigned RegNo) const override {
457  if (RegNo == 0)
458  return 0;
459  if (RegNo == 1)
460  return 2;
461  return -1;
462  }
463 
464  bool validateOperandSize(const llvm::StringMap<bool> &FeatureMap,
465  StringRef Constraint, unsigned Size) const override {
466  switch (Constraint[0]) {
467  default:
468  break;
469  case 'R':
470  case 'q':
471  case 'Q':
472  case 'a':
473  case 'b':
474  case 'c':
475  case 'd':
476  case 'S':
477  case 'D':
478  return Size <= 32;
479  case 'A':
480  return Size <= 64;
481  }
482 
483  return X86TargetInfo::validateOperandSize(FeatureMap, Constraint, Size);
484  }
485 
486  void setMaxAtomicWidth() override {
487  if (hasFeature("cx8"))
488  MaxAtomicInlineWidth = 64;
489  }
490 
491  ArrayRef<Builtin::Info> getTargetBuiltins() const override;
492 
493  bool hasBitIntType() const override { return true; }
494 };
495 
496 class LLVM_LIBRARY_VISIBILITY NetBSDI386TargetInfo
497  : public NetBSDTargetInfo<X86_32TargetInfo> {
498 public:
499  NetBSDI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
500  : NetBSDTargetInfo<X86_32TargetInfo>(Triple, Opts) {}
501 
503  VersionTuple OsVersion = getTriple().getOSVersion();
504  // New NetBSD uses the default rounding mode.
505  if (OsVersion >= VersionTuple(6, 99, 26) || OsVersion.getMajor() == 0)
507  // NetBSD before 6.99.26 defaults to "double" rounding.
508  return LangOptions::FPEvalMethodKind::FEM_Double;
509  }
510 };
511 
512 class LLVM_LIBRARY_VISIBILITY OpenBSDI386TargetInfo
513  : public OpenBSDTargetInfo<X86_32TargetInfo> {
514 public:
515  OpenBSDI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
516  : OpenBSDTargetInfo<X86_32TargetInfo>(Triple, Opts) {
517  SizeType = UnsignedLong;
518  IntPtrType = SignedLong;
519  PtrDiffType = SignedLong;
520  }
521 };
522 
523 class LLVM_LIBRARY_VISIBILITY DarwinI386TargetInfo
524  : public DarwinTargetInfo<X86_32TargetInfo> {
525 public:
526  DarwinI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
527  : DarwinTargetInfo<X86_32TargetInfo>(Triple, Opts) {
528  LongDoubleWidth = 128;
529  LongDoubleAlign = 128;
530  SuitableAlign = 128;
531  MaxVectorAlign = 256;
532  // The watchOS simulator uses the builtin bool type for Objective-C.
533  llvm::Triple T = llvm::Triple(Triple);
534  if (T.isWatchOS())
535  UseSignedCharForObjCBool = false;
536  SizeType = UnsignedLong;
537  IntPtrType = SignedLong;
538  resetDataLayout("e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-"
539  "f80:128-n8:16:32-S128", "_");
540  HasAlignMac68kSupport = true;
541  }
542 
543  bool handleTargetFeatures(std::vector<std::string> &Features,
544  DiagnosticsEngine &Diags) override {
546  Diags))
547  return false;
548  // We now know the features we have: we can decide how to align vectors.
549  MaxVectorAlign =
550  hasFeature("avx512f") ? 512 : hasFeature("avx") ? 256 : 128;
551  return true;
552  }
553 };
554 
555 // x86-32 Windows target
556 class LLVM_LIBRARY_VISIBILITY WindowsX86_32TargetInfo
557  : public WindowsTargetInfo<X86_32TargetInfo> {
558 public:
559  WindowsX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
560  : WindowsTargetInfo<X86_32TargetInfo>(Triple, Opts) {
561  DoubleAlign = LongLongAlign = 64;
562  bool IsWinCOFF =
563  getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
564  bool IsMSVC = getTriple().isWindowsMSVCEnvironment();
565  std::string Layout = IsWinCOFF ? "e-m:x" : "e-m:e";
566  Layout += "-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-";
567  Layout += IsMSVC ? "f80:128" : "f80:32";
568  Layout += "-n8:16:32-a:0:32-S32";
569  resetDataLayout(Layout, IsWinCOFF ? "_" : "");
570  }
571 };
572 
573 // x86-32 Windows Visual Studio target
574 class LLVM_LIBRARY_VISIBILITY MicrosoftX86_32TargetInfo
575  : public WindowsX86_32TargetInfo {
576 public:
577  MicrosoftX86_32TargetInfo(const llvm::Triple &Triple,
578  const TargetOptions &Opts)
579  : WindowsX86_32TargetInfo(Triple, Opts) {
580  LongDoubleWidth = LongDoubleAlign = 64;
581  LongDoubleFormat = &llvm::APFloat::IEEEdouble();
582  }
583 
584  void getTargetDefines(const LangOptions &Opts,
585  MacroBuilder &Builder) const override {
587  // The value of the following reflects processor type.
588  // 300=386, 400=486, 500=Pentium, 600=Blend (default)
589  // We lost the original triple, so we use the default.
590  Builder.defineMacro("_M_IX86", "600");
591  }
592 };
593 
594 // x86-32 MinGW target
595 class LLVM_LIBRARY_VISIBILITY MinGWX86_32TargetInfo
596  : public WindowsX86_32TargetInfo {
597 public:
598  MinGWX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
599  : WindowsX86_32TargetInfo(Triple, Opts) {
600  HasFloat128 = true;
601  }
602 
603  void getTargetDefines(const LangOptions &Opts,
604  MacroBuilder &Builder) const override {
606  Builder.defineMacro("_X86_");
607  }
608 };
609 
610 // x86-32 Cygwin target
611 class LLVM_LIBRARY_VISIBILITY CygwinX86_32TargetInfo : public X86_32TargetInfo {
612 public:
613  CygwinX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
614  : X86_32TargetInfo(Triple, Opts) {
615  this->WCharType = TargetInfo::UnsignedShort;
616  DoubleAlign = LongLongAlign = 64;
617  resetDataLayout("e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:"
618  "32-n8:16:32-a:0:32-S32",
619  "_");
620  }
621 
622  void getTargetDefines(const LangOptions &Opts,
623  MacroBuilder &Builder) const override {
624  X86_32TargetInfo::getTargetDefines(Opts, Builder);
625  Builder.defineMacro("_X86_");
626  Builder.defineMacro("__CYGWIN__");
627  Builder.defineMacro("__CYGWIN32__");
628  addCygMingDefines(Opts, Builder);
629  DefineStd(Builder, "unix", Opts);
630  if (Opts.CPlusPlus)
631  Builder.defineMacro("_GNU_SOURCE");
632  }
633 };
634 
635 // x86-32 Haiku target
636 class LLVM_LIBRARY_VISIBILITY HaikuX86_32TargetInfo
637  : public HaikuTargetInfo<X86_32TargetInfo> {
638 public:
639  HaikuX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
640  : HaikuTargetInfo<X86_32TargetInfo>(Triple, Opts) {}
641 
642  void getTargetDefines(const LangOptions &Opts,
643  MacroBuilder &Builder) const override {
645  Builder.defineMacro("__INTEL__");
646  }
647 };
648 
649 // X86-32 MCU target
650 class LLVM_LIBRARY_VISIBILITY MCUX86_32TargetInfo : public X86_32TargetInfo {
651 public:
652  MCUX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
653  : X86_32TargetInfo(Triple, Opts) {
654  LongDoubleWidth = 64;
655  LongDoubleFormat = &llvm::APFloat::IEEEdouble();
656  resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:32-f64:"
657  "32-f128:32-n8:16:32-a:0:32-S32");
658  WIntType = UnsignedInt;
659  }
660 
662  // On MCU we support only C calling convention.
663  return CC == CC_C ? CCCR_OK : CCCR_Warning;
664  }
665 
666  void getTargetDefines(const LangOptions &Opts,
667  MacroBuilder &Builder) const override {
668  X86_32TargetInfo::getTargetDefines(Opts, Builder);
669  Builder.defineMacro("__iamcu");
670  Builder.defineMacro("__iamcu__");
671  }
672 
673  bool allowsLargerPreferedTypeAlignment() const override { return false; }
674 };
675 
676 // x86-32 RTEMS target
677 class LLVM_LIBRARY_VISIBILITY RTEMSX86_32TargetInfo : public X86_32TargetInfo {
678 public:
679  RTEMSX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
680  : X86_32TargetInfo(Triple, Opts) {
681  SizeType = UnsignedLong;
682  IntPtrType = SignedLong;
683  PtrDiffType = SignedLong;
684  }
685 
686  void getTargetDefines(const LangOptions &Opts,
687  MacroBuilder &Builder) const override {
688  X86_32TargetInfo::getTargetDefines(Opts, Builder);
689  Builder.defineMacro("__INTEL__");
690  Builder.defineMacro("__rtems__");
691  }
692 };
693 
694 // x86-64 generic target
695 class LLVM_LIBRARY_VISIBILITY X86_64TargetInfo : public X86TargetInfo {
696 public:
697  X86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
698  : X86TargetInfo(Triple, Opts) {
699  const bool IsX32 = getTriple().isX32();
700  bool IsWinCOFF =
701  getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
702  LongWidth = LongAlign = PointerWidth = PointerAlign = IsX32 ? 32 : 64;
703  LongDoubleWidth = 128;
704  LongDoubleAlign = 128;
705  LargeArrayMinWidth = 128;
706  LargeArrayAlign = 128;
707  SuitableAlign = 128;
708  SizeType = IsX32 ? UnsignedInt : UnsignedLong;
709  PtrDiffType = IsX32 ? SignedInt : SignedLong;
710  IntPtrType = IsX32 ? SignedInt : SignedLong;
711  IntMaxType = IsX32 ? SignedLongLong : SignedLong;
712  Int64Type = IsX32 ? SignedLongLong : SignedLong;
713  RegParmMax = 6;
714 
715  // Pointers are 32-bit in x32.
716  resetDataLayout(IsX32 ? "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-"
717  "i64:64-f80:128-n8:16:32:64-S128"
718  : IsWinCOFF ? "e-m:w-p270:32:32-p271:32:32-p272:64:"
719  "64-i64:64-f80:128-n8:16:32:64-S128"
720  : "e-m:e-p270:32:32-p271:32:32-p272:64:"
721  "64-i64:64-f80:128-n8:16:32:64-S128");
722 
723  // Use fpret only for long double.
724  RealTypeUsesObjCFPRetMask = (unsigned)FloatModeKind::LongDouble;
725 
726  // Use fp2ret for _Complex long double.
727  ComplexLongDoubleUsesFP2Ret = true;
728 
729  // Make __builtin_ms_va_list available.
730  HasBuiltinMSVaList = true;
731 
732  // x86-64 has atomics up to 16 bytes.
733  MaxAtomicPromoteWidth = 128;
734  MaxAtomicInlineWidth = 64;
735  }
736 
739  }
740 
741  int getEHDataRegisterNumber(unsigned RegNo) const override {
742  if (RegNo == 0)
743  return 0;
744  if (RegNo == 1)
745  return 1;
746  return -1;
747  }
748 
750  switch (CC) {
751  case CC_C:
752  case CC_Swift:
753  case CC_SwiftAsync:
754  case CC_X86VectorCall:
755  case CC_IntelOclBicc:
756  case CC_Win64:
757  case CC_PreserveMost:
758  case CC_PreserveAll:
759  case CC_X86RegCall:
760  case CC_OpenCLKernel:
761  return CCCR_OK;
762  default:
763  return CCCR_Warning;
764  }
765  }
766 
768  return CC_C;
769  }
770 
771  // for x32 we need it here explicitly
772  bool hasInt128Type() const override { return true; }
773 
774  unsigned getUnwindWordWidth() const override { return 64; }
775 
776  unsigned getRegisterWidth() const override { return 64; }
777 
778  bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize,
779  bool &HasSizeMismatch) const override {
780  // rsp and rbp are the only 64-bit registers the x86 backend can currently
781  // handle.
782  if (RegName.equals("rsp") || RegName.equals("rbp")) {
783  // Check that the register size is 64-bit.
784  HasSizeMismatch = RegSize != 64;
785  return true;
786  }
787 
788  // Check if the register is a 32-bit register the backend can handle.
789  return X86TargetInfo::validateGlobalRegisterVariable(RegName, RegSize,
790  HasSizeMismatch);
791  }
792 
793  void setMaxAtomicWidth() override {
794  if (hasFeature("cx16"))
795  MaxAtomicInlineWidth = 128;
796  }
797 
798  ArrayRef<Builtin::Info> getTargetBuiltins() const override;
799 
800  bool hasBitIntType() const override { return true; }
801 };
802 
803 // x86-64 Windows target
804 class LLVM_LIBRARY_VISIBILITY WindowsX86_64TargetInfo
805  : public WindowsTargetInfo<X86_64TargetInfo> {
806 public:
807  WindowsX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
808  : WindowsTargetInfo<X86_64TargetInfo>(Triple, Opts) {
809  LongWidth = LongAlign = 32;
810  DoubleAlign = LongLongAlign = 64;
811  IntMaxType = SignedLongLong;
812  Int64Type = SignedLongLong;
813  SizeType = UnsignedLongLong;
814  PtrDiffType = SignedLongLong;
815  IntPtrType = SignedLongLong;
816  }
817 
820  }
821 
823  switch (CC) {
824  case CC_X86StdCall:
825  case CC_X86ThisCall:
826  case CC_X86FastCall:
827  return CCCR_Ignore;
828  case CC_C:
829  case CC_X86VectorCall:
830  case CC_IntelOclBicc:
831  case CC_PreserveMost:
832  case CC_PreserveAll:
833  case CC_X86_64SysV:
834  case CC_Swift:
835  case CC_SwiftAsync:
836  case CC_X86RegCall:
837  case CC_OpenCLKernel:
838  return CCCR_OK;
839  default:
840  return CCCR_Warning;
841  }
842  }
843 };
844 
845 // x86-64 Windows Visual Studio target
846 class LLVM_LIBRARY_VISIBILITY MicrosoftX86_64TargetInfo
847  : public WindowsX86_64TargetInfo {
848 public:
849  MicrosoftX86_64TargetInfo(const llvm::Triple &Triple,
850  const TargetOptions &Opts)
851  : WindowsX86_64TargetInfo(Triple, Opts) {
852  LongDoubleWidth = LongDoubleAlign = 64;
853  LongDoubleFormat = &llvm::APFloat::IEEEdouble();
854  }
855 
856  void getTargetDefines(const LangOptions &Opts,
857  MacroBuilder &Builder) const override {
859  Builder.defineMacro("_M_X64", "100");
860  Builder.defineMacro("_M_AMD64", "100");
861  }
862 
864  getCallingConvKind(bool ClangABICompat4) const override {
865  return CCK_MicrosoftWin64;
866  }
867 };
868 
869 // x86-64 MinGW target
870 class LLVM_LIBRARY_VISIBILITY MinGWX86_64TargetInfo
871  : public WindowsX86_64TargetInfo {
872 public:
873  MinGWX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
874  : WindowsX86_64TargetInfo(Triple, Opts) {
875  // Mingw64 rounds long double size and alignment up to 16 bytes, but sticks
876  // with x86 FP ops. Weird.
877  LongDoubleWidth = LongDoubleAlign = 128;
878  LongDoubleFormat = &llvm::APFloat::x87DoubleExtended();
879  HasFloat128 = true;
880  }
881 };
882 
883 // x86-64 Cygwin target
884 class LLVM_LIBRARY_VISIBILITY CygwinX86_64TargetInfo : public X86_64TargetInfo {
885 public:
886  CygwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
887  : X86_64TargetInfo(Triple, Opts) {
888  this->WCharType = TargetInfo::UnsignedShort;
889  TLSSupported = false;
890  }
891 
892  void getTargetDefines(const LangOptions &Opts,
893  MacroBuilder &Builder) const override {
894  X86_64TargetInfo::getTargetDefines(Opts, Builder);
895  Builder.defineMacro("__x86_64__");
896  Builder.defineMacro("__CYGWIN__");
897  Builder.defineMacro("__CYGWIN64__");
898  addCygMingDefines(Opts, Builder);
899  DefineStd(Builder, "unix", Opts);
900  if (Opts.CPlusPlus)
901  Builder.defineMacro("_GNU_SOURCE");
902  }
903 };
904 
905 class LLVM_LIBRARY_VISIBILITY DarwinX86_64TargetInfo
906  : public DarwinTargetInfo<X86_64TargetInfo> {
907 public:
908  DarwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
909  : DarwinTargetInfo<X86_64TargetInfo>(Triple, Opts) {
910  Int64Type = SignedLongLong;
911  // The 64-bit iOS simulator uses the builtin bool type for Objective-C.
912  llvm::Triple T = llvm::Triple(Triple);
913  if (T.isiOS())
914  UseSignedCharForObjCBool = false;
915  resetDataLayout("e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:"
916  "16:32:64-S128", "_");
917  }
918 
919  bool handleTargetFeatures(std::vector<std::string> &Features,
920  DiagnosticsEngine &Diags) override {
922  Diags))
923  return false;
924  // We now know the features we have: we can decide how to align vectors.
925  MaxVectorAlign =
926  hasFeature("avx512f") ? 512 : hasFeature("avx") ? 256 : 128;
927  return true;
928  }
929 };
930 
931 class LLVM_LIBRARY_VISIBILITY OpenBSDX86_64TargetInfo
932  : public OpenBSDTargetInfo<X86_64TargetInfo> {
933 public:
934  OpenBSDX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
935  : OpenBSDTargetInfo<X86_64TargetInfo>(Triple, Opts) {
936  IntMaxType = SignedLongLong;
937  Int64Type = SignedLongLong;
938  }
939 };
940 
941 // x86_32 Android target
942 class LLVM_LIBRARY_VISIBILITY AndroidX86_32TargetInfo
943  : public LinuxTargetInfo<X86_32TargetInfo> {
944 public:
945  AndroidX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
946  : LinuxTargetInfo<X86_32TargetInfo>(Triple, Opts) {
947  SuitableAlign = 32;
948  LongDoubleWidth = 64;
949  LongDoubleFormat = &llvm::APFloat::IEEEdouble();
950  }
951 };
952 
953 // x86_64 Android target
954 class LLVM_LIBRARY_VISIBILITY AndroidX86_64TargetInfo
955  : public LinuxTargetInfo<X86_64TargetInfo> {
956 public:
957  AndroidX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
958  : LinuxTargetInfo<X86_64TargetInfo>(Triple, Opts) {
959  LongDoubleFormat = &llvm::APFloat::IEEEquad();
960  }
961 };
962 } // namespace targets
963 } // namespace clang
964 #endif // LLVM_CLANG_LIB_BASIC_TARGETS_X86_H
clang::targets::X86TargetInfo::getClobbers
const char * getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
Definition: X86.h:260
clang::targets::MinGWX86_64TargetInfo::MinGWX86_64TargetInfo
MinGWX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:873
clang::targets::X86TargetInfo::setSupportedOpenCLOpts
void setSupportedOpenCLOpts() override
Set supported OpenCL extensions and optional core features.
Definition: X86.h:404
clang::targets::OSTargetInfo< X86_32TargetInfo >::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
Definition: OSTargets.h:30
clang::targets::DarwinX86_64TargetInfo
Definition: X86.h:905
clang::targets::X86TargetInfo::hasSjLjLowering
bool hasSjLjLowering() const override
Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm....
Definition: X86.h:402
clang::CC_X86FastCall
@ CC_X86FastCall
Definition: Specifiers.h:269
clang::targets::X86_64TargetInfo::getUnwindWordWidth
unsigned getUnwindWordWidth() const override
Definition: X86.h:774
clang::CC_Win64
@ CC_Win64
Definition: Specifiers.h:273
clang::targets::X86TargetInfo::supportSourceEvalMethod
bool supportSourceEvalMethod() const override
Definition: X86.h:190
clang::FloatModeKind::LongDouble
@ LongDouble
clang::targets::CygwinX86_64TargetInfo
Definition: X86.h:884
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::targets::OpenBSDTargetInfo
Definition: OSTargets.h:451
clang::targets::MCUX86_32TargetInfo
Definition: X86.h:650
clang::TargetInfo::X86_64ABIBuiltinVaList
@ X86_64ABIBuiltinVaList
__builtin_va_list as defined by the x86-64 ABI: http://refspecs.linuxbase.org/elf/x86_64-abi-0....
Definition: TargetInfo.h:311
clang::RISCV::SignedLong
@ SignedLong
Definition: RISCVVIntrinsicUtils.h:166
clang::targets::X86TargetInfo::isValidTuneCPUName
bool isValidTuneCPUName(StringRef Name) const override
brief Determine whether this TargetInfo supports the given CPU name for
Definition: X86.h:347
clang::targets::X86TargetInfo::validateGlobalRegisterVariable
bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize, bool &HasSizeMismatch) const override
Validate register name used for global register variables.
Definition: X86.h:223
clang::targets::X86TargetInfo::getConstraintRegister
StringRef getConstraintRegister(StringRef Constraint, StringRef Expression) const override
Extracts a register from the passed constraint (if it is a single-register constraint) and the asm la...
Definition: X86.h:264
clang::targets::X86TargetInfo::getLongDoubleMangling
const char * getLongDoubleMangling() const override
Return the mangled code of long double.
Definition: X86.h:179
TargetInfo.h
clang::TargetInfo::checkCFProtectionReturnSupported
virtual bool checkCFProtectionReturnSupported(DiagnosticsEngine &Diags) const
Check if the target supports CFProtection branch.
Definition: TargetInfo.cpp:177
clang::targets::MicrosoftX86_32TargetInfo::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
Definition: X86.h:584
clang::TransferrableTargetInfo::UnsignedShort
@ UnsignedShort
Definition: TargetInfo.h:140
clang::targets::X86TargetInfo::getPointerWidthV
uint64_t getPointerWidthV(unsigned AddrSpace) const override
Definition: X86.h:406
clang::DiagnosticsEngine
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:192
getCharWidth
static unsigned getCharWidth(tok::TokenKind kind, const TargetInfo &Target)
Definition: LiteralSupport.cpp:40
clang::TargetInfo
Exposes information about the current target.
Definition: TargetInfo.h:205
clang::targets::X86TargetInfo::checkArithmeticFenceSupported
bool checkArithmeticFenceSupported() const override
Controls if __arithmetic_fence is supported in the targeted backend.
Definition: X86.h:396
clang::targets::NetBSDI386TargetInfo::NetBSDI386TargetInfo
NetBSDI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:499
clang::targets::X86TargetInfo::getFPEvalMethod
LangOptions::FPEvalMethodKind getFPEvalMethod() const override
Return the value for the C99 FLT_EVAL_METHOD macro.
Definition: X86.h:183
llvm::Optional< unsigned >
Expression
clang::targets::X86TargetInfo::getDefaultCallingConv
CallingConv getDefaultCallingConv() const override
Gets the default calling convention for the given target and declaration context.
Definition: X86.h:398
clang::targets::X86_64TargetInfo::getBuiltinVaListKind
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition: X86.h:737
clang::CC_X86ThisCall
@ CC_X86ThisCall
Definition: Specifiers.h:270
clang::targets::X86TargetInfo::checkCFProtectionBranchSupported
bool checkCFProtectionBranchSupported(DiagnosticsEngine &Diags) const override
Check if the target supports CFProtection branch.
Definition: X86.h:250
clang::targets::AndroidX86_32TargetInfo
Definition: X86.h:942
clang::targets::X86TargetInfo::getGCCRegAliases
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
Definition: X86.h:194
clang::targets::MinGWX86_32TargetInfo::MinGWX86_32TargetInfo
MinGWX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:598
clang::TargetInfo::BuiltinVaListKind
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition: TargetInfo.h:289
clang::targets::X86TargetInfo::isValidCPUName
bool isValidCPUName(StringRef Name) const override
brief Determine whether this TargetInfo supports the given CPU name.
Definition: X86.h:342
clang::targets::X86_64TargetInfo::checkCallingConvention
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
Definition: X86.h:749
clang::targets::WindowsX86_32TargetInfo
Definition: X86.h:556
clang::targets::X86_32TargetInfo::setMaxAtomicWidth
void setMaxAtomicWidth() override
Set the maximum inline or promote width lock-free atomic operation for the given target.
Definition: X86.h:486
clang::targets::HaikuX86_32TargetInfo::HaikuX86_32TargetInfo
HaikuX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:639
clang::targets::X86_32TargetInfo
Definition: X86.h:422
clang::CC_X86StdCall
@ CC_X86StdCall
Definition: Specifiers.h:268
clang::targets::WindowsX86_64TargetInfo::getBuiltinVaListKind
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition: X86.h:818
clang::TargetInfo::checkCFProtectionBranchSupported
virtual bool checkCFProtectionBranchSupported(DiagnosticsEngine &Diags) const
Check if the target supports CFProtection branch.
Definition: TargetInfo.cpp:171
clang::CC_OpenCLKernel
@ CC_OpenCLKernel
Definition: Specifiers.h:280
clang::targets::WindowsX86_64TargetInfo::checkCallingConvention
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
Definition: X86.h:822
clang::targets::addCygMingDefines
void addCygMingDefines(const LangOptions &Opts, MacroBuilder &Builder)
Definition: Targets.cpp:82
clang::targets::NetBSDTargetInfo
Definition: OSTargets.h:430
clang::targets::X86TargetInfo::isSPRegName
bool isSPRegName(StringRef RegName) const override
Definition: X86.h:200
clang::targets::X86_64TargetInfo
Definition: X86.h:695
clang::targets::X86TargetInfo::getABI
StringRef getABI() const override
Get the ABI currently in use.
Definition: X86.h:327
clang::targets::NetBSDI386TargetInfo::getFPEvalMethod
LangOptions::FPEvalMethodKind getFPEvalMethod() const override
Return the value for the C99 FLT_EVAL_METHOD macro.
Definition: X86.h:502
clang::targets::X86_64TargetInfo::hasBitIntType
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
Definition: X86.h:800
clang::CC_Swift
@ CC_Swift
Definition: Specifiers.h:281
clang::targets::X86TargetInfo::supportsExtendIntArgs
bool supportsExtendIntArgs() const override
Whether the option -fextend-arguments={32,64} is supported on the target.
Definition: X86.h:370
clang::targets::WindowsTargetInfo
Definition: OSTargets.h:841
clang::targets::X86_32TargetInfo::hasBitIntType
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
Definition: X86.h:493
clang::targets::MinGWX86_32TargetInfo::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
Definition: X86.h:603
clang::targets::DarwinI386TargetInfo::DarwinI386TargetInfo
DarwinI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:526
clang::targets::X86_64TargetInfo::getEHDataRegisterNumber
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
Definition: X86.h:741
clang::RISCV::UnsignedLong
@ UnsignedLong
Definition: RISCVVIntrinsicUtils.h:165
clang::targets::DarwinTargetInfo
Definition: OSTargets.h:76
hlsl::uint64_t
unsigned long uint64_t
Definition: hlsl_basic_types.h:25
clang::targets::X86TargetInfo::supportsTargetAttributeTune
bool supportsTargetAttributeTune() const override
brief Determine whether this TargetInfo supports tune in target attribute.
Definition: X86.h:338
clang::targets::X86TargetInfo::setCPU
bool setCPU(const std::string &Name) override
Target the specified CPU.
Definition: X86.h:360
clang::targets::MicrosoftX86_32TargetInfo::MicrosoftX86_32TargetInfo
MicrosoftX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:577
clang::targets::CygwinX86_64TargetInfo::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
Definition: X86.h:892
clang::targets::AndroidX86_32TargetInfo::AndroidX86_32TargetInfo
AndroidX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:945
clang::targets::AndroidX86_64TargetInfo::AndroidX86_64TargetInfo
AndroidX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:957
clang::LangOptions::FPEvalMethodKind
FPEvalMethodKind
Possible float expression evaluation method choices.
Definition: LangOptions.h:281
clang::targets::DefineStd
void DefineStd(MacroBuilder &Builder, StringRef MacroName, const LangOptions &Opts)
DefineStd - Define a macro name and standard variants.
Definition: Targets.cpp:59
clang::targets::OpenBSDI386TargetInfo
Definition: X86.h:512
clang::targets::X86_64TargetInfo::getRegisterWidth
unsigned getRegisterWidth() const override
Return the "preferred" register width on this target.
Definition: X86.h:776
clang::targets::X86TargetInfo::checkCFProtectionReturnSupported
bool checkCFProtectionReturnSupported(DiagnosticsEngine &Diags) const override
Check if the target supports CFProtection branch.
Definition: X86.h:243
clang::CallingConv
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition: Specifiers.h:266
clang::targets::DarwinI386TargetInfo::handleTargetFeatures
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
handleTargetFeatures - Perform initialization based on the user configured set of features.
Definition: X86.h:543
clang::targets::CygwinX86_64TargetInfo::CygwinX86_64TargetInfo
CygwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:886
clang::targets::X86AddrSpaceMap
static const unsigned X86AddrSpaceMap[]
Definition: X86.h:27
clang::targets::MinGWX86_64TargetInfo
Definition: X86.h:870
clang::FloatModeKind::Double
@ Double
clang::CC_C
@ CC_C
Definition: Specifiers.h:267
clang::targets::MCUX86_32TargetInfo::allowsLargerPreferedTypeAlignment
bool allowsLargerPreferedTypeAlignment() const override
Whether target allows to overalign ABI-specified preferred alignment.
Definition: X86.h:673
clang::targets::WindowsX86_64TargetInfo
Definition: X86.h:804
clang::targets::MCUX86_32TargetInfo::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
Definition: X86.h:666
clang::targets::RTEMSX86_32TargetInfo::RTEMSX86_32TargetInfo
RTEMSX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:679
clang::targets::WindowsX86_32TargetInfo::WindowsX86_32TargetInfo
WindowsX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:559
clang::targets::X86_64TargetInfo::setMaxAtomicWidth
void setMaxAtomicWidth() override
Set the maximum inline or promote width lock-free atomic operation for the given target.
Definition: X86.h:793
clang::targets::X86_32TargetInfo::getEHDataRegisterNumber
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
Definition: X86.h:456
clang::targets::MinGWX86_32TargetInfo
Definition: X86.h:595
clang::targets::RTEMSX86_32TargetInfo
Definition: X86.h:677
clang::targets::HaikuTargetInfo
Definition: OSTargets.h:290
clang::targets::WindowsX86_64TargetInfo::WindowsX86_64TargetInfo
WindowsX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:807
clang::CC_PreserveAll
@ CC_PreserveAll
Definition: Specifiers.h:284
clang::targets::MicrosoftX86_64TargetInfo::MicrosoftX86_64TargetInfo
MicrosoftX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:849
TargetOptions.h
clang::targets::OpenBSDI386TargetInfo::OpenBSDI386TargetInfo
OpenBSDI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:515
clang::targets::X86_32TargetInfo::getBuiltinVaListKind
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition: X86.h:452
llvm::ArrayRef< const char * >
clang::TargetInfo::CharPtrBuiltinVaList
@ CharPtrBuiltinVaList
typedef char* __builtin_va_list;
Definition: TargetInfo.h:291
BitmaskEnum.h
clang::targets::OpenBSDX86_64TargetInfo
Definition: X86.h:931
clang::targets::RTEMSX86_32TargetInfo::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
Definition: X86.h:686
clang::targets::DarwinX86_64TargetInfo::DarwinX86_64TargetInfo
DarwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:908
clang::CC_X86VectorCall
@ CC_X86VectorCall
Definition: Specifiers.h:271
clang::targets::AndroidX86_64TargetInfo
Definition: X86.h:954
clang::targets::MicrosoftX86_64TargetInfo
Definition: X86.h:846
clang::targets::X86TargetInfo::X86TargetInfo
X86TargetInfo(const llvm::Triple &Triple, const TargetOptions &)
Definition: X86.h:165
clang::targets::MicrosoftX86_64TargetInfo::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
Definition: X86.h:856
clang::TargetInfo::ConstraintInfo
Definition: TargetInfo.h:1026
clang::targets::HaikuX86_32TargetInfo
Definition: X86.h:636
clang::targets::OpenBSDX86_64TargetInfo::OpenBSDX86_64TargetInfo
OpenBSDX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:934
clang::targets::MCUX86_32TargetInfo::checkCallingConvention
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
Definition: X86.h:661
clang::LangOptions
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:81
clang::CC_IntelOclBicc
@ CC_IntelOclBicc
Definition: Specifiers.h:278
clang::targets::NetBSDI386TargetInfo
Definition: X86.h:496
clang::targets::X86TargetInfo::getPointerAlignV
uint64_t getPointerAlignV(unsigned AddrSpace) const override
Definition: X86.h:414
clang::targets::MicrosoftX86_64TargetInfo::getCallingConvKind
TargetInfo::CallingConvKind getCallingConvKind(bool ClangABICompat4) const override
Definition: X86.h:864
clang::targets::MicrosoftX86_32TargetInfo
Definition: X86.h:574
clang::targets::DarwinX86_64TargetInfo::handleTargetFeatures
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
handleTargetFeatures - Perform initialization based on the user configured set of features.
Definition: X86.h:919
clang
Definition: CalledOnceCheck.h:17
clang::LangAS::ptr64
@ ptr64
clang::FloatModeKind::Float
@ Float
clang::targets::LinuxTargetInfo
Definition: OSTargets.h:368
clang::LangAS::ptr32_uptr
@ ptr32_uptr
clang::CC_X86Pascal
@ CC_X86Pascal
Definition: Specifiers.h:272
clang::CC_X86RegCall
@ CC_X86RegCall
Definition: Specifiers.h:275
clang::targets::X86TargetInfo
Definition: X86.h:52
OSTargets.h
clang::CC_SwiftAsync
@ CC_SwiftAsync
Definition: Specifiers.h:282
clang::CC_PreserveMost
@ CC_PreserveMost
Definition: Specifiers.h:283
clang::targets::X86TargetInfo::validateOperandSize
virtual bool validateOperandSize(const llvm::StringMap< bool > &FeatureMap, StringRef Constraint, unsigned Size) const
Definition: X86.cpp:1477
unsigned
clang::targets::CygwinX86_32TargetInfo
Definition: X86.h:611
clang::targets::X86_64TargetInfo::X86_64TargetInfo
X86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:697
clang::targets::X86_32TargetInfo::X86_32TargetInfo
X86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:424
clang::targets::MCUX86_32TargetInfo::MCUX86_32TargetInfo
MCUX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:652
clang::TargetOptions
Options for controlling the target.
Definition: TargetOptions.h:26
clang::targets::X86_64TargetInfo::getDefaultCallingConv
CallingConv getDefaultCallingConv() const override
Gets the default calling convention for the given target and declaration context.
Definition: X86.h:767
clang::targets::X86TargetInfo::shouldEmitFloat16WithExcessPrecision
bool shouldEmitFloat16WithExcessPrecision() const override
Definition: X86.h:305
clang::targets::CygwinX86_32TargetInfo::CygwinX86_32TargetInfo
CygwinX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:613
llvm::SmallVectorImpl
Definition: Randstruct.h:18
clang::targets::X86TargetInfo::checkCallingConvention
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
Definition: X86.h:374
clang::CC_X86_64SysV
@ CC_X86_64SysV
Definition: Specifiers.h:274
clang::TargetInfo::CallingConvCheckResult
CallingConvCheckResult
Definition: TargetInfo.h:1541
clang::MacroBuilder
Definition: MacroBuilder.h:23
clang::targets::HaikuX86_32TargetInfo::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
Definition: X86.h:642
clang::TargetInfo::CallingConvKind
CallingConvKind
Definition: TargetInfo.h:1561
clang::targets::CygwinX86_32TargetInfo::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
Definition: X86.h:622
clang::targets::X86TargetInfo::getBFloat16Mangling
const char * getBFloat16Mangling() const override
Return the mangled code of bfloat.
Definition: X86.h:418
clang::targets::X86TargetInfo::FPMathKind
FPMathKind
Definition: X86.h:162
clang::targets::DarwinI386TargetInfo
Definition: X86.h:523
clang::LangAS::ptr32_sptr
@ ptr32_sptr
hasFeature
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:101
clang::targets::X86TargetInfo::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
X86TargetInfo::getTargetDefines - Return the set of the X86-specific macro definitions for this parti...
Definition: X86.cpp:415
clang::targets::X86_64TargetInfo::hasInt128Type
bool hasInt128Type() const override
Determine whether the __int128 type is supported on this target.
Definition: X86.h:772
clang::targets::X86TargetInfo::useFP16ConversionIntrinsics
bool useFP16ConversionIntrinsics() const override
Check whether llvm intrinsics such as llvm.convert.to.fp16 should be used to convert to and from __fp...
Definition: X86.h:301
clang::targets::X86_64TargetInfo::validateGlobalRegisterVariable
bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize, bool &HasSizeMismatch) const override
Validate register name used for global register variables.
Definition: X86.h:778
clang::targets::X86_32TargetInfo::validateOperandSize
bool validateOperandSize(const llvm::StringMap< bool > &FeatureMap, StringRef Constraint, unsigned Size) const override
Definition: X86.h:464