aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/AMDILProfiles.td
blob: 60435a82b66448341509aa01eedca915170a9b32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
//===- AMDILProfiles.td - AMD IL Profiles ------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//==-----------------------------------------------------------------------===//
// These are used for custom selection dag type profiles

//===----------------------------------------------------------------------===//
// Custom Selection DAG Type Profiles
//===----------------------------------------------------------------------===//
// SDTCisDP - The specified operand has double type
// Tablegen needs to be hacked to get this constraint to work
//class SDTCisDP<int OpNum> : SDTypeConstraint<OpNum>;

//===----------------------------------------------------------------------===//
// Generic Profile Types
//===----------------------------------------------------------------------===//

def SDTIL_GenUnaryOp : SDTypeProfile<1, 1, [
    SDTCisSameAs<0, 1>
    ]>;
def SDTIL_GenBinaryOp : SDTypeProfile<1, 2, [
    SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>
    ]>;
def SDTIL_GenTernaryOp : SDTypeProfile<1, 3, [
    SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>, SDTCisSameAs<2, 3>
    ]>;
def SDTIL_GenCMovLog : SDTypeProfile<1, 3, [
    SDTCisSameAs<0, 2>, SDTCisSameAs<2, 3>, SDTCisInt<1>
    ]>;
def SDTIL_GenVecBuild : SDTypeProfile<1, 1, [
    SDTCisEltOfVec<1, 0>
    ]>;

def SDTIL_GenVecExtract : SDTypeProfile<1, 2, [
    SDTCisEltOfVec<0, 1>, SDTCisVT<2, i32>
    ]>;

def SDTIL_GenVecInsert : SDTypeProfile<1, 4, [
    SDTCisEltOfVec<2, 1>, SDTCisSameAs<0, 1>,
    SDTCisVT<3, i32>, SDTCisVT<4, i32>
    ]>;

def SDTIL_GenVecShuffle : SDTypeProfile <1, 2, [
    SDTCisSameAs<0, 1>, SDTCisVT<2, i32>
    ]>;

def SDTIL_GenVecConcat : SDTypeProfile <1, 2, [
    SDTCisSameAs<1, 2>
    ]>;
//===----------------------------------------------------------------------===//
// Conversion Profile Types
//===----------------------------------------------------------------------===//
def SDTIL_DPToFPOp : SDTypeProfile<1, 1, [
    SDTCisFP<0>, SDTCisFP<1>, SDTCisOpSmallerThanOp<0, 1>
    ]>; // d2f

def SDTIL_AnyToInt : SDTypeProfile<1, 1, [
    SDTCisInt<0>
    ]>;
def SDTIL_IntToAny : SDTypeProfile<1, 1, [
    SDTCisInt<1>
    ]>;
def SDTIL_GenBitConv : SDTypeProfile<1, 1, []>;
//===----------------------------------------------------------------------===//
// Scalar Profile Types
//===----------------------------------------------------------------------===//

// Add instruction pattern to handle offsets of memory operationns
def SDTIL_AddAddrri: SDTypeProfile<1, 2, [
    SDTCisInt<0>, SDTCisPtrTy<1>, SDTCisSameAs<0, 2>
    ]>;
def SDTIL_AddAddrir : SDTypeProfile<1, 2, [
    SDTCisInt<0>, SDTCisPtrTy<2>, SDTCisSameAs<0, 1>
    ]>;

def SDTIL_LCreate : SDTypeProfile<1, 2, [
    SDTCisVT<0, i64>, SDTCisVT<1, i32>, SDTCisSameAs<1, 2>
    ]>;
def SDTIL_LCreate2 : SDTypeProfile<1, 2, [
    SDTCisVT<0, v2i64>, SDTCisVT<1, v2i32>, SDTCisSameAs<1, 2>
    ]>;
def SDTIL_LComp : SDTypeProfile<1, 1, [
    SDTCisVT<0, i32>, SDTCisVT<1, i64>
    ]>;
def SDTIL_LComp2 : SDTypeProfile<1, 1, [
    SDTCisVT<0, v2i32>, SDTCisVT<1, v2i64>
    ]>;
def SDTIL_DCreate : SDTypeProfile<1, 2, [
    SDTCisVT<0, f64>, SDTCisVT<1, i32>, SDTCisSameAs<1, 2>
    ]>;
def SDTIL_DComp : SDTypeProfile<1, 1, [
    SDTCisVT<0, i32>, SDTCisVT<1, f64>
    ]>;
def SDTIL_DCreate2 : SDTypeProfile<1, 2, [
    SDTCisVT<0, v2f64>, SDTCisVT<1, v2i32>, SDTCisSameAs<1, 2>
    ]>;
def SDTIL_DComp2 : SDTypeProfile<1, 1, [
    SDTCisVT<0, v2i32>, SDTCisVT<1, v2f64>
    ]>;
//===----------------------------------------------------------------------===//
// Flow Control Profile Types
//===----------------------------------------------------------------------===//
// Profile for Normal Call
def SDTIL_Call : SDTypeProfile<0, 1, [
    SDTCisVT<0, i32>
    ]>;
// Branch instruction where second and third are basic blocks
def SDTIL_BRCond : SDTypeProfile<0, 2, [
    SDTCisVT<0, OtherVT>
    ]>;
// Comparison instruction
def SDTIL_Cmp  : SDTypeProfile<1, 3, [
    SDTCisSameAs<0, 2>, SDTCisSameAs<2,3>, SDTCisVT<1, i32>
    ]>;


//===----------------------------------------------------------------------===//
// Call Sequence Profiles
//===----------------------------------------------------------------------===//
def SDTIL_CallSeqStart  : SDCallSeqStart< [
    SDTCisVT<0, i32>
    ]>;
def SDTIL_CallSeqEnd    : SDCallSeqEnd< [
    SDTCisVT<0, i32>, SDTCisVT<1, i32>
    ]>;

//===----------------------------------------------------------------------===//
// Image Operation Profiles
//===----------------------------------------------------------------------===//
def SDTIL_ImageRead  : SDTypeProfile<1, 3, 
    [SDTCisVT<0, v4i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>, SDTCisVT<3, v4f32>]>;
def SDTIL_ImageWrite : SDTypeProfile<0, 3,
    [SDTCisPtrTy<0>, SDTCisVT<1, v2i32>, SDTCisVT<2, v4i32>]>;
def SDTIL_ImageWrite3D : SDTypeProfile<0, 3,
    [SDTCisPtrTy<0>, SDTCisVT<1, v4i32>, SDTCisVT<2, v4i32>]>;
def SDTIL_ImageInfo  : SDTypeProfile<1, 1,
    [SDTCisVT<0, v4i32>, SDTCisPtrTy<1>]>;
//===----------------------------------------------------------------------===//
// Atomic Operation Profiles
//===----------------------------------------------------------------------===//
def SDTIL_UniAtomNoRet : SDTypeProfile<0, 2, [
    SDTCisPtrTy<0>, SDTCisVT<1, i32>
    ]>;
def SDTIL_BinAtomNoRet : SDTypeProfile<0, 3, [
    SDTCisPtrTy<0>, SDTCisVT<1, i32>, SDTCisVT<2, i32>
    ]>;
def SDTIL_TriAtomNoRet : SDTypeProfile<0, 4, [
    SDTCisPtrTy<0>, SDTCisVT<1, i32>, SDTCisVT<2, i32>, SDTCisVT<3, i32>
    ]>;
def SDTIL_UniAtom : SDTypeProfile<1, 2, [
    SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>
    ]>;
def SDTIL_BinAtom : SDTypeProfile<1, 3, [
    SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>, SDTCisVT<3, i32>
    ]>;
def SDTIL_TriAtom : SDTypeProfile<1, 4, [
    SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, i32>,
    SDTCisVT<3, i32>, SDTCisVT<4, i32>
    ]>;

def SDTIL_BinAtomFloat : SDTypeProfile<1, 3, [
    SDTCisVT<0, i32>, SDTCisPtrTy<1>, SDTCisVT<2, f32>, SDTCisVT<3, f32>
    ]>;
def SDTIL_BinAtomNoRetFloat : SDTypeProfile<0, 3, [
    SDTCisPtrTy<0>, SDTCisVT<1, f32>, SDTCisVT<2, f32>
    ]>;

def SDTIL_Append : SDTypeProfile<1, 1, [
    SDTCisVT<0, i32>, SDTCisPtrTy<1>
    ]>;