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