2 * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE.
23 #include "pipe/p_shader_tokens.h"
24 #include "tgsi/tgsi_parse.h"
25 #include "tgsi/tgsi_scan.h"
26 #include "util/u_format.h"
27 #include "r600_screen.h"
28 #include "r600_context.h"
29 #include "r600_shader.h"
36 static int r600_shader_from_tgsi(const struct tgsi_token
*tokens
, struct r600_shader
*shader
);
38 static int r600_shader_update(struct pipe_context
*ctx
, struct r600_shader
*shader
)
40 struct r600_context
*rctx
= r600_context(ctx
);
41 const struct util_format_description
*desc
;
42 enum pipe_format resource_format
[160];
43 unsigned i
, nresources
= 0;
44 struct r600_bc
*bc
= &shader
->bc
;
45 struct r600_bc_cf
*cf
;
46 struct r600_bc_vtx
*vtx
;
48 if (shader
->processor_type
!= TGSI_PROCESSOR_VERTEX
)
50 for (i
= 0; i
< rctx
->vertex_elements
->count
; i
++) {
51 resource_format
[nresources
++] = rctx
->vertex_elements
->elements
[i
].src_format
;
53 LIST_FOR_EACH_ENTRY(cf
, &bc
->cf
, list
) {
55 case V_SQ_CF_WORD1_SQ_CF_INST_VTX
:
56 case V_SQ_CF_WORD1_SQ_CF_INST_VTX_TC
:
57 LIST_FOR_EACH_ENTRY(vtx
, &cf
->vtx
, list
) {
58 desc
= util_format_description(resource_format
[vtx
->buffer_id
]);
60 R600_ERR("unknown format %d\n", resource_format
[vtx
->buffer_id
]);
63 vtx
->dst_sel_x
= desc
->swizzle
[0];
64 vtx
->dst_sel_y
= desc
->swizzle
[1];
65 vtx
->dst_sel_z
= desc
->swizzle
[2];
66 vtx
->dst_sel_w
= desc
->swizzle
[3];
73 return r600_bc_build(&shader
->bc
);
76 struct r600_pipe_shader
*r600_pipe_shader_create(struct pipe_context
*ctx
,
77 const struct tgsi_token
*tokens
)
79 struct r600_screen
*rscreen
= r600_screen(ctx
->screen
);
80 struct r600_pipe_shader
*rpshader
= CALLOC_STRUCT(r600_pipe_shader
);
83 fprintf(stderr
, "--------------------------------------------------------------\n");
87 rpshader
->shader
.family
= radeon_get_family(rscreen
->rw
);
88 r
= r600_shader_from_tgsi(tokens
, &rpshader
->shader
);
90 R600_ERR("translation from TGSI failed !\n");
93 r
= r600_bc_build(&rpshader
->shader
.bc
);
95 R600_ERR("building bytecode failed !\n");
98 fprintf(stderr
, "______________________________________________________________\n");
105 static int r600_pipe_shader_vs(struct pipe_context
*ctx
, struct r600_pipe_shader
*rpshader
)
107 struct r600_screen
*rscreen
= r600_screen(ctx
->screen
);
108 struct r600_shader
*rshader
= &rpshader
->shader
;
109 struct radeon_state
*state
;
112 rpshader
->state
= radeon_state_decref(rpshader
->state
);
113 state
= radeon_state(rscreen
->rw
, R600_VS_SHADER_TYPE
, R600_VS_SHADER
);
116 for (i
= 0; i
< 10; i
++) {
117 state
->states
[R600_VS_SHADER__SPI_VS_OUT_ID_0
+ i
] = 0;
119 for (i
= 0, j
= 0; i
< rshader
->noutput
; i
++) {
120 if (rshader
->output
[i
].name
!= TGSI_SEMANTIC_POSITION
) {
121 tmp
= rshader
->output
[i
].sid
<< ((j
& 3) * 8);
122 state
->states
[R600_VS_SHADER__SPI_VS_OUT_ID_0
+ j
/ 4] |= tmp
;
126 state
->states
[R600_VS_SHADER__SPI_VS_OUT_CONFIG
] = S_0286C4_VS_EXPORT_COUNT(rshader
->noutput
- 2);
127 state
->states
[R600_VS_SHADER__SQ_PGM_RESOURCES_VS
] = S_028868_NUM_GPRS(rshader
->bc
.ngpr
);
128 rpshader
->state
= state
;
129 rpshader
->state
->bo
[0] = radeon_bo_incref(rscreen
->rw
, rpshader
->bo
);
130 rpshader
->state
->bo
[1] = radeon_bo_incref(rscreen
->rw
, rpshader
->bo
);
131 rpshader
->state
->nbo
= 2;
132 rpshader
->state
->placement
[0] = RADEON_GEM_DOMAIN_GTT
;
133 return radeon_state_pm4(state
);
136 static int r600_pipe_shader_ps(struct pipe_context
*ctx
, struct r600_pipe_shader
*rpshader
)
138 struct r600_screen
*rscreen
= r600_screen(ctx
->screen
);
139 struct r600_shader
*rshader
= &rpshader
->shader
;
140 struct radeon_state
*state
;
143 rpshader
->state
= radeon_state_decref(rpshader
->state
);
144 state
= radeon_state(rscreen
->rw
, R600_PS_SHADER_TYPE
, R600_PS_SHADER
);
147 for (i
= 0; i
< rshader
->ninput
; i
++) {
148 tmp
= S_028644_SEMANTIC(rshader
->input
[i
].sid
);
149 tmp
|= S_028644_SEL_CENTROID(1);
150 tmp
|= S_028644_FLAT_SHADE(rshader
->flat_shade
);
151 state
->states
[R600_PS_SHADER__SPI_PS_INPUT_CNTL_0
+ i
] = tmp
;
153 state
->states
[R600_PS_SHADER__SPI_PS_IN_CONTROL_0
] = S_0286CC_NUM_INTERP(rshader
->ninput
) |
154 S_0286CC_PERSP_GRADIENT_ENA(1);
155 state
->states
[R600_PS_SHADER__SPI_PS_IN_CONTROL_1
] = 0x00000000;
156 state
->states
[R600_PS_SHADER__SQ_PGM_RESOURCES_PS
] = S_028868_NUM_GPRS(rshader
->bc
.ngpr
);
157 state
->states
[R600_PS_SHADER__SQ_PGM_EXPORTS_PS
] = 0x00000002;
158 rpshader
->state
= state
;
159 rpshader
->state
->bo
[0] = radeon_bo_incref(rscreen
->rw
, rpshader
->bo
);
160 rpshader
->state
->nbo
= 1;
161 rpshader
->state
->placement
[0] = RADEON_GEM_DOMAIN_GTT
;
162 return radeon_state_pm4(state
);
165 static int r600_pipe_shader(struct pipe_context
*ctx
, struct r600_pipe_shader
*rpshader
)
167 struct r600_screen
*rscreen
= r600_screen(ctx
->screen
);
168 struct r600_context
*rctx
= r600_context(ctx
);
169 struct r600_shader
*rshader
= &rpshader
->shader
;
172 /* copy new shader */
173 radeon_bo_decref(rscreen
->rw
, rpshader
->bo
);
175 rpshader
->bo
= radeon_bo(rscreen
->rw
, 0, rshader
->bc
.ndw
* 4,
177 if (rpshader
->bo
== NULL
) {
180 radeon_bo_map(rscreen
->rw
, rpshader
->bo
);
181 memcpy(rpshader
->bo
->data
, rshader
->bc
.bytecode
, rshader
->bc
.ndw
* 4);
182 radeon_bo_unmap(rscreen
->rw
, rpshader
->bo
);
184 rshader
->flat_shade
= rctx
->flat_shade
;
185 switch (rshader
->processor_type
) {
186 case TGSI_PROCESSOR_VERTEX
:
187 r
= r600_pipe_shader_vs(ctx
, rpshader
);
189 case TGSI_PROCESSOR_FRAGMENT
:
190 r
= r600_pipe_shader_ps(ctx
, rpshader
);
199 int r600_pipe_shader_update(struct pipe_context
*ctx
, struct r600_pipe_shader
*rpshader
)
201 struct r600_context
*rctx
= r600_context(ctx
);
204 if (rpshader
== NULL
)
206 /* there should be enough input */
207 if (rctx
->vertex_elements
->count
< rpshader
->shader
.bc
.nresource
) {
208 R600_ERR("%d resources provided, expecting %d\n",
209 rctx
->vertex_elements
->count
, rpshader
->shader
.bc
.nresource
);
212 r
= r600_shader_update(ctx
, &rpshader
->shader
);
215 return r600_pipe_shader(ctx
, rpshader
);
218 struct r600_shader_tgsi_instruction
;
220 struct r600_shader_ctx
{
221 struct tgsi_shader_info info
;
222 struct tgsi_parse_context parse
;
223 const struct tgsi_token
*tokens
;
225 unsigned file_offset
[TGSI_FILE_COUNT
];
227 struct r600_shader_tgsi_instruction
*inst_info
;
229 struct r600_shader
*shader
;
232 struct r600_shader_tgsi_instruction
{
233 unsigned tgsi_opcode
;
235 unsigned r600_opcode
;
236 int (*process
)(struct r600_shader_ctx
*ctx
);
239 static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction
[];
241 static int tgsi_is_supported(struct r600_shader_ctx
*ctx
)
243 struct tgsi_full_instruction
*i
= &ctx
->parse
.FullToken
.FullInstruction
;
246 if (i
->Instruction
.NumDstRegs
> 1) {
247 R600_ERR("too many dst (%d)\n", i
->Instruction
.NumDstRegs
);
250 if (i
->Instruction
.Saturate
) {
251 R600_ERR("staturate unsupported\n");
254 if (i
->Instruction
.Predicate
) {
255 R600_ERR("predicate unsupported\n");
258 if (i
->Instruction
.Label
) {
259 R600_ERR("label unsupported\n");
262 if (i
->Instruction
.Texture
) {
263 R600_ERR("texture unsupported\n");
266 for (j
= 0; j
< i
->Instruction
.NumSrcRegs
; j
++) {
267 if (i
->Src
[j
].Register
.Indirect
||
268 i
->Src
[j
].Register
.Dimension
||
269 i
->Src
[j
].Register
.Absolute
) {
270 R600_ERR("unsupported src (indirect|dimension|absolute)\n");
274 for (j
= 0; j
< i
->Instruction
.NumDstRegs
; j
++) {
275 if (i
->Dst
[j
].Register
.Indirect
|| i
->Dst
[j
].Register
.Dimension
) {
276 R600_ERR("unsupported dst (indirect|dimension)\n");
283 static int tgsi_declaration(struct r600_shader_ctx
*ctx
)
285 struct tgsi_full_declaration
*d
= &ctx
->parse
.FullToken
.FullDeclaration
;
286 struct r600_bc_vtx vtx
;
290 switch (d
->Declaration
.File
) {
291 case TGSI_FILE_INPUT
:
292 i
= ctx
->shader
->ninput
++;
293 ctx
->shader
->input
[i
].name
= d
->Semantic
.Name
;
294 ctx
->shader
->input
[i
].sid
= d
->Semantic
.Index
;
295 ctx
->shader
->input
[i
].gpr
= ctx
->file_offset
[TGSI_FILE_INPUT
] + i
;
296 if (ctx
->type
== TGSI_PROCESSOR_VERTEX
) {
297 /* turn input into fetch */
298 memset(&vtx
, 0, sizeof(struct r600_bc_vtx
));
302 /* register containing the index into the buffer */
305 vtx
.mega_fetch_count
= 0x1F;
306 vtx
.dst_gpr
= ctx
->shader
->input
[i
].gpr
;
311 r
= r600_bc_add_vtx(ctx
->bc
, &vtx
);
316 case TGSI_FILE_OUTPUT
:
317 i
= ctx
->shader
->noutput
++;
318 ctx
->shader
->output
[i
].name
= d
->Semantic
.Name
;
319 ctx
->shader
->output
[i
].sid
= d
->Semantic
.Index
;
320 ctx
->shader
->output
[i
].gpr
= ctx
->file_offset
[TGSI_FILE_OUTPUT
] + i
;
322 case TGSI_FILE_CONSTANT
:
323 case TGSI_FILE_TEMPORARY
:
326 R600_ERR("unsupported file %d declaration\n", d
->Declaration
.File
);
332 int r600_shader_from_tgsi(const struct tgsi_token
*tokens
, struct r600_shader
*shader
)
334 struct tgsi_full_immediate
*immediate
;
335 struct r600_shader_ctx ctx
;
336 struct r600_bc_output output
;
341 ctx
.bc
= &shader
->bc
;
343 r
= r600_bc_init(ctx
.bc
, shader
->family
);
347 tgsi_scan_shader(tokens
, &ctx
.info
);
348 tgsi_parse_init(&ctx
.parse
, tokens
);
349 ctx
.type
= ctx
.parse
.FullHeader
.Processor
.Processor
;
350 shader
->processor_type
= ctx
.type
;
352 /* register allocations */
353 /* Values [0,127] correspond to GPR[0..127].
354 * Values [256,511] correspond to cfile constants c[0..255].
355 * Other special values are shown in the list below.
356 * 248 SQ_ALU_SRC_0: special constant 0.0.
357 * 249 SQ_ALU_SRC_1: special constant 1.0 float.
358 * 250 SQ_ALU_SRC_1_INT: special constant 1 integer.
359 * 251 SQ_ALU_SRC_M_1_INT: special constant -1 integer.
360 * 252 SQ_ALU_SRC_0_5: special constant 0.5 float.
361 * 253 SQ_ALU_SRC_LITERAL: literal constant.
362 * 254 SQ_ALU_SRC_PV: previous vector result.
363 * 255 SQ_ALU_SRC_PS: previous scalar result.
365 for (i
= 0; i
< TGSI_FILE_COUNT
; i
++) {
366 ctx
.file_offset
[i
] = 0;
368 if (ctx
.type
== TGSI_PROCESSOR_VERTEX
) {
369 ctx
.file_offset
[TGSI_FILE_INPUT
] = 1;
371 ctx
.file_offset
[TGSI_FILE_OUTPUT
] = ctx
.file_offset
[TGSI_FILE_INPUT
] +
372 ctx
.info
.file_count
[TGSI_FILE_INPUT
];
373 ctx
.file_offset
[TGSI_FILE_TEMPORARY
] = ctx
.file_offset
[TGSI_FILE_OUTPUT
] +
374 ctx
.info
.file_count
[TGSI_FILE_OUTPUT
];
375 ctx
.file_offset
[TGSI_FILE_CONSTANT
] = 256;
376 ctx
.file_offset
[TGSI_FILE_IMMEDIATE
] = 253;
377 ctx
.temp_reg
= ctx
.file_offset
[TGSI_FILE_TEMPORARY
] +
378 ctx
.info
.file_count
[TGSI_FILE_TEMPORARY
];
380 while (!tgsi_parse_end_of_tokens(&ctx
.parse
)) {
381 tgsi_parse_token(&ctx
.parse
);
382 switch (ctx
.parse
.FullToken
.Token
.Type
) {
383 case TGSI_TOKEN_TYPE_IMMEDIATE
:
384 // R600_ERR("TGSI_TOKEN_TYPE_IMMEDIATE unsupported\n");
385 immediate
= &ctx
.parse
.FullToken
.FullImmediate
;
386 value
[0] = immediate
->u
[0].Uint
;
387 value
[1] = immediate
->u
[1].Uint
;
388 value
[2] = immediate
->u
[2].Uint
;
389 value
[3] = immediate
->u
[3].Uint
;
391 case TGSI_TOKEN_TYPE_DECLARATION
:
392 r
= tgsi_declaration(&ctx
);
396 case TGSI_TOKEN_TYPE_INSTRUCTION
:
397 r
= tgsi_is_supported(&ctx
);
400 opcode
= ctx
.parse
.FullToken
.FullInstruction
.Instruction
.Opcode
;
401 ctx
.inst_info
= &r600_shader_tgsi_instruction
[opcode
];
402 r
= ctx
.inst_info
->process(&ctx
);
405 r
= r600_bc_add_literal(ctx
.bc
, value
);
410 R600_ERR("unsupported token type %d\n", ctx
.parse
.FullToken
.Token
.Type
);
416 for (i
= 0, pos0
= 0; i
< shader
->noutput
; i
++) {
417 memset(&output
, 0, sizeof(struct r600_bc_output
));
418 output
.gpr
= shader
->output
[i
].gpr
;
419 output
.elem_size
= 3;
420 output
.swizzle_x
= 0;
421 output
.swizzle_y
= 1;
422 output
.swizzle_z
= 2;
423 output
.swizzle_w
= 3;
425 output
.type
= V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PARAM
;
426 output
.array_base
= i
- pos0
;
427 output
.inst
= V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT_DONE
;
428 switch (ctx
.type
== TGSI_PROCESSOR_VERTEX
) {
429 case TGSI_PROCESSOR_VERTEX
:
430 if (shader
->output
[i
].name
== TGSI_SEMANTIC_POSITION
) {
431 output
.array_base
= 60;
432 output
.type
= V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_POS
;
433 /* position doesn't count in array_base */
437 case TGSI_PROCESSOR_FRAGMENT
:
438 if (shader
->output
[i
].name
== TGSI_SEMANTIC_COLOR
) {
439 output
.array_base
= 0;
440 output
.type
= V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL
;
442 R600_ERR("unsupported fragment output name %d\n", shader
->output
[i
].name
);
448 R600_ERR("unsupported processor type %d\n", ctx
.type
);
452 if (i
== (shader
->noutput
- 1)) {
453 output
.end_of_program
= 1;
455 r
= r600_bc_add_output(ctx
.bc
, &output
);
459 tgsi_parse_free(&ctx
.parse
);
462 tgsi_parse_free(&ctx
.parse
);
466 static int tgsi_unsupported(struct r600_shader_ctx
*ctx
)
468 R600_ERR("%d tgsi opcode unsupported\n", ctx
->inst_info
->tgsi_opcode
);
472 static int tgsi_end(struct r600_shader_ctx
*ctx
)
477 static int tgsi_src(struct r600_shader_ctx
*ctx
,
478 const struct tgsi_full_src_register
*tgsi_src
,
480 struct r600_bc_alu_src
*r600_src
)
482 r600_src
->sel
= tgsi_src
->Register
.Index
;
483 if (tgsi_src
->Register
.File
== TGSI_FILE_IMMEDIATE
) {
486 r600_src
->sel
+= ctx
->file_offset
[tgsi_src
->Register
.File
];
489 r600_src
->chan
= tgsi_src
->Register
.SwizzleX
;
492 r600_src
->chan
= tgsi_src
->Register
.SwizzleY
;
495 r600_src
->chan
= tgsi_src
->Register
.SwizzleZ
;
498 r600_src
->chan
= tgsi_src
->Register
.SwizzleW
;
506 static int tgsi_dst(struct r600_shader_ctx
*ctx
,
507 const struct tgsi_full_dst_register
*tgsi_dst
,
509 struct r600_bc_alu_dst
*r600_dst
)
511 r600_dst
->sel
= tgsi_dst
->Register
.Index
;
512 r600_dst
->sel
+= ctx
->file_offset
[tgsi_dst
->Register
.File
];
513 r600_dst
->chan
= swizzle
;
518 static int tgsi_op2(struct r600_shader_ctx
*ctx
)
520 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
521 struct r600_bc_alu alu
;
524 for (i
= 0; i
< 4; i
++) {
525 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
526 if (!(inst
->Dst
[0].Register
.WriteMask
& (1 << i
))) {
527 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
;
529 alu
.inst
= ctx
->inst_info
->r600_opcode
;
530 for (j
= 0; j
< inst
->Instruction
.NumSrcRegs
; j
++) {
531 r
= tgsi_src(ctx
, &inst
->Src
[j
], i
, &alu
.src
[j
]);
535 r
= tgsi_dst(ctx
, &inst
->Dst
[0], i
, &alu
.dst
);
539 /* handle some special cases */
540 switch (ctx
->inst_info
->tgsi_opcode
) {
541 case TGSI_OPCODE_SUB
:
550 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
557 static int tgsi_slt(struct r600_shader_ctx
*ctx
)
559 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
560 struct r600_bc_alu alu
;
563 for (i
= 0; i
< 4; i
++) {
564 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
565 if (!(inst
->Dst
[0].Register
.WriteMask
& (1 << i
))) {
566 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
;
568 alu
.inst
= ctx
->inst_info
->r600_opcode
;
569 r
= tgsi_src(ctx
, &inst
->Src
[0], i
, &alu
.src
[1]);
572 r
= tgsi_src(ctx
, &inst
->Src
[1], i
, &alu
.src
[0]);
575 r
= tgsi_dst(ctx
, &inst
->Dst
[0], i
, &alu
.dst
);
582 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
589 static int tgsi_trans(struct r600_shader_ctx
*ctx
)
591 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
592 struct r600_bc_alu alu
;
595 for (i
= 0; i
< 4; i
++) {
596 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
597 if (inst
->Dst
[0].Register
.WriteMask
& (1 << i
)) {
598 alu
.inst
= ctx
->inst_info
->r600_opcode
;
599 for (j
= 0; j
< inst
->Instruction
.NumSrcRegs
; j
++) {
600 r
= tgsi_src(ctx
, &inst
->Src
[j
], i
, &alu
.src
[j
]);
604 r
= tgsi_dst(ctx
, &inst
->Dst
[0], i
, &alu
.dst
);
608 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
616 static int tgsi_helper_copy(struct r600_shader_ctx
*ctx
, struct tgsi_full_instruction
*inst
)
618 struct r600_bc_alu alu
;
621 for (i
= 0; i
< 4; i
++) {
622 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
623 if (!(inst
->Dst
[0].Register
.WriteMask
& (1 << i
))) {
624 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
;
626 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV
;
627 r
= tgsi_dst(ctx
, &inst
->Dst
[0], i
, &alu
.dst
);
630 alu
.src
[0].sel
= ctx
->temp_reg
;
636 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
643 static int tgsi_op3(struct r600_shader_ctx
*ctx
)
645 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
646 struct r600_bc_alu alu
;
649 /* do it in 2 step as op3 doesn't support writemask */
650 for (i
= 0; i
< 4; i
++) {
651 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
652 alu
.inst
= ctx
->inst_info
->r600_opcode
;
653 for (j
= 0; j
< inst
->Instruction
.NumSrcRegs
; j
++) {
654 r
= tgsi_src(ctx
, &inst
->Src
[j
], i
, &alu
.src
[j
]);
658 alu
.dst
.sel
= ctx
->temp_reg
;
665 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
669 return tgsi_helper_copy(ctx
, inst
);
672 static int tgsi_dp(struct r600_shader_ctx
*ctx
)
674 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
675 struct r600_bc_alu alu
;
678 for (i
= 0; i
< 4; i
++) {
679 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
680 alu
.inst
= ctx
->inst_info
->r600_opcode
;
681 for (j
= 0; j
< inst
->Instruction
.NumSrcRegs
; j
++) {
682 r
= tgsi_src(ctx
, &inst
->Src
[j
], i
, &alu
.src
[j
]);
686 alu
.dst
.sel
= ctx
->temp_reg
;
689 /* handle some special cases */
690 switch (ctx
->inst_info
->tgsi_opcode
) {
691 case TGSI_OPCODE_DP2
:
693 alu
.src
[0].sel
= alu
.src
[1].sel
= 248;
694 alu
.src
[0].chan
= alu
.src
[1].chan
= 0;
697 case TGSI_OPCODE_DP3
:
699 alu
.src
[0].sel
= alu
.src
[1].sel
= 248;
700 alu
.src
[0].chan
= alu
.src
[1].chan
= 0;
709 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
713 return tgsi_helper_copy(ctx
, inst
);
716 static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction
[] = {
717 {TGSI_OPCODE_ARL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
718 {TGSI_OPCODE_MOV
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV
, tgsi_op2
},
719 {TGSI_OPCODE_LIT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
720 {TGSI_OPCODE_RCP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
721 {TGSI_OPCODE_RSQ
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIPSQRT_IEEE
, tgsi_trans
},
722 {TGSI_OPCODE_EXP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
723 {TGSI_OPCODE_LOG
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
724 {TGSI_OPCODE_MUL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL
, tgsi_op2
},
725 {TGSI_OPCODE_ADD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD
, tgsi_op2
},
726 {TGSI_OPCODE_DP3
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4
, tgsi_dp
},
727 {TGSI_OPCODE_DP4
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4
, tgsi_dp
},
728 {TGSI_OPCODE_DST
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
729 {TGSI_OPCODE_MIN
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
730 {TGSI_OPCODE_MAX
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MAX
, tgsi_op2
},
731 {TGSI_OPCODE_SLT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SETGT
, tgsi_slt
},
732 {TGSI_OPCODE_SGE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
733 {TGSI_OPCODE_MAD
, 1, V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MULADD
, tgsi_op3
},
734 {TGSI_OPCODE_SUB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD
, tgsi_op2
},
735 {TGSI_OPCODE_LRP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
736 {TGSI_OPCODE_CND
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
738 {20, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
739 {TGSI_OPCODE_DP2A
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
741 {22, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
742 {23, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
743 {TGSI_OPCODE_FRC
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
744 {TGSI_OPCODE_CLAMP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
745 {TGSI_OPCODE_FLR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
746 {TGSI_OPCODE_ROUND
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
747 {TGSI_OPCODE_EX2
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
748 {TGSI_OPCODE_LG2
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
749 {TGSI_OPCODE_POW
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
750 {TGSI_OPCODE_XPD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
752 {32, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
753 {TGSI_OPCODE_ABS
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
754 {TGSI_OPCODE_RCC
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
755 {TGSI_OPCODE_DPH
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
756 {TGSI_OPCODE_COS
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
757 {TGSI_OPCODE_DDX
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
758 {TGSI_OPCODE_DDY
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
759 {TGSI_OPCODE_KILP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
}, /* predicated kill */
760 {TGSI_OPCODE_PK2H
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
761 {TGSI_OPCODE_PK2US
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
762 {TGSI_OPCODE_PK4B
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
763 {TGSI_OPCODE_PK4UB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
764 {TGSI_OPCODE_RFL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
765 {TGSI_OPCODE_SEQ
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
766 {TGSI_OPCODE_SFL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
767 {TGSI_OPCODE_SGT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
768 {TGSI_OPCODE_SIN
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
769 {TGSI_OPCODE_SLE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
770 {TGSI_OPCODE_SNE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
771 {TGSI_OPCODE_STR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
772 {TGSI_OPCODE_TEX
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
773 {TGSI_OPCODE_TXD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
774 {TGSI_OPCODE_TXP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
775 {TGSI_OPCODE_UP2H
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
776 {TGSI_OPCODE_UP2US
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
777 {TGSI_OPCODE_UP4B
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
778 {TGSI_OPCODE_UP4UB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
779 {TGSI_OPCODE_X2D
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
780 {TGSI_OPCODE_ARA
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
781 {TGSI_OPCODE_ARR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
782 {TGSI_OPCODE_BRA
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
783 {TGSI_OPCODE_CAL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
784 {TGSI_OPCODE_RET
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
785 {TGSI_OPCODE_SSG
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
}, /* SGN */
786 {TGSI_OPCODE_CMP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
787 {TGSI_OPCODE_SCS
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
788 {TGSI_OPCODE_TXB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
789 {TGSI_OPCODE_NRM
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
790 {TGSI_OPCODE_DIV
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
791 {TGSI_OPCODE_DP2
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4
, tgsi_dp
},
792 {TGSI_OPCODE_TXL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
793 {TGSI_OPCODE_BRK
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
794 {TGSI_OPCODE_IF
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
796 {75, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
797 {76, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
798 {TGSI_OPCODE_ELSE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
799 {TGSI_OPCODE_ENDIF
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
801 {79, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
802 {80, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
803 {TGSI_OPCODE_PUSHA
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
804 {TGSI_OPCODE_POPA
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
805 {TGSI_OPCODE_CEIL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
806 {TGSI_OPCODE_I2F
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
807 {TGSI_OPCODE_NOT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
808 {TGSI_OPCODE_TRUNC
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
809 {TGSI_OPCODE_SHL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
811 {88, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
812 {TGSI_OPCODE_AND
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
813 {TGSI_OPCODE_OR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
814 {TGSI_OPCODE_MOD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
815 {TGSI_OPCODE_XOR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
816 {TGSI_OPCODE_SAD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
817 {TGSI_OPCODE_TXF
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
818 {TGSI_OPCODE_TXQ
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
819 {TGSI_OPCODE_CONT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
820 {TGSI_OPCODE_EMIT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
821 {TGSI_OPCODE_ENDPRIM
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
822 {TGSI_OPCODE_BGNLOOP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
823 {TGSI_OPCODE_BGNSUB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
824 {TGSI_OPCODE_ENDLOOP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
825 {TGSI_OPCODE_ENDSUB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
827 {103, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
828 {104, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
829 {105, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
830 {106, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
831 {TGSI_OPCODE_NOP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
833 {108, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
834 {109, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
835 {110, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
836 {111, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
837 {TGSI_OPCODE_NRM4
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
838 {TGSI_OPCODE_CALLNZ
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
839 {TGSI_OPCODE_IFC
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
840 {TGSI_OPCODE_BREAKC
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
841 {TGSI_OPCODE_KIL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
}, /* conditional kill */
842 {TGSI_OPCODE_END
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_end
}, /* aka HALT */
844 {118, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
845 {TGSI_OPCODE_F2I
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
846 {TGSI_OPCODE_IDIV
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
847 {TGSI_OPCODE_IMAX
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
848 {TGSI_OPCODE_IMIN
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
849 {TGSI_OPCODE_INEG
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
850 {TGSI_OPCODE_ISGE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
851 {TGSI_OPCODE_ISHR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
852 {TGSI_OPCODE_ISLT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
853 {TGSI_OPCODE_F2U
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
854 {TGSI_OPCODE_U2F
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
855 {TGSI_OPCODE_UADD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
856 {TGSI_OPCODE_UDIV
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
857 {TGSI_OPCODE_UMAD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
858 {TGSI_OPCODE_UMAX
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
859 {TGSI_OPCODE_UMIN
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
860 {TGSI_OPCODE_UMOD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
861 {TGSI_OPCODE_UMUL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
862 {TGSI_OPCODE_USEQ
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
863 {TGSI_OPCODE_USGE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
864 {TGSI_OPCODE_USHR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
865 {TGSI_OPCODE_USLT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
866 {TGSI_OPCODE_USNE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
867 {TGSI_OPCODE_SWITCH
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
868 {TGSI_OPCODE_CASE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
869 {TGSI_OPCODE_DEFAULT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
870 {TGSI_OPCODE_ENDSWITCH
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
871 {TGSI_OPCODE_LAST
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},