Revert "include/llvm: Add R600 Intrinsics v6"
[oota-llvm.git] / lib / Target / AMDGPU / AMDILProfiles.td
1 //===- AMDILProfiles.td - AMD IL Profiles ------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //==-----------------------------------------------------------------------===//
9 // These are used for custom selection dag type profiles
10
11 //===----------------------------------------------------------------------===//
12 // Custom Selection DAG Type Profiles
13 //===----------------------------------------------------------------------===//
14 // SDTCisDP - The specified operand has double type
15 // Tablegen needs to be hacked to get this constraint to work
16 //class SDTCisDP<int OpNum> : SDTypeConstraint<OpNum>;
17
18 //===----------------------------------------------------------------------===//
19 // Generic Profile Types
20 //===----------------------------------------------------------------------===//
21
22 def SDTIL_GenUnaryOp : SDTypeProfile<1, 1, [
23     SDTCisSameAs<0, 1>
24     ]>;
25 def SDTIL_GenBinaryOp : SDTypeProfile<1, 2, [
26     SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>
27     ]>;
28 def SDTIL_GenTernaryOp : SDTypeProfile<1, 3, [
29     SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>, SDTCisSameAs<2, 3>
30     ]>;
31 def SDTIL_GenCMovLog : SDTypeProfile<1, 3, [
32     SDTCisSameAs<0, 2>, SDTCisSameAs<2, 3>, SDTCisInt<1>
33     ]>;
34 def SDTIL_GenVecBuild : SDTypeProfile<1, 1, [
35     SDTCisEltOfVec<1, 0>
36     ]>;
37
38 def SDTIL_GenVecExtract : SDTypeProfile<1, 2, [
39     SDTCisEltOfVec<0, 1>, SDTCisVT<2, i32>
40     ]>;
41
42 def SDTIL_GenVecInsert : SDTypeProfile<1, 4, [
43     SDTCisEltOfVec<2, 1>, SDTCisSameAs<0, 1>,
44     SDTCisVT<3, i32>, SDTCisVT<4, i32>
45     ]>;
46
47 def SDTIL_GenVecShuffle : SDTypeProfile <1, 2, [
48     SDTCisSameAs<0, 1>, SDTCisVT<2, i32>
49     ]>;
50
51 def SDTIL_GenVecConcat : SDTypeProfile <1, 2, [
52     SDTCisSameAs<1, 2>
53     ]>;
54 //===----------------------------------------------------------------------===//
55 // Conversion Profile Types
56 //===----------------------------------------------------------------------===//
57 def SDTIL_DPToFPOp : SDTypeProfile<1, 1, [
58     SDTCisFP<0>, SDTCisFP<1>, SDTCisOpSmallerThanOp<0, 1>
59     ]>; // d2f
60
61 def SDTIL_AnyToInt : SDTypeProfile<1, 1, [
62     SDTCisInt<0>
63     ]>;
64 def SDTIL_IntToAny : SDTypeProfile<1, 1, [
65     SDTCisInt<1>
66     ]>;
67 def SDTIL_GenBitConv : SDTypeProfile<1, 1, []>;
68 //===----------------------------------------------------------------------===//
69 // Scalar Profile Types
70 //===----------------------------------------------------------------------===//
71
72 // Add instruction pattern to handle offsets of memory operationns
73 def SDTIL_AddAddrri: SDTypeProfile<1, 2, [
74     SDTCisInt<0>, SDTCisPtrTy<1>, SDTCisSameAs<0, 2>
75     ]>;
76 def SDTIL_AddAddrir : SDTypeProfile<1, 2, [
77     SDTCisInt<0>, SDTCisPtrTy<2>, SDTCisSameAs<0, 1>
78     ]>;
79
80 def SDTIL_LCreate : SDTypeProfile<1, 2, [
81     SDTCisVT<0, i64>, SDTCisVT<1, i32>, SDTCisSameAs<1, 2>
82     ]>;
83 def SDTIL_LCreate2 : SDTypeProfile<1, 2, [
84     SDTCisVT<0, v2i64>, SDTCisVT<1, v2i32>, SDTCisSameAs<1, 2>
85     ]>;
86 def SDTIL_LComp : SDTypeProfile<1, 1, [
87     SDTCisVT<0, i32>, SDTCisVT<1, i64>
88     ]>;
89 def SDTIL_LComp2 : SDTypeProfile<1, 1, [
90     SDTCisVT<0, v2i32>, SDTCisVT<1, v2i64>
91     ]>;
92 def SDTIL_DCreate : SDTypeProfile<1, 2, [
93     SDTCisVT<0, f64>, SDTCisVT<1, i32>, SDTCisSameAs<1, 2>
94     ]>;
95 def SDTIL_DComp : SDTypeProfile<1, 1, [
96     SDTCisVT<0, i32>, SDTCisVT<1, f64>
97     ]>;
98 def SDTIL_DCreate2 : SDTypeProfile<1, 2, [
99     SDTCisVT<0, v2f64>, SDTCisVT<1, v2i32>, SDTCisSameAs<1, 2>
100     ]>;
101 def SDTIL_DComp2 : SDTypeProfile<1, 1, [
102     SDTCisVT<0, v2i32>, SDTCisVT<1, v2f64>
103     ]>;
104 //===----------------------------------------------------------------------===//
105 // Flow Control Profile Types
106 //===----------------------------------------------------------------------===//
107 // Profile for Normal Call
108 def SDTIL_Call : SDTypeProfile<0, 1, [
109     SDTCisVT<0, i32>
110     ]>;
111 // Branch instruction where second and third are basic blocks
112 def SDTIL_BRCond : SDTypeProfile<0, 2, [
113     SDTCisVT<0, OtherVT>
114     ]>;
115 // Comparison instruction
116 def SDTIL_Cmp  : SDTypeProfile<1, 3, [
117     SDTCisSameAs<0, 2>, SDTCisSameAs<2,3>, SDTCisVT<1, i32>
118     ]>;
119
120
121 //===----------------------------------------------------------------------===//
122 // Call Sequence Profiles
123 //===----------------------------------------------------------------------===//
124 def SDTIL_CallSeqStart  : SDCallSeqStart< [
125     SDTCisVT<0, i32>
126     ]>;
127 def SDTIL_CallSeqEnd    : SDCallSeqEnd< [
128     SDTCisVT<0, i32>, SDTCisVT<1, i32>
129     ]>;
130
131 //===----------------------------------------------------------------------===//
132 // Image Operation Profiles
133 //===----------------------------------------------------------------------===//
134 def SDTIL_ImageRead  : SDTypeProfile<1, 3, 
135     [SDTCisVT<0, v4i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>, SDTCisVT<3, v4f32>]>;
136 def SDTIL_ImageWrite : SDTypeProfile<0, 3,
137     [SDTCisPtrTy<0>, SDTCisVT<1, v2i32>, SDTCisVT<2, v4i32>]>;
138 def SDTIL_ImageWrite3D : SDTypeProfile<0, 3,
139     [SDTCisPtrTy<0>, SDTCisVT<1, v4i32>, SDTCisVT<2, v4i32>]>;
140 def SDTIL_ImageInfo  : SDTypeProfile<1, 1,
141     [SDTCisVT<0, v4i32>, SDTCisPtrTy<1>]>;
142 //===----------------------------------------------------------------------===//
143 // Atomic Operation Profiles
144 //===----------------------------------------------------------------------===//
145 def SDTIL_UniAtomNoRet : SDTypeProfile<0, 2, [
146     SDTCisPtrTy<0>, SDTCisVT<1, i32>
147     ]>;
148 def SDTIL_BinAtomNoRet : SDTypeProfile<0, 3, [
149     SDTCisPtrTy<0>, SDTCisVT<1, i32>, SDTCisVT<2, i32>
150     ]>;
151 def SDTIL_TriAtomNoRet : SDTypeProfile<0, 4, [
152     SDTCisPtrTy<0>, SDTCisVT<1, i32>, SDTCisVT<2, i32>, SDTCisVT<3, i32>
153     ]>;
154 def SDTIL_UniAtom : SDTypeProfile<1, 2, [
155     SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>
156     ]>;
157 def SDTIL_BinAtom : SDTypeProfile<1, 3, [
158     SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>, SDTCisVT<3, i32>
159     ]>;
160 def SDTIL_TriAtom : SDTypeProfile<1, 4, [
161     SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>,
162     SDTCisVT<3, i32>, SDTCisVT<4, i32>
163     ]>;
164
165 def SDTIL_BinAtomFloat : SDTypeProfile<1, 3, [
166     SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, f32>, SDTCisVT<3, f32>
167     ]>;
168 def SDTIL_BinAtomNoRetFloat : SDTypeProfile<0, 3, [
169     SDTCisPtrTy<0>, SDTCisVT<1, f32>, SDTCisVT<2, f32>
170     ]>;
171
172 def SDTIL_Append : SDTypeProfile<1, 1, [
173     SDTCisVT<0, i32>, SDTCisPtrTy<1>
174     ]>;