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