r300: Remove all Mesa dependencies from the shader compiler
[mesa.git] / src / mesa / drivers / dri / r300 / compiler / radeon_opcodes.c
1 /*
2 * Copyright (C) 2009 Nicolai Haehnle.
3 *
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial
16 * portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 */
27
28 #include "radeon_opcodes.h"
29
30 struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = {
31 {
32 .Opcode = RC_OPCODE_NOP,
33 .Name = "NOP"
34 },
35 {
36 .Opcode = RC_OPCODE_ILLEGAL_OPCODE,
37 .Name = "ILLEGAL OPCODE"
38 },
39 {
40 .Opcode = RC_OPCODE_ABS,
41 .Name = "ABS",
42 .NumSrcRegs = 1,
43 .HasDstReg = 1
44 },
45 {
46 .Opcode = RC_OPCODE_ADD,
47 .Name = "ADD",
48 .NumSrcRegs = 2,
49 .HasDstReg = 1
50 },
51 {
52 .Opcode = RC_OPCODE_ARL,
53 .Name = "ARL",
54 .NumSrcRegs = 1,
55 .HasDstReg = 1
56 },
57 {
58 .Opcode = RC_OPCODE_CMP,
59 .Name = "CMP",
60 .NumSrcRegs = 3,
61 .HasDstReg = 1
62 },
63 {
64 .Opcode = RC_OPCODE_COS,
65 .Name = "COS",
66 .NumSrcRegs = 1,
67 .HasDstReg = 1
68 },
69 {
70 .Opcode = RC_OPCODE_DDX,
71 .Name = "DDX",
72 .NumSrcRegs = 1,
73 .HasDstReg = 1
74 },
75 {
76 .Opcode = RC_OPCODE_DDY,
77 .Name = "DDY",
78 .NumSrcRegs = 1,
79 .HasDstReg = 1
80 },
81 {
82 .Opcode = RC_OPCODE_DP3,
83 .Name = "DP3",
84 .NumSrcRegs = 2,
85 .HasDstReg = 1
86 },
87 {
88 .Opcode = RC_OPCODE_DP4,
89 .Name = "DP4",
90 .NumSrcRegs = 2,
91 .HasDstReg = 1
92 },
93 {
94 .Opcode = RC_OPCODE_DPH,
95 .Name = "DPH",
96 .NumSrcRegs = 2,
97 .HasDstReg = 1
98 },
99 {
100 .Opcode = RC_OPCODE_DST,
101 .Name = "DST",
102 .NumSrcRegs = 2,
103 .HasDstReg = 1
104 },
105 {
106 .Opcode = RC_OPCODE_EX2,
107 .Name = "EX2",
108 .NumSrcRegs = 1,
109 .HasDstReg = 1
110 },
111 {
112 .Opcode = RC_OPCODE_EXP,
113 .Name = "EXP",
114 .NumSrcRegs = 1,
115 .HasDstReg = 1
116 },
117 {
118 .Opcode = RC_OPCODE_FLR,
119 .Name = "FLR",
120 .NumSrcRegs = 1,
121 .HasDstReg = 1
122 },
123 {
124 .Opcode = RC_OPCODE_FRC,
125 .Name = "FRC",
126 .NumSrcRegs = 1,
127 .HasDstReg = 1
128 },
129 {
130 .Opcode = RC_OPCODE_KIL,
131 .Name = "KIL",
132 .NumSrcRegs = 1
133 },
134 {
135 .Opcode = RC_OPCODE_LG2,
136 .Name = "LG2",
137 .NumSrcRegs = 1,
138 .HasDstReg = 1
139 },
140 {
141 .Opcode = RC_OPCODE_LIT,
142 .Name = "LIT",
143 .NumSrcRegs = 1,
144 .HasDstReg = 1
145 },
146 {
147 .Opcode = RC_OPCODE_LOG,
148 .Name = "LOG",
149 .NumSrcRegs = 1,
150 .HasDstReg = 1
151 },
152 {
153 .Opcode = RC_OPCODE_LRP,
154 .Name = "LRP",
155 .NumSrcRegs = 3,
156 .HasDstReg = 1
157 },
158 {
159 .Opcode = RC_OPCODE_MAD,
160 .Name = "MAD",
161 .NumSrcRegs = 3,
162 .HasDstReg = 1
163 },
164 {
165 .Opcode = RC_OPCODE_MAX,
166 .Name = "MAX",
167 .NumSrcRegs = 2,
168 .HasDstReg = 1
169 },
170 {
171 .Opcode = RC_OPCODE_MIN,
172 .Name = "MIN",
173 .NumSrcRegs = 2,
174 .HasDstReg = 1
175 },
176 {
177 .Opcode = RC_OPCODE_MOV,
178 .Name = "MOV",
179 .NumSrcRegs = 1,
180 .HasDstReg = 1
181 },
182 {
183 .Opcode = RC_OPCODE_MUL,
184 .Name = "MUL",
185 .NumSrcRegs = 2,
186 .HasDstReg = 1
187 },
188 {
189 .Opcode = RC_OPCODE_POW,
190 .Name = "POW",
191 .NumSrcRegs = 2,
192 .HasDstReg = 1
193 },
194 {
195 .Opcode = RC_OPCODE_RCP,
196 .Name = "RCP",
197 .NumSrcRegs = 1,
198 .HasDstReg = 1
199 },
200 {
201 .Opcode = RC_OPCODE_RSQ,
202 .Name = "RSQ",
203 .NumSrcRegs = 1,
204 .HasDstReg = 1
205 },
206 {
207 .Opcode = RC_OPCODE_SCS,
208 .Name = "SCS",
209 .NumSrcRegs = 1,
210 .HasDstReg = 1
211 },
212 {
213 .Opcode = RC_OPCODE_SEQ,
214 .Name = "SEQ",
215 .NumSrcRegs = 2,
216 .HasDstReg = 1
217 },
218 {
219 .Opcode = RC_OPCODE_SFL,
220 .Name = "SFL",
221 .NumSrcRegs = 0,
222 .HasDstReg = 1
223 },
224 {
225 .Opcode = RC_OPCODE_SGE,
226 .Name = "SGE",
227 .NumSrcRegs = 2,
228 .HasDstReg = 1
229 },
230 {
231 .Opcode = RC_OPCODE_SGT,
232 .Name = "SGT",
233 .NumSrcRegs = 2,
234 .HasDstReg = 1
235 },
236 {
237 .Opcode = RC_OPCODE_SIN,
238 .Name = "SIN",
239 .NumSrcRegs = 1,
240 .HasDstReg = 1
241 },
242 {
243 .Opcode = RC_OPCODE_SLE,
244 .Name = "SLE",
245 .NumSrcRegs = 2,
246 .HasDstReg = 1
247 },
248 {
249 .Opcode = RC_OPCODE_SLT,
250 .Name = "SLT",
251 .NumSrcRegs = 2,
252 .HasDstReg = 1
253 },
254 {
255 .Opcode = RC_OPCODE_SNE,
256 .Name = "SNE",
257 .NumSrcRegs = 2,
258 .HasDstReg = 1
259 },
260 {
261 .Opcode = RC_OPCODE_SUB,
262 .Name = "SUB",
263 .NumSrcRegs = 2,
264 .HasDstReg = 1
265 },
266 {
267 .Opcode = RC_OPCODE_SWZ,
268 .Name = "SWZ",
269 .NumSrcRegs = 1,
270 .HasDstReg = 1
271 },
272 {
273 .Opcode = RC_OPCODE_XPD,
274 .Name = "XPD",
275 .NumSrcRegs = 2,
276 .HasDstReg = 1
277 },
278 {
279 .Opcode = RC_OPCODE_TEX,
280 .Name = "TEX",
281 .HasTexture = 1,
282 .NumSrcRegs = 1,
283 .HasDstReg = 1
284 },
285 {
286 .Opcode = RC_OPCODE_TXB,
287 .Name = "TXB",
288 .HasTexture = 1,
289 .NumSrcRegs = 1,
290 .HasDstReg = 1
291 },
292 {
293 .Opcode = RC_OPCODE_TXD,
294 .Name = "TXD",
295 .HasTexture = 1,
296 .NumSrcRegs = 3,
297 .HasDstReg = 1
298 },
299 {
300 .Opcode = RC_OPCODE_TXL,
301 .Name = "TXL",
302 .HasTexture = 1,
303 .NumSrcRegs = 1,
304 .HasDstReg = 1
305 },
306 {
307 .Opcode = RC_OPCODE_TXP,
308 .Name = "TXP",
309 .HasTexture = 1,
310 .NumSrcRegs = 1,
311 .HasDstReg = 1
312 },
313 {
314 .Opcode = RC_OPCODE_REPL_ALPHA,
315 .Name = "REPL_ALPHA",
316 .HasDstReg = 1
317 }
318 };