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