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