Line data Source code
1 : /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2 : |* *|
3 : |* Intrinsic Function Source Fragment *|
4 : |* *|
5 : |* Automatically generated file, do not edit! *|
6 : |* *|
7 : \*===----------------------------------------------------------------------===*/
8 :
9 : // VisualStudio defines setjmp as _setjmp
10 : #if defined(_MSC_VER) && defined(setjmp) && \
11 : !defined(setjmp_undefined_for_msvc)
12 : # pragma push_macro("setjmp")
13 : # undef setjmp
14 : # define setjmp_undefined_for_msvc
15 : #endif
16 :
17 : // Target mapping
18 : #ifdef GET_INTRINSIC_TARGET_DATA
19 : struct IntrinsicTargetInfo {
20 : llvm::StringLiteral Name;
21 : size_t Offset;
22 : size_t Count;
23 : };
24 : static constexpr IntrinsicTargetInfo TargetInfos[] = {
25 : {llvm::StringLiteral(""), 0, 0},
26 : {llvm::StringLiteral("AMDGPU"), 0, 1},
27 : {llvm::StringLiteral("SI"), 1, 3},
28 : };
29 : #endif
30 :
31 : // Intrinsic ID to name table
32 : #ifdef GET_INTRINSIC_NAME_TABLE
33 : // Note that entry #0 is the invalid intrinsic!
34 : "llvm.AMDGPU.kill",
35 : "llvm.SI.buffer.load.dword",
36 : "llvm.SI.load.const",
37 : "llvm.SI.tbuffer.store",
38 : #endif
39 :
40 : // Intrinsic ID to overload bitset
41 : #ifdef GET_INTRINSIC_OVERLOAD_TABLE
42 : static const uint8_t OTable[] = {
43 : 0 | (1<<2) | (1<<3) | (1<<4)
44 : };
45 :
46 527 : return (OTable[id/8] & (1 << (id%8))) != 0;
47 : #endif
48 :
49 : // Global intrinsic function declaration type table.
50 : #ifdef GET_INTRINSIC_GENERATOR_GLOBAL
51 : static const unsigned IIT_Table[] = {
52 : 0x70, (1U<<31) | 17, 0x41f7, (1U<<31) | 0, 0
53 : };
54 :
55 : static const unsigned char IIT_LongEncodingTable[] = {
56 : /* 0 */ 0, 15, 1, 15, 9, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0,
57 : /* 17 */ 15, 1, 15, 9, 15, 17, 4, 4, 4, 4, 4, 4, 4, 0,
58 : 255
59 : };
60 :
61 : #endif
62 :
63 : // Add parameter attributes that are not common to all intrinsics.
64 : #ifdef GET_INTRINSIC_ATTRIBUTES
65 0 : static AttributeList getAttributes(LLVMContext &C, AMDGPUIntrinsic::ID id) {
66 : static const uint8_t IntrinsicsToAttributesMap[] = {
67 : 1, // llvm.AMDGPU.kill
68 : 2, // llvm.SI.buffer.load.dword
69 : 3, // llvm.SI.load.const
70 : 1, // llvm.SI.tbuffer.store
71 : };
72 :
73 0 : AttributeList AS[1];
74 : unsigned NumAttrs = 0;
75 0 : if (id != 0) {
76 0 : switch(IntrinsicsToAttributesMap[id - Intrinsic::num_intrinsics]) {
77 0 : default: llvm_unreachable("Invalid attribute number");
78 0 : case 1: {
79 0 : const Attribute::AttrKind Atts[] = {Attribute::NoUnwind};
80 0 : AS[0] = AttributeList::get(C, AttributeList::FunctionIndex, Atts);
81 : NumAttrs = 1;
82 : break;
83 : }
84 0 : case 2: {
85 0 : const Attribute::AttrKind Atts[] = {Attribute::NoUnwind,Attribute::ReadOnly,Attribute::ArgMemOnly};
86 0 : AS[0] = AttributeList::get(C, AttributeList::FunctionIndex, Atts);
87 : NumAttrs = 1;
88 : break;
89 : }
90 0 : case 3: {
91 0 : const Attribute::AttrKind Atts[] = {Attribute::NoUnwind,Attribute::ReadNone};
92 0 : AS[0] = AttributeList::get(C, AttributeList::FunctionIndex, Atts);
93 : NumAttrs = 1;
94 : break;
95 : }
96 : }
97 : }
98 0 : return AttributeList::get(C, makeArrayRef(AS, NumAttrs));
99 : }
100 : #endif // GET_INTRINSIC_ATTRIBUTES
101 :
102 : // Get the LLVM intrinsic that corresponds to a builtin.
103 : // This is used by the C front-end. The builtin name is passed
104 : // in as BuiltinName, and a target prefix (e.g. 'ppc') is passed
105 : // in as TargetPrefix. The result is assigned to 'IntrinsicID'.
106 : #ifdef GET_LLVM_INTRINSIC_FOR_GCC_BUILTIN
107 : static AMDGPUIntrinsic::ID getIntrinsicForGCCBuiltin(const char *TargetPrefixStr, StringRef BuiltinNameStr) {
108 : return (AMDGPUIntrinsic::ID)Intrinsic::not_intrinsic;
109 : }
110 : #endif
111 :
112 : // Get the LLVM intrinsic that corresponds to a builtin.
113 : // This is used by the C front-end. The builtin name is passed
114 : // in as BuiltinName, and a target prefix (e.g. 'ppc') is passed
115 : // in as TargetPrefix. The result is assigned to 'IntrinsicID'.
116 : #ifdef GET_LLVM_INTRINSIC_FOR_MS_BUILTIN
117 : static AMDGPUIntrinsic::ID getIntrinsicForMSBuiltin(const char *TargetPrefixStr, StringRef BuiltinNameStr) {
118 : return (AMDGPUIntrinsic::ID)Intrinsic::not_intrinsic;
119 : }
120 : #endif
121 :
122 : #if defined(_MSC_VER) && defined(setjmp_undefined_for_msvc)
123 : // let's return it to _setjmp state
124 : # pragma pop_macro("setjmp")
125 : # undef setjmp_undefined_for_msvc
126 : #endif
127 :
|