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