clang 20.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 bool HasMMX = false;
71 enum XOPEnum { NoXOP, SSE4A, FMA4, XOP } XOPLevel = NoXOP;
72 enum AddrSpace { ptr32_sptr = 270, ptr32_uptr = 271, ptr64 = 272 };
73
74 bool HasAES = false;
75 bool HasVAES = false;
76 bool HasPCLMUL = false;
77 bool HasVPCLMULQDQ = false;
78 bool HasGFNI = false;
79 bool HasLZCNT = false;
80 bool HasRDRND = false;
81 bool HasFSGSBASE = false;
82 bool HasBMI = false;
83 bool HasBMI2 = false;
84 bool HasPOPCNT = false;
85 bool HasRTM = false;
86 bool HasPRFCHW = false;
87 bool HasRDSEED = false;
88 bool HasADX = false;
89 bool HasTBM = false;
90 bool HasLWP = false;
91 bool HasFMA = false;
92 bool HasF16C = false;
93 bool HasAVX10_1 = false;
94 bool HasAVX10_1_512 = false;
95 bool HasAVX10_2 = false;
96 bool HasAVX10_2_512 = false;
97 bool HasEVEX512 = false;
98 bool HasAVX512CD = false;
99 bool HasAVX512VPOPCNTDQ = false;
100 bool HasAVX512VNNI = false;
101 bool HasAVX512FP16 = false;
102 bool HasAVX512BF16 = false;
103 bool HasAVX512DQ = false;
104 bool HasAVX512BITALG = false;
105 bool HasAVX512BW = false;
106 bool HasAVX512VL = false;
107 bool HasAVX512VBMI = false;
108 bool HasAVX512VBMI2 = false;
109 bool HasAVXIFMA = false;
110 bool HasAVX512IFMA = false;
111 bool HasAVX512VP2INTERSECT = false;
112 bool HasSHA = false;
113 bool HasSHA512 = false;
114 bool HasSHSTK = false;
115 bool HasSM3 = false;
116 bool HasSGX = false;
117 bool HasSM4 = false;
118 bool HasCX8 = false;
119 bool HasCX16 = false;
120 bool HasFXSR = false;
121 bool HasXSAVE = false;
122 bool HasXSAVEOPT = false;
123 bool HasXSAVEC = false;
124 bool HasXSAVES = false;
125 bool HasMWAITX = false;
126 bool HasCLZERO = false;
127 bool HasCLDEMOTE = false;
128 bool HasPCONFIG = false;
129 bool HasPKU = false;
130 bool HasCLFLUSHOPT = false;
131 bool HasCLWB = false;
132 bool HasMOVBE = false;
133 bool HasMOVRS = false;
134 bool HasPREFETCHI = false;
135 bool HasRDPID = false;
136 bool HasRDPRU = false;
137 bool HasRetpolineExternalThunk = false;
138 bool HasLAHFSAHF = false;
139 bool HasWBNOINVD = false;
140 bool HasWAITPKG = false;
141 bool HasMOVDIRI = false;
142 bool HasMOVDIR64B = false;
143 bool HasPTWRITE = false;
144 bool HasINVPCID = false;
145 bool HasENQCMD = false;
146 bool HasAVXVNNIINT16 = false;
147 bool HasAMXFP16 = false;
148 bool HasCMPCCXADD = false;
149 bool HasRAOINT = false;
150 bool HasAVXVNNIINT8 = false;
151 bool HasAVXNECONVERT = false;
152 bool HasKL = false; // For key locker
153 bool HasWIDEKL = false; // For wide key locker
154 bool HasHRESET = false;
155 bool HasAVXVNNI = false;
156 bool HasAMXTILE = false;
157 bool HasAMXINT8 = false;
158 bool HasAMXBF16 = false;
159 bool HasAMXCOMPLEX = false;
160 bool HasAMXFP8 = false;
161 bool HasAMXMOVRS = false;
162 bool HasAMXTRANSPOSE = 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) {
190 BFloat16Width = BFloat16Align = 16;
191 BFloat16Format = &llvm::APFloat::BFloat();
192 LongDoubleFormat = &llvm::APFloat::x87DoubleExtended();
193 AddrSpaceMap = &X86AddrSpaceMap;
194 HasStrictFP = true;
195 HasUnalignedAccess = true;
196
197 bool IsWinCOFF =
198 getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
199 if (IsWinCOFF)
200 MaxVectorAlign = MaxTLSAlign = 8192u * getCharWidth();
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
210 : LangOptions::FPEvalMethodKind::FEM_Source;
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;
272 return TargetInfo::checkCFProtectionReturnSupported(Diags);
273 };
274
275 bool
277 if (CPU == llvm::X86::CK_None || CPU >= llvm::X86::CK_PentiumPro)
278 return true;
279 return TargetInfo::checkCFProtectionBranchSupported(Diags);
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 uint64_t 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 case CC_OpenCLKernel:
409 return CCCR_OK;
410 case CC_SwiftAsync:
411 return CCCR_Error;
412 default:
413 return CCCR_Warning;
414 }
415 }
416
417 bool checkArithmeticFenceSupported() const override { return true; }
418
420 return CC_C;
421 }
422
423 bool hasSjLjLowering() const override { return true; }
424
425 void setSupportedOpenCLOpts() override { supportAllOpenCLOpts(); }
426
427 uint64_t getPointerWidthV(LangAS AS) const override {
428 unsigned TargetAddrSpace = getTargetAddressSpace(AS);
429 if (TargetAddrSpace == ptr32_sptr || TargetAddrSpace == ptr32_uptr)
430 return 32;
431 if (TargetAddrSpace == ptr64)
432 return 64;
433 return PointerWidth;
434 }
435
436 uint64_t getPointerAlignV(LangAS AddrSpace) const override {
437 return getPointerWidthV(AddrSpace);
438 }
439
440};
441
442// X86-32 generic target
443class LLVM_LIBRARY_VISIBILITY X86_32TargetInfo : public X86TargetInfo {
444public:
445 X86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
446 : X86TargetInfo(Triple, Opts) {
447 DoubleAlign = LongLongAlign = 32;
448 LongDoubleWidth = 96;
449 LongDoubleAlign = 32;
450 SuitableAlign = 128;
451 resetDataLayout(Triple.isOSBinFormatMachO()
452 ? "e-m:o-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 : "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:"
455 "128-f64:32:64-f80:32-n8:16:32-S128",
456 Triple.isOSBinFormatMachO() ? "_" : "");
457 SizeType = UnsignedInt;
458 PtrDiffType = SignedInt;
459 IntPtrType = SignedInt;
460 RegParmMax = 3;
461
462 // Use fpret for all types.
463 RealTypeUsesObjCFPRetMask =
464 (unsigned)(FloatModeKind::Float | FloatModeKind::Double |
465 FloatModeKind::LongDouble);
466
467 // x86-32 has atomics up to 8 bytes
468 MaxAtomicPromoteWidth = 64;
469 MaxAtomicInlineWidth = 32;
470 }
471
473 return TargetInfo::CharPtrBuiltinVaList;
474 }
475
476 int getEHDataRegisterNumber(unsigned RegNo) const override {
477 if (RegNo == 0)
478 return 0;
479 if (RegNo == 1)
480 return 2;
481 return -1;
482 }
483
484 bool validateOperandSize(const llvm::StringMap<bool> &FeatureMap,
485 StringRef Constraint, unsigned Size) const override {
486 switch (Constraint[0]) {
487 default:
488 break;
489 case 'R':
490 case 'q':
491 case 'Q':
492 case 'a':
493 case 'b':
494 case 'c':
495 case 'd':
496 case 'S':
497 case 'D':
498 return Size <= 32;
499 case 'A':
500 return Size <= 64;
501 }
502
503 return X86TargetInfo::validateOperandSize(FeatureMap, Constraint, Size);
504 }
505
506 void setMaxAtomicWidth() override {
507 if (hasFeature("cx8"))
508 MaxAtomicInlineWidth = 64;
509 }
510
511 ArrayRef<Builtin::Info> getTargetBuiltins() const override;
512
513 bool hasBitIntType() const override { return true; }
514 size_t getMaxBitIntWidth() const override {
515 return llvm::IntegerType::MAX_INT_BITS;
516 }
517};
518
519class LLVM_LIBRARY_VISIBILITY NetBSDI386TargetInfo
520 : public NetBSDTargetInfo<X86_32TargetInfo> {
521public:
522 NetBSDI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
523 : NetBSDTargetInfo<X86_32TargetInfo>(Triple, Opts) {}
524};
525
526class LLVM_LIBRARY_VISIBILITY OpenBSDI386TargetInfo
527 : public OpenBSDTargetInfo<X86_32TargetInfo> {
528public:
529 OpenBSDI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
530 : OpenBSDTargetInfo<X86_32TargetInfo>(Triple, Opts) {
531 SizeType = UnsignedLong;
532 IntPtrType = SignedLong;
533 PtrDiffType = SignedLong;
534 }
535};
536
537class LLVM_LIBRARY_VISIBILITY AppleMachOI386TargetInfo
538 : public AppleMachOTargetInfo<X86_32TargetInfo> {
539public:
540 AppleMachOI386TargetInfo(const llvm::Triple &Triple,
541 const TargetOptions &Opts)
542 : AppleMachOTargetInfo<X86_32TargetInfo>(Triple, Opts) {}
543};
544
545class LLVM_LIBRARY_VISIBILITY DarwinI386TargetInfo
546 : public DarwinTargetInfo<X86_32TargetInfo> {
547public:
548 DarwinI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
549 : DarwinTargetInfo<X86_32TargetInfo>(Triple, Opts) {
550 LongDoubleWidth = 128;
551 LongDoubleAlign = 128;
552 SuitableAlign = 128;
553 MaxVectorAlign = 256;
554 // The watchOS simulator uses the builtin bool type for Objective-C.
555 llvm::Triple T = llvm::Triple(Triple);
556 if (T.isWatchOS())
557 UseSignedCharForObjCBool = false;
558 SizeType = UnsignedLong;
559 IntPtrType = SignedLong;
560 resetDataLayout("e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-"
561 "f64:32:64-f80:128-n8:16:32-S128",
562 "_");
563 HasAlignMac68kSupport = true;
564 }
565
566 bool handleTargetFeatures(std::vector<std::string> &Features,
567 DiagnosticsEngine &Diags) override {
569 Diags))
570 return false;
571 // We now know the features we have: we can decide how to align vectors.
572 MaxVectorAlign =
573 hasFeature("avx512f") ? 512 : hasFeature("avx") ? 256 : 128;
574 return true;
575 }
576};
577
578// x86-32 Windows target
579class LLVM_LIBRARY_VISIBILITY WindowsX86_32TargetInfo
580 : public WindowsTargetInfo<X86_32TargetInfo> {
581public:
582 WindowsX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
583 : WindowsTargetInfo<X86_32TargetInfo>(Triple, Opts) {
584 DoubleAlign = LongLongAlign = 64;
585 bool IsWinCOFF =
586 getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
587 bool IsMSVC = getTriple().isWindowsMSVCEnvironment();
588 std::string Layout = IsWinCOFF ? "e-m:x" : "e-m:e";
589 Layout += "-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-";
590 Layout += IsMSVC ? "f80:128" : "f80:32";
591 Layout += "-n8:16:32-a:0:32-S32";
592 resetDataLayout(Layout, IsWinCOFF ? "_" : "");
593 }
594};
595
596// x86-32 Windows Visual Studio target
597class LLVM_LIBRARY_VISIBILITY MicrosoftX86_32TargetInfo
598 : public WindowsX86_32TargetInfo {
599public:
600 MicrosoftX86_32TargetInfo(const llvm::Triple &Triple,
601 const TargetOptions &Opts)
602 : WindowsX86_32TargetInfo(Triple, Opts) {
603 LongDoubleWidth = LongDoubleAlign = 64;
604 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
605 }
606
608 MacroBuilder &Builder) const override {
609 WindowsX86_32TargetInfo::getTargetDefines(Opts, Builder);
610 // The value of the following reflects processor type.
611 // 300=386, 400=486, 500=Pentium, 600=Blend (default)
612 // We lost the original triple, so we use the default.
613 Builder.defineMacro("_M_IX86", "600");
614 }
615};
616
617// x86-32 MinGW target
618class LLVM_LIBRARY_VISIBILITY MinGWX86_32TargetInfo
619 : public WindowsX86_32TargetInfo {
620public:
621 MinGWX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
622 : WindowsX86_32TargetInfo(Triple, Opts) {
623 HasFloat128 = true;
624 }
625
627 MacroBuilder &Builder) const override {
628 WindowsX86_32TargetInfo::getTargetDefines(Opts, Builder);
629 Builder.defineMacro("_X86_");
630 }
631};
632
633// x86-32 Cygwin target
634class LLVM_LIBRARY_VISIBILITY CygwinX86_32TargetInfo : public X86_32TargetInfo {
635public:
636 CygwinX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
637 : X86_32TargetInfo(Triple, Opts) {
638 this->WCharType = TargetInfo::UnsignedShort;
639 DoubleAlign = LongLongAlign = 64;
640 resetDataLayout("e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-"
641 "i128:128-f80:32-n8:16:32-a:0:32-S32",
642 "_");
643 }
644
646 MacroBuilder &Builder) const override {
647 X86_32TargetInfo::getTargetDefines(Opts, Builder);
648 Builder.defineMacro("_X86_");
649 Builder.defineMacro("__CYGWIN__");
650 Builder.defineMacro("__CYGWIN32__");
651 addCygMingDefines(Opts, Builder);
652 DefineStd(Builder, "unix", Opts);
653 if (Opts.CPlusPlus)
654 Builder.defineMacro("_GNU_SOURCE");
655 }
656};
657
658// x86-32 Haiku target
659class LLVM_LIBRARY_VISIBILITY HaikuX86_32TargetInfo
660 : public HaikuTargetInfo<X86_32TargetInfo> {
661public:
662 HaikuX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
663 : HaikuTargetInfo<X86_32TargetInfo>(Triple, Opts) {}
664
666 MacroBuilder &Builder) const override {
668 Builder.defineMacro("__INTEL__");
669 }
670};
671
672// X86-32 MCU target
673class LLVM_LIBRARY_VISIBILITY MCUX86_32TargetInfo : public X86_32TargetInfo {
674public:
675 MCUX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
676 : X86_32TargetInfo(Triple, Opts) {
677 LongDoubleWidth = 64;
678 DefaultAlignForAttributeAligned = 32;
679 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
680 resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:32-"
681 "f64:32-f128:32-n8:16:32-a:0:32-S32");
682 WIntType = UnsignedInt;
683 }
684
686 // On MCU we support only C calling convention.
687 return CC == CC_C ? CCCR_OK : CCCR_Warning;
688 }
689
691 MacroBuilder &Builder) const override {
692 X86_32TargetInfo::getTargetDefines(Opts, Builder);
693 Builder.defineMacro("__iamcu");
694 Builder.defineMacro("__iamcu__");
695 }
696
697 bool allowsLargerPreferedTypeAlignment() const override { return false; }
698};
699
700// x86-32 RTEMS target
701class LLVM_LIBRARY_VISIBILITY RTEMSX86_32TargetInfo : public X86_32TargetInfo {
702public:
703 RTEMSX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
704 : X86_32TargetInfo(Triple, Opts) {
705 SizeType = UnsignedLong;
706 IntPtrType = SignedLong;
707 PtrDiffType = SignedLong;
708 }
709
711 MacroBuilder &Builder) const override {
712 X86_32TargetInfo::getTargetDefines(Opts, Builder);
713 Builder.defineMacro("__INTEL__");
714 Builder.defineMacro("__rtems__");
715 }
716};
717
718// x86-64 generic target
719class LLVM_LIBRARY_VISIBILITY X86_64TargetInfo : public X86TargetInfo {
720public:
721 X86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
722 : X86TargetInfo(Triple, Opts) {
723 const bool IsX32 = getTriple().isX32();
724 bool IsWinCOFF =
725 getTriple().isOSWindows() && getTriple().isOSBinFormatCOFF();
726 LongWidth = LongAlign = PointerWidth = PointerAlign = IsX32 ? 32 : 64;
727 LongDoubleWidth = 128;
728 LongDoubleAlign = 128;
729 LargeArrayMinWidth = 128;
730 LargeArrayAlign = 128;
731 SuitableAlign = 128;
732 SizeType = IsX32 ? UnsignedInt : UnsignedLong;
733 PtrDiffType = IsX32 ? SignedInt : SignedLong;
734 IntPtrType = IsX32 ? SignedInt : SignedLong;
735 IntMaxType = IsX32 ? SignedLongLong : SignedLong;
736 Int64Type = IsX32 ? SignedLongLong : SignedLong;
737 RegParmMax = 6;
738
739 // Pointers are 32-bit in x32.
740 resetDataLayout(IsX32 ? "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-"
741 "i64:64-i128:128-f80:128-n8:16:32:64-S128"
742 : IsWinCOFF ? "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:"
743 "64-i128:128-f80:128-n8:16:32:64-S128"
744 : "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:"
745 "64-i128:128-f80:128-n8:16:32:64-S128");
746
747 // Use fpret only for long double.
748 RealTypeUsesObjCFPRetMask = (unsigned)FloatModeKind::LongDouble;
749
750 // Use fp2ret for _Complex long double.
751 ComplexLongDoubleUsesFP2Ret = true;
752
753 // Make __builtin_ms_va_list available.
754 HasBuiltinMSVaList = true;
755
756 // x86-64 has atomics up to 16 bytes.
757 MaxAtomicPromoteWidth = 128;
758 MaxAtomicInlineWidth = 64;
759 }
760
762 return TargetInfo::X86_64ABIBuiltinVaList;
763 }
764
765 int getEHDataRegisterNumber(unsigned RegNo) const override {
766 if (RegNo == 0)
767 return 0;
768 if (RegNo == 1)
769 return 1;
770 return -1;
771 }
772
774 switch (CC) {
775 case CC_C:
776 case CC_Swift:
777 case CC_SwiftAsync:
778 case CC_X86VectorCall:
779 case CC_IntelOclBicc:
780 case CC_Win64:
781 case CC_PreserveMost:
782 case CC_PreserveAll:
783 case CC_PreserveNone:
784 case CC_X86RegCall:
785 case CC_OpenCLKernel:
786 return CCCR_OK;
787 default:
788 return CCCR_Warning;
789 }
790 }
791
793 return CC_C;
794 }
795
796 // for x32 we need it here explicitly
797 bool hasInt128Type() const override { return true; }
798
799 unsigned getUnwindWordWidth() const override { return 64; }
800
801 unsigned getRegisterWidth() const override { return 64; }
802
803 bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize,
804 bool &HasSizeMismatch) const override {
805 // rsp and rbp are the only 64-bit registers the x86 backend can currently
806 // handle.
807 if (RegName == "rsp" || RegName == "rbp") {
808 // Check that the register size is 64-bit.
809 HasSizeMismatch = RegSize != 64;
810 return true;
811 }
812
813 // Check if the register is a 32-bit register the backend can handle.
814 return X86TargetInfo::validateGlobalRegisterVariable(RegName, RegSize,
815 HasSizeMismatch);
816 }
817
818 void setMaxAtomicWidth() override {
819 if (hasFeature("cx16"))
820 MaxAtomicInlineWidth = 128;
821 }
822
823 ArrayRef<Builtin::Info> getTargetBuiltins() const override;
824
825 bool hasBitIntType() const override { return true; }
826 size_t getMaxBitIntWidth() const override {
827 return llvm::IntegerType::MAX_INT_BITS;
828 }
829};
830
831// x86-64 UEFI target
832class LLVM_LIBRARY_VISIBILITY UEFIX86_64TargetInfo
833 : public UEFITargetInfo<X86_64TargetInfo> {
834public:
835 UEFIX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
836 : UEFITargetInfo<X86_64TargetInfo>(Triple, Opts) {
837 this->TheCXXABI.set(TargetCXXABI::Microsoft);
838 this->MaxTLSAlign = 8192u * this->getCharWidth();
839 this->resetDataLayout("e-m:w-p270:32:32-p271:32:32-p272:64:64-"
840 "i64:64-i128:128-f80:128-n8:16:32:64-S128");
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_C:
850 case CC_Win64:
851 return CCCR_OK;
852 default:
853 return CCCR_Warning;
854 }
855 }
856
858 getCallingConvKind(bool ClangABICompat4) const override {
859 return CCK_MicrosoftWin64;
860 }
861};
862
863// x86-64 Windows target
864class LLVM_LIBRARY_VISIBILITY WindowsX86_64TargetInfo
865 : public WindowsTargetInfo<X86_64TargetInfo> {
866public:
867 WindowsX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
868 : WindowsTargetInfo<X86_64TargetInfo>(Triple, Opts) {
869 LongWidth = LongAlign = 32;
870 DoubleAlign = LongLongAlign = 64;
871 IntMaxType = SignedLongLong;
872 Int64Type = SignedLongLong;
873 SizeType = UnsignedLongLong;
874 PtrDiffType = SignedLongLong;
875 IntPtrType = SignedLongLong;
876 }
877
878 BuiltinVaListKind getBuiltinVaListKind() const override {
879 return TargetInfo::CharPtrBuiltinVaList;
880 }
881
882 CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {
883 switch (CC) {
884 case CC_X86StdCall:
885 case CC_X86ThisCall:
886 case CC_X86FastCall:
887 return CCCR_Ignore;
888 case CC_C:
889 case CC_X86VectorCall:
890 case CC_IntelOclBicc:
891 case CC_PreserveMost:
892 case CC_PreserveAll:
893 case CC_PreserveNone:
894 case CC_X86_64SysV:
895 case CC_Swift:
896 case CC_SwiftAsync:
897 case CC_X86RegCall:
898 case CC_OpenCLKernel:
899 return CCCR_OK;
900 default:
901 return CCCR_Warning;
902 }
903 }
904};
905
906// x86-64 Windows Visual Studio target
907class LLVM_LIBRARY_VISIBILITY MicrosoftX86_64TargetInfo
908 : public WindowsX86_64TargetInfo {
909public:
910 MicrosoftX86_64TargetInfo(const llvm::Triple &Triple,
911 const TargetOptions &Opts)
912 : WindowsX86_64TargetInfo(Triple, Opts) {
913 LongDoubleWidth = LongDoubleAlign = 64;
914 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
915 }
916
918 MacroBuilder &Builder) const override {
919 WindowsX86_64TargetInfo::getTargetDefines(Opts, Builder);
920 Builder.defineMacro("_M_X64", "100");
921 Builder.defineMacro("_M_AMD64", "100");
922 }
923
925 getCallingConvKind(bool ClangABICompat4) const override {
926 return CCK_MicrosoftWin64;
927 }
928};
929
930// x86-64 MinGW target
931class LLVM_LIBRARY_VISIBILITY MinGWX86_64TargetInfo
932 : public WindowsX86_64TargetInfo {
933public:
934 MinGWX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
935 : WindowsX86_64TargetInfo(Triple, Opts) {
936 // Mingw64 rounds long double size and alignment up to 16 bytes, but sticks
937 // with x86 FP ops. Weird.
938 LongDoubleWidth = LongDoubleAlign = 128;
939 LongDoubleFormat = &llvm::APFloat::x87DoubleExtended();
940 HasFloat128 = true;
941 }
942};
943
944// x86-64 Cygwin target
945class LLVM_LIBRARY_VISIBILITY CygwinX86_64TargetInfo : public X86_64TargetInfo {
946public:
947 CygwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
948 : X86_64TargetInfo(Triple, Opts) {
949 this->WCharType = TargetInfo::UnsignedShort;
950 TLSSupported = false;
951 }
952
954 MacroBuilder &Builder) const override {
955 X86_64TargetInfo::getTargetDefines(Opts, Builder);
956 Builder.defineMacro("__x86_64__");
957 Builder.defineMacro("__CYGWIN__");
958 Builder.defineMacro("__CYGWIN64__");
959 addCygMingDefines(Opts, Builder);
960 DefineStd(Builder, "unix", Opts);
961 if (Opts.CPlusPlus)
962 Builder.defineMacro("_GNU_SOURCE");
963 }
964};
965
966class LLVM_LIBRARY_VISIBILITY DarwinX86_64TargetInfo
967 : public DarwinTargetInfo<X86_64TargetInfo> {
968public:
969 DarwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
970 : DarwinTargetInfo<X86_64TargetInfo>(Triple, Opts) {
971 Int64Type = SignedLongLong;
972 // The 64-bit iOS simulator uses the builtin bool type for Objective-C.
973 llvm::Triple T = llvm::Triple(Triple);
974 if (T.isiOS())
975 UseSignedCharForObjCBool = false;
976 resetDataLayout("e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-"
977 "f80:128-n8:16:32:64-S128",
978 "_");
979 }
980
981 bool handleTargetFeatures(std::vector<std::string> &Features,
982 DiagnosticsEngine &Diags) override {
984 Diags))
985 return false;
986 // We now know the features we have: we can decide how to align vectors.
987 MaxVectorAlign =
988 hasFeature("avx512f") ? 512 : hasFeature("avx") ? 256 : 128;
989 return true;
990 }
991};
992
993class LLVM_LIBRARY_VISIBILITY OpenBSDX86_64TargetInfo
994 : public OpenBSDTargetInfo<X86_64TargetInfo> {
995public:
996 OpenBSDX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
997 : OpenBSDTargetInfo<X86_64TargetInfo>(Triple, Opts) {
998 IntMaxType = SignedLongLong;
999 Int64Type = SignedLongLong;
1000 }
1001};
1002
1003// x86_32 Android target
1004class LLVM_LIBRARY_VISIBILITY AndroidX86_32TargetInfo
1005 : public LinuxTargetInfo<X86_32TargetInfo> {
1006public:
1007 AndroidX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
1008 : LinuxTargetInfo<X86_32TargetInfo>(Triple, Opts) {
1009 SuitableAlign = 32;
1010 LongDoubleWidth = 64;
1011 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
1012 }
1013};
1014
1015// x86_64 Android target
1016class LLVM_LIBRARY_VISIBILITY AndroidX86_64TargetInfo
1017 : public LinuxTargetInfo<X86_64TargetInfo> {
1018public:
1019 AndroidX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
1020 : LinuxTargetInfo<X86_64TargetInfo>(Triple, Opts) {
1021 LongDoubleFormat = &llvm::APFloat::IEEEquad();
1022 }
1023};
1024
1025// x86_32 OHOS target
1026class LLVM_LIBRARY_VISIBILITY OHOSX86_32TargetInfo
1027 : public OHOSTargetInfo<X86_32TargetInfo> {
1028public:
1029 OHOSX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
1030 : OHOSTargetInfo<X86_32TargetInfo>(Triple, Opts) {
1031 SuitableAlign = 32;
1032 LongDoubleWidth = 64;
1033 LongDoubleFormat = &llvm::APFloat::IEEEdouble();
1034 }
1035};
1036
1037// x86_64 OHOS target
1038class LLVM_LIBRARY_VISIBILITY OHOSX86_64TargetInfo
1039 : public OHOSTargetInfo<X86_64TargetInfo> {
1040public:
1041 OHOSX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
1042 : OHOSTargetInfo<X86_64TargetInfo>(Triple, Opts) {
1043 LongDoubleFormat = &llvm::APFloat::IEEEquad();
1044 }
1045};
1046} // namespace targets
1047} // namespace clang
1048#endif // LLVM_CLANG_LIB_BASIC_TARGETS_X86_H
Provides LLVM's BitmaskEnum facility to enumeration types declared in namespace clang.
Expr * E
static uint64_t 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:96
Defines the clang::TargetOptions class.
Concrete class used by the front-end to report problems and issues.
Definition: Diagnostic.h:231
FPEvalMethodKind
Possible float expression evaluation method choices.
Definition: LangOptions.h:299
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:499
Exposes information about the current target.
Definition: TargetInfo.h:220
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition: TargetInfo.h:318
Options for controlling the target.
Definition: TargetOptions.h:26
AndroidX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:1007
AndroidX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:1019
AppleMachOI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:540
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:645
CygwinX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:636
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:953
CygwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:947
DarwinI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:548
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
Definition: X86.h:566
DarwinX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:969
bool handleTargetFeatures(std::vector< std::string > &Features, DiagnosticsEngine &Diags) override
Definition: X86.h:981
HaikuX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:662
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
Definition: X86.h:665
MCUX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:675
bool allowsLargerPreferedTypeAlignment() const override
Whether target allows to overalign ABI-specified preferred alignment.
Definition: X86.h:697
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:690
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
Definition: X86.h:685
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
Definition: X86.h:607
MicrosoftX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:600
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
Definition: X86.h:917
TargetInfo::CallingConvKind getCallingConvKind(bool ClangABICompat4) const override
Definition: X86.h:925
MicrosoftX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:910
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
Definition: X86.h:626
MinGWX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:621
MinGWX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:934
NetBSDI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:522
OHOSX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:1029
OHOSX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:1041
OpenBSDI386TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:529
OpenBSDX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:996
RTEMSX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:703
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:710
UEFIX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:835
BuiltinVaListKind getBuiltinVaListKind() const override
Definition: X86.h:843
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Definition: X86.h:847
TargetInfo::CallingConvKind getCallingConvKind(bool ClangABICompat4) const override
Definition: X86.h:858
WindowsX86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:582
WindowsX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:867
BuiltinVaListKind getBuiltinVaListKind() const override
Definition: X86.h:878
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Definition: X86.h:882
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 and declaration context.
Definition: X86.h:419
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:423
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:427
void setSupportedOpenCLOpts() override
Set supported OpenCL extensions and optional core features.
Definition: X86.h:425
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
bool checkArithmeticFenceSupported() const override
Controls if __arithmetic_fence is supported in the targeted backend.
Definition: X86.h:417
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
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
Definition: X86.h:218
uint64_t getPointerAlignV(LangAS AddrSpace) const override
Definition: X86.h:436
X86_32TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:445
size_t getMaxBitIntWidth() const override
Definition: X86.h:514
void setMaxAtomicWidth() override
Set the maximum inline or promote width lock-free atomic operation for the given target.
Definition: X86.h:506
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
Definition: X86.h:476
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
Definition: X86.h:513
bool validateOperandSize(const llvm::StringMap< bool > &FeatureMap, StringRef Constraint, unsigned Size) const override
Definition: X86.h:484
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition: X86.h:472
bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize, bool &HasSizeMismatch) const override
Validate register name used for global register variables.
Definition: X86.h:803
bool hasInt128Type() const override
Determine whether the __int128 type is supported on this target.
Definition: X86.h:797
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
Definition: X86.h:773
CallingConv getDefaultCallingConv() const override
Gets the default calling convention for the given target and declaration context.
Definition: X86.h:792
bool hasBitIntType() const override
Determine whether the _BitInt type is supported on this target.
Definition: X86.h:825
int getEHDataRegisterNumber(unsigned RegNo) const override
Return the register number that __builtin_eh_return_regno would return with the specified argument.
Definition: X86.h:765
void setMaxAtomicWidth() override
Set the maximum inline or promote width lock-free atomic operation for the given target.
Definition: X86.h:818
size_t getMaxBitIntWidth() const override
Definition: X86.h:826
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition: X86.h:761
X86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: X86.h:721
unsigned getUnwindWordWidth() const override
Definition: X86.h:799
unsigned getRegisterWidth() const override
Return the "preferred" register width on this target.
Definition: X86.h:801
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:83
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.
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:278
@ CC_X86Pascal
Definition: Specifiers.h:284
@ CC_Swift
Definition: Specifiers.h:293
@ CC_IntelOclBicc
Definition: Specifiers.h:290
@ CC_OpenCLKernel
Definition: Specifiers.h:292
@ CC_PreserveMost
Definition: Specifiers.h:295
@ CC_Win64
Definition: Specifiers.h:285
@ CC_X86ThisCall
Definition: Specifiers.h:282
@ CC_PreserveNone
Definition: Specifiers.h:301
@ CC_C
Definition: Specifiers.h:279
@ 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