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 "tgsi/tgsi_dump.h"
27 #include "util/u_format.h"
28 #include "r600_screen.h"
29 #include "r600_context.h"
30 #include "r600_shader.h"
38 struct r600_shader_tgsi_instruction
;
40 struct r600_shader_ctx
{
41 struct tgsi_shader_info info
;
42 struct tgsi_parse_context parse
;
43 const struct tgsi_token
*tokens
;
45 unsigned file_offset
[TGSI_FILE_COUNT
];
47 struct r600_shader_tgsi_instruction
*inst_info
;
49 struct r600_shader
*shader
;
53 struct r600_shader_tgsi_instruction
{
57 int (*process
)(struct r600_shader_ctx
*ctx
);
60 static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction
[];
61 static int r600_shader_from_tgsi(const struct tgsi_token
*tokens
, struct r600_shader
*shader
);
63 static int r600_shader_update(struct pipe_context
*ctx
, struct r600_shader
*shader
)
65 struct r600_context
*rctx
= r600_context(ctx
);
66 const struct util_format_description
*desc
;
67 enum pipe_format resource_format
[160];
68 unsigned i
, nresources
= 0;
69 struct r600_bc
*bc
= &shader
->bc
;
70 struct r600_bc_cf
*cf
;
71 struct r600_bc_vtx
*vtx
;
73 if (shader
->processor_type
!= TGSI_PROCESSOR_VERTEX
)
75 for (i
= 0; i
< rctx
->vertex_elements
->count
; i
++) {
76 resource_format
[nresources
++] = rctx
->vertex_elements
->elements
[i
].src_format
;
78 LIST_FOR_EACH_ENTRY(cf
, &bc
->cf
, list
) {
80 case V_SQ_CF_WORD1_SQ_CF_INST_VTX
:
81 case V_SQ_CF_WORD1_SQ_CF_INST_VTX_TC
:
82 LIST_FOR_EACH_ENTRY(vtx
, &cf
->vtx
, list
) {
83 desc
= util_format_description(resource_format
[vtx
->buffer_id
]);
85 R600_ERR("unknown format %d\n", resource_format
[vtx
->buffer_id
]);
88 vtx
->dst_sel_x
= desc
->swizzle
[0];
89 vtx
->dst_sel_y
= desc
->swizzle
[1];
90 vtx
->dst_sel_z
= desc
->swizzle
[2];
91 vtx
->dst_sel_w
= desc
->swizzle
[3];
98 return r600_bc_build(&shader
->bc
);
101 int r600_pipe_shader_create(struct pipe_context
*ctx
,
102 struct r600_context_state
*rpshader
,
103 const struct tgsi_token
*tokens
)
105 struct r600_screen
*rscreen
= r600_screen(ctx
->screen
);
108 fprintf(stderr
, "--------------------------------------------------------------\n");
109 tgsi_dump(tokens
, 0);
110 if (rpshader
== NULL
)
112 rpshader
->shader
.family
= radeon_get_family(rscreen
->rw
);
113 r
= r600_shader_from_tgsi(tokens
, &rpshader
->shader
);
115 R600_ERR("translation from TGSI failed !\n");
118 r
= r600_bc_build(&rpshader
->shader
.bc
);
120 R600_ERR("building bytecode failed !\n");
123 fprintf(stderr
, "______________________________________________________________\n");
127 static int r600_pipe_shader_vs(struct pipe_context
*ctx
, struct r600_context_state
*rpshader
)
129 struct r600_screen
*rscreen
= r600_screen(ctx
->screen
);
130 struct r600_shader
*rshader
= &rpshader
->shader
;
131 struct radeon_state
*state
;
134 rpshader
->rstate
= radeon_state_decref(rpshader
->rstate
);
135 state
= radeon_state(rscreen
->rw
, R600_VS_SHADER_TYPE
, R600_VS_SHADER
);
138 for (i
= 0; i
< 10; i
++) {
139 state
->states
[R600_VS_SHADER__SPI_VS_OUT_ID_0
+ i
] = 0;
141 for (i
= 0, j
= 0; i
< rshader
->noutput
; i
++) {
142 if (rshader
->output
[i
].name
!= TGSI_SEMANTIC_POSITION
) {
143 tmp
= rshader
->output
[i
].sid
<< ((j
& 3) * 8);
144 state
->states
[R600_VS_SHADER__SPI_VS_OUT_ID_0
+ j
/ 4] |= tmp
;
148 state
->states
[R600_VS_SHADER__SPI_VS_OUT_CONFIG
] = S_0286C4_VS_EXPORT_COUNT(rshader
->noutput
- 2);
149 state
->states
[R600_VS_SHADER__SQ_PGM_RESOURCES_VS
] = S_028868_NUM_GPRS(rshader
->bc
.ngpr
);
150 rpshader
->rstate
= state
;
151 rpshader
->rstate
->bo
[0] = radeon_bo_incref(rscreen
->rw
, rpshader
->bo
);
152 rpshader
->rstate
->bo
[1] = radeon_bo_incref(rscreen
->rw
, rpshader
->bo
);
153 rpshader
->rstate
->nbo
= 2;
154 rpshader
->rstate
->placement
[0] = RADEON_GEM_DOMAIN_GTT
;
155 return radeon_state_pm4(state
);
158 static int r600_pipe_shader_ps(struct pipe_context
*ctx
, struct r600_context_state
*rpshader
)
160 struct r600_screen
*rscreen
= r600_screen(ctx
->screen
);
161 struct r600_shader
*rshader
= &rpshader
->shader
;
162 struct radeon_state
*state
;
165 rpshader
->rstate
= radeon_state_decref(rpshader
->rstate
);
166 state
= radeon_state(rscreen
->rw
, R600_PS_SHADER_TYPE
, R600_PS_SHADER
);
169 for (i
= 0; i
< rshader
->ninput
; i
++) {
170 tmp
= S_028644_SEMANTIC(rshader
->input
[i
].sid
);
171 tmp
|= S_028644_SEL_CENTROID(1);
172 if (rshader
->input
[i
].name
== TGSI_SEMANTIC_COLOR
||
173 rshader
->input
[i
].name
== TGSI_SEMANTIC_BCOLOR
) {
174 tmp
|= S_028644_FLAT_SHADE(rshader
->flat_shade
);
176 state
->states
[R600_PS_SHADER__SPI_PS_INPUT_CNTL_0
+ i
] = tmp
;
178 state
->states
[R600_PS_SHADER__SPI_PS_IN_CONTROL_0
] = S_0286CC_NUM_INTERP(rshader
->ninput
) |
179 S_0286CC_PERSP_GRADIENT_ENA(1);
180 state
->states
[R600_PS_SHADER__SPI_PS_IN_CONTROL_1
] = 0x00000000;
181 state
->states
[R600_PS_SHADER__SQ_PGM_RESOURCES_PS
] = S_028868_NUM_GPRS(rshader
->bc
.ngpr
);
182 state
->states
[R600_PS_SHADER__SQ_PGM_EXPORTS_PS
] = 0x00000002;
183 rpshader
->rstate
= state
;
184 rpshader
->rstate
->bo
[0] = radeon_bo_incref(rscreen
->rw
, rpshader
->bo
);
185 rpshader
->rstate
->nbo
= 1;
186 rpshader
->rstate
->placement
[0] = RADEON_GEM_DOMAIN_GTT
;
187 return radeon_state_pm4(state
);
190 static int r600_pipe_shader(struct pipe_context
*ctx
, struct r600_context_state
*rpshader
)
192 struct r600_screen
*rscreen
= r600_screen(ctx
->screen
);
193 struct r600_context
*rctx
= r600_context(ctx
);
194 struct r600_shader
*rshader
= &rpshader
->shader
;
197 /* copy new shader */
198 radeon_bo_decref(rscreen
->rw
, rpshader
->bo
);
200 rpshader
->bo
= radeon_bo(rscreen
->rw
, 0, rshader
->bc
.ndw
* 4,
202 if (rpshader
->bo
== NULL
) {
205 radeon_bo_map(rscreen
->rw
, rpshader
->bo
);
206 memcpy(rpshader
->bo
->data
, rshader
->bc
.bytecode
, rshader
->bc
.ndw
* 4);
207 radeon_bo_unmap(rscreen
->rw
, rpshader
->bo
);
209 rshader
->flat_shade
= rctx
->flat_shade
;
210 switch (rshader
->processor_type
) {
211 case TGSI_PROCESSOR_VERTEX
:
212 r
= r600_pipe_shader_vs(ctx
, rpshader
);
214 case TGSI_PROCESSOR_FRAGMENT
:
215 r
= r600_pipe_shader_ps(ctx
, rpshader
);
224 int r600_pipe_shader_update(struct pipe_context
*ctx
, struct r600_context_state
*rpshader
)
226 struct r600_context
*rctx
= r600_context(ctx
);
229 if (rpshader
== NULL
)
231 /* there should be enough input */
232 if (rctx
->vertex_elements
->count
< rpshader
->shader
.bc
.nresource
) {
233 R600_ERR("%d resources provided, expecting %d\n",
234 rctx
->vertex_elements
->count
, rpshader
->shader
.bc
.nresource
);
237 r
= r600_shader_update(ctx
, &rpshader
->shader
);
240 return r600_pipe_shader(ctx
, rpshader
);
243 static int tgsi_is_supported(struct r600_shader_ctx
*ctx
)
245 struct tgsi_full_instruction
*i
= &ctx
->parse
.FullToken
.FullInstruction
;
248 if (i
->Instruction
.NumDstRegs
> 1) {
249 R600_ERR("too many dst (%d)\n", i
->Instruction
.NumDstRegs
);
252 if (i
->Instruction
.Predicate
) {
253 R600_ERR("predicate unsupported\n");
256 if (i
->Instruction
.Label
) {
257 R600_ERR("label unsupported\n");
260 for (j
= 0; j
< i
->Instruction
.NumSrcRegs
; j
++) {
261 if (i
->Src
[j
].Register
.Indirect
||
262 i
->Src
[j
].Register
.Dimension
||
263 i
->Src
[j
].Register
.Absolute
) {
264 R600_ERR("unsupported src (indirect|dimension|absolute)\n");
268 for (j
= 0; j
< i
->Instruction
.NumDstRegs
; j
++) {
269 if (i
->Dst
[j
].Register
.Indirect
|| i
->Dst
[j
].Register
.Dimension
) {
270 R600_ERR("unsupported dst (indirect|dimension)\n");
277 static int tgsi_declaration(struct r600_shader_ctx
*ctx
)
279 struct tgsi_full_declaration
*d
= &ctx
->parse
.FullToken
.FullDeclaration
;
280 struct r600_bc_vtx vtx
;
284 switch (d
->Declaration
.File
) {
285 case TGSI_FILE_INPUT
:
286 i
= ctx
->shader
->ninput
++;
287 ctx
->shader
->input
[i
].name
= d
->Semantic
.Name
;
288 ctx
->shader
->input
[i
].sid
= d
->Semantic
.Index
;
289 ctx
->shader
->input
[i
].interpolate
= d
->Declaration
.Interpolate
;
290 ctx
->shader
->input
[i
].gpr
= ctx
->file_offset
[TGSI_FILE_INPUT
] + i
;
291 if (ctx
->type
== TGSI_PROCESSOR_VERTEX
) {
292 /* turn input into fetch */
293 memset(&vtx
, 0, sizeof(struct r600_bc_vtx
));
297 /* register containing the index into the buffer */
300 vtx
.mega_fetch_count
= 0x1F;
301 vtx
.dst_gpr
= ctx
->shader
->input
[i
].gpr
;
306 r
= r600_bc_add_vtx(ctx
->bc
, &vtx
);
311 case TGSI_FILE_OUTPUT
:
312 i
= ctx
->shader
->noutput
++;
313 ctx
->shader
->output
[i
].name
= d
->Semantic
.Name
;
314 ctx
->shader
->output
[i
].sid
= d
->Semantic
.Index
;
315 ctx
->shader
->output
[i
].gpr
= ctx
->file_offset
[TGSI_FILE_OUTPUT
] + i
;
316 ctx
->shader
->output
[i
].interpolate
= d
->Declaration
.Interpolate
;
318 case TGSI_FILE_CONSTANT
:
319 case TGSI_FILE_TEMPORARY
:
320 case TGSI_FILE_SAMPLER
:
323 R600_ERR("unsupported file %d declaration\n", d
->Declaration
.File
);
329 int r600_shader_from_tgsi(const struct tgsi_token
*tokens
, struct r600_shader
*shader
)
331 struct tgsi_full_immediate
*immediate
;
332 struct r600_shader_ctx ctx
;
333 struct r600_bc_output output
;
337 ctx
.bc
= &shader
->bc
;
339 r
= r600_bc_init(ctx
.bc
, shader
->family
);
343 tgsi_scan_shader(tokens
, &ctx
.info
);
344 tgsi_parse_init(&ctx
.parse
, tokens
);
345 ctx
.type
= ctx
.parse
.FullHeader
.Processor
.Processor
;
346 shader
->processor_type
= ctx
.type
;
348 /* register allocations */
349 /* Values [0,127] correspond to GPR[0..127].
350 * Values [256,511] correspond to cfile constants c[0..255].
351 * Other special values are shown in the list below.
352 * 248 SQ_ALU_SRC_0: special constant 0.0.
353 * 249 SQ_ALU_SRC_1: special constant 1.0 float.
354 * 250 SQ_ALU_SRC_1_INT: special constant 1 integer.
355 * 251 SQ_ALU_SRC_M_1_INT: special constant -1 integer.
356 * 252 SQ_ALU_SRC_0_5: special constant 0.5 float.
357 * 253 SQ_ALU_SRC_LITERAL: literal constant.
358 * 254 SQ_ALU_SRC_PV: previous vector result.
359 * 255 SQ_ALU_SRC_PS: previous scalar result.
361 for (i
= 0; i
< TGSI_FILE_COUNT
; i
++) {
362 ctx
.file_offset
[i
] = 0;
364 if (ctx
.type
== TGSI_PROCESSOR_VERTEX
) {
365 ctx
.file_offset
[TGSI_FILE_INPUT
] = 1;
367 ctx
.file_offset
[TGSI_FILE_OUTPUT
] = ctx
.file_offset
[TGSI_FILE_INPUT
] +
368 ctx
.info
.file_count
[TGSI_FILE_INPUT
];
369 ctx
.file_offset
[TGSI_FILE_TEMPORARY
] = ctx
.file_offset
[TGSI_FILE_OUTPUT
] +
370 ctx
.info
.file_count
[TGSI_FILE_OUTPUT
];
371 ctx
.file_offset
[TGSI_FILE_CONSTANT
] = 256;
372 ctx
.file_offset
[TGSI_FILE_IMMEDIATE
] = 253;
373 ctx
.temp_reg
= ctx
.file_offset
[TGSI_FILE_TEMPORARY
] +
374 ctx
.info
.file_count
[TGSI_FILE_TEMPORARY
];
376 while (!tgsi_parse_end_of_tokens(&ctx
.parse
)) {
377 tgsi_parse_token(&ctx
.parse
);
378 switch (ctx
.parse
.FullToken
.Token
.Type
) {
379 case TGSI_TOKEN_TYPE_IMMEDIATE
:
380 immediate
= &ctx
.parse
.FullToken
.FullImmediate
;
381 ctx
.value
[0] = immediate
->u
[0].Uint
;
382 ctx
.value
[1] = immediate
->u
[1].Uint
;
383 ctx
.value
[2] = immediate
->u
[2].Uint
;
384 ctx
.value
[3] = immediate
->u
[3].Uint
;
386 case TGSI_TOKEN_TYPE_DECLARATION
:
387 r
= tgsi_declaration(&ctx
);
391 case TGSI_TOKEN_TYPE_INSTRUCTION
:
392 r
= tgsi_is_supported(&ctx
);
395 opcode
= ctx
.parse
.FullToken
.FullInstruction
.Instruction
.Opcode
;
396 ctx
.inst_info
= &r600_shader_tgsi_instruction
[opcode
];
397 r
= ctx
.inst_info
->process(&ctx
);
400 r
= r600_bc_add_literal(ctx
.bc
, ctx
.value
);
405 R600_ERR("unsupported token type %d\n", ctx
.parse
.FullToken
.Token
.Type
);
411 for (i
= 0, pos0
= 0; i
< shader
->noutput
; i
++) {
412 memset(&output
, 0, sizeof(struct r600_bc_output
));
413 output
.gpr
= shader
->output
[i
].gpr
;
414 output
.elem_size
= 3;
415 output
.swizzle_x
= 0;
416 output
.swizzle_y
= 1;
417 output
.swizzle_z
= 2;
418 output
.swizzle_w
= 3;
420 output
.type
= V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PARAM
;
421 output
.array_base
= i
- pos0
;
422 output
.inst
= V_SQ_CF_ALLOC_EXPORT_WORD1_SQ_CF_INST_EXPORT_DONE
;
423 switch (ctx
.type
== TGSI_PROCESSOR_VERTEX
) {
424 case TGSI_PROCESSOR_VERTEX
:
425 if (shader
->output
[i
].name
== TGSI_SEMANTIC_POSITION
) {
426 output
.array_base
= 60;
427 output
.type
= V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_POS
;
428 /* position doesn't count in array_base */
432 case TGSI_PROCESSOR_FRAGMENT
:
433 if (shader
->output
[i
].name
== TGSI_SEMANTIC_COLOR
) {
434 output
.array_base
= 0;
435 output
.type
= V_SQ_CF_ALLOC_EXPORT_WORD0_SQ_EXPORT_PIXEL
;
437 R600_ERR("unsupported fragment output name %d\n", shader
->output
[i
].name
);
443 R600_ERR("unsupported processor type %d\n", ctx
.type
);
447 if (i
== (shader
->noutput
- 1)) {
448 output
.end_of_program
= 1;
450 r
= r600_bc_add_output(ctx
.bc
, &output
);
454 tgsi_parse_free(&ctx
.parse
);
457 tgsi_parse_free(&ctx
.parse
);
461 static int tgsi_unsupported(struct r600_shader_ctx
*ctx
)
463 R600_ERR("%d tgsi opcode unsupported\n", ctx
->inst_info
->tgsi_opcode
);
467 static int tgsi_end(struct r600_shader_ctx
*ctx
)
472 static int tgsi_src(struct r600_shader_ctx
*ctx
,
473 const struct tgsi_full_src_register
*tgsi_src
,
475 struct r600_bc_alu_src
*r600_src
)
477 r600_src
->sel
= tgsi_src
->Register
.Index
;
478 if (tgsi_src
->Register
.File
== TGSI_FILE_IMMEDIATE
) {
481 r600_src
->sel
+= ctx
->file_offset
[tgsi_src
->Register
.File
];
484 r600_src
->chan
= tgsi_src
->Register
.SwizzleX
;
487 r600_src
->chan
= tgsi_src
->Register
.SwizzleY
;
490 r600_src
->chan
= tgsi_src
->Register
.SwizzleZ
;
493 r600_src
->chan
= tgsi_src
->Register
.SwizzleW
;
501 static int tgsi_dst(struct r600_shader_ctx
*ctx
,
502 const struct tgsi_full_dst_register
*tgsi_dst
,
504 struct r600_bc_alu_dst
*r600_dst
)
506 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
508 r600_dst
->sel
= tgsi_dst
->Register
.Index
;
509 r600_dst
->sel
+= ctx
->file_offset
[tgsi_dst
->Register
.File
];
510 r600_dst
->chan
= swizzle
;
512 if (inst
->Instruction
.Saturate
) {
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
:
544 case TGSI_OPCODE_ABS
:
553 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
560 static int tgsi_slt(struct r600_shader_ctx
*ctx
)
562 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
563 struct r600_bc_alu alu
;
566 for (i
= 0; i
< 4; i
++) {
567 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
568 if (!(inst
->Dst
[0].Register
.WriteMask
& (1 << i
))) {
569 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
;
571 alu
.inst
= ctx
->inst_info
->r600_opcode
;
572 r
= tgsi_src(ctx
, &inst
->Src
[0], i
, &alu
.src
[1]);
575 r
= tgsi_src(ctx
, &inst
->Src
[1], i
, &alu
.src
[0]);
578 r
= tgsi_dst(ctx
, &inst
->Dst
[0], i
, &alu
.dst
);
585 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
592 static int tgsi_lit(struct r600_shader_ctx
*ctx
)
594 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
595 struct r600_bc_alu alu
;
598 if (inst
->Dst
[0].Register
.WriteMask
& (1 << 0))
601 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
602 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV
;
603 alu
.src
[0].sel
= 249; /*1.0*/
605 r
= tgsi_dst(ctx
, &inst
->Dst
[0], 0, &alu
.dst
);
608 if ((inst
->Dst
[0].Register
.WriteMask
& 0xe) == 0)
610 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
616 if (inst
->Dst
[0].Register
.WriteMask
& (1 << 1))
618 /* dst.y = max(src.x, 0.0) */
619 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
620 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MAX
;
621 r
= tgsi_src(ctx
, &inst
->Src
[0], 0, &alu
.src
[0]);
624 alu
.src
[1].sel
= 248; /*0.0*/
626 r
= tgsi_dst(ctx
, &inst
->Dst
[0], 1, &alu
.dst
);
629 if ((inst
->Dst
[0].Register
.WriteMask
& 0xa) == 0)
631 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
636 if (inst
->Dst
[0].Register
.WriteMask
& (1 << 3))
639 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
640 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV
;
641 alu
.src
[0].sel
= 249;
643 r
= tgsi_dst(ctx
, &inst
->Dst
[0], 3, &alu
.dst
);
646 if ((inst
->Dst
[0].Register
.WriteMask
& 0x4) == 0)
648 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
653 if (inst
->Dst
[0].Register
.WriteMask
& (1 << 2))
658 /* dst.z = log(src.y) */
659 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
660 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_CLAMPED
;
661 r
= tgsi_src(ctx
, &inst
->Src
[0], 1, &alu
.src
[0]);
664 r
= tgsi_dst(ctx
, &inst
->Dst
[0], 2, &alu
.dst
);
668 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
675 /* tmp.x = amd MUL_LIT(src.w, dst.z, src.x ) */
676 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
677 alu
.inst
= V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MUL_LIT
;
678 r
= tgsi_src(ctx
, &inst
->Src
[0], 3, &alu
.src
[0]);
681 alu
.src
[1].sel
= sel
;
682 alu
.src
[1].chan
= chan
;
683 r
= tgsi_src(ctx
, &inst
->Src
[0], 0, &alu
.src
[2]);
686 alu
.dst
.sel
= ctx
->temp_reg
;
691 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
695 /* dst.z = exp(tmp.x) */
696 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
697 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE
;
698 alu
.src
[0].sel
= ctx
->temp_reg
;
700 r
= tgsi_dst(ctx
, &inst
->Dst
[0], 2, &alu
.dst
);
704 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
711 static int tgsi_trans(struct r600_shader_ctx
*ctx
)
713 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
714 struct r600_bc_alu alu
;
717 for (i
= 0; i
< 4; i
++) {
718 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
719 if (inst
->Dst
[0].Register
.WriteMask
& (1 << i
)) {
720 alu
.inst
= ctx
->inst_info
->r600_opcode
;
721 for (j
= 0; j
< inst
->Instruction
.NumSrcRegs
; j
++) {
722 r
= tgsi_src(ctx
, &inst
->Src
[j
], i
, &alu
.src
[j
]);
726 r
= tgsi_dst(ctx
, &inst
->Dst
[0], i
, &alu
.dst
);
730 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
738 static int tgsi_helper_copy(struct r600_shader_ctx
*ctx
, struct tgsi_full_instruction
*inst
)
740 struct r600_bc_alu alu
;
743 r
= r600_bc_add_literal(ctx
->bc
, ctx
->value
);
746 for (i
= 0; i
< 4; i
++) {
747 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
748 if (!(inst
->Dst
[0].Register
.WriteMask
& (1 << i
))) {
749 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
;
751 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV
;
752 r
= tgsi_dst(ctx
, &inst
->Dst
[0], i
, &alu
.dst
);
755 alu
.src
[0].sel
= ctx
->temp_reg
;
761 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
768 static int tgsi_op3(struct r600_shader_ctx
*ctx
)
770 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
771 struct r600_bc_alu alu
;
774 /* do it in 2 step as op3 doesn't support writemask */
775 for (i
= 0; i
< 4; i
++) {
776 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
777 alu
.inst
= ctx
->inst_info
->r600_opcode
;
778 for (j
= 0; j
< inst
->Instruction
.NumSrcRegs
; j
++) {
779 r
= tgsi_src(ctx
, &inst
->Src
[j
], i
, &alu
.src
[j
]);
783 alu
.dst
.sel
= ctx
->temp_reg
;
790 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
794 return tgsi_helper_copy(ctx
, inst
);
797 static int tgsi_dp(struct r600_shader_ctx
*ctx
)
799 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
800 struct r600_bc_alu alu
;
803 for (i
= 0; i
< 4; i
++) {
804 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
805 alu
.inst
= ctx
->inst_info
->r600_opcode
;
806 for (j
= 0; j
< inst
->Instruction
.NumSrcRegs
; j
++) {
807 r
= tgsi_src(ctx
, &inst
->Src
[j
], i
, &alu
.src
[j
]);
811 alu
.dst
.sel
= ctx
->temp_reg
;
814 /* handle some special cases */
815 switch (ctx
->inst_info
->tgsi_opcode
) {
816 case TGSI_OPCODE_DP2
:
818 alu
.src
[0].sel
= alu
.src
[1].sel
= 248;
819 alu
.src
[0].chan
= alu
.src
[1].chan
= 0;
822 case TGSI_OPCODE_DP3
:
824 alu
.src
[0].sel
= alu
.src
[1].sel
= 248;
825 alu
.src
[0].chan
= alu
.src
[1].chan
= 0;
834 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
838 return tgsi_helper_copy(ctx
, inst
);
841 static int tgsi_tex(struct r600_shader_ctx
*ctx
)
843 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
844 struct r600_bc_tex tex
;
845 struct r600_bc_alu alu
;
849 src_gpr
= ctx
->file_offset
[inst
->Src
[0].Register
.File
] + inst
->Src
[0].Register
.Index
;
851 /* Add perspective divide */
852 if (ctx
->inst_info
->tgsi_opcode
== TGSI_OPCODE_TXP
) {
853 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
854 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE
;
855 alu
.src
[0].sel
= src_gpr
;
857 alu
.dst
.sel
= ctx
->temp_reg
;
861 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
865 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
866 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL
;
867 alu
.src
[0].sel
= ctx
->temp_reg
;
869 alu
.src
[1].sel
= src_gpr
;
871 alu
.dst
.sel
= ctx
->temp_reg
;
874 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
877 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
878 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL
;
879 alu
.src
[0].sel
= ctx
->temp_reg
;
881 alu
.src
[1].sel
= src_gpr
;
883 alu
.dst
.sel
= ctx
->temp_reg
;
886 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
889 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
890 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL
;
891 alu
.src
[0].sel
= ctx
->temp_reg
;
893 alu
.src
[1].sel
= src_gpr
;
895 alu
.dst
.sel
= ctx
->temp_reg
;
898 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
901 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
902 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV
;
903 alu
.src
[0].sel
= 249;
905 alu
.dst
.sel
= ctx
->temp_reg
;
909 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
912 src_gpr
= ctx
->temp_reg
;
915 /* TODO use temp if src_gpr is not a temporary reg (File != TEMPORARY) */
916 memset(&tex
, 0, sizeof(struct r600_bc_tex
));
917 tex
.inst
= ctx
->inst_info
->r600_opcode
;
918 tex
.resource_id
= ctx
->file_offset
[inst
->Src
[1].Register
.File
] + inst
->Src
[1].Register
.Index
;
919 tex
.sampler_id
= tex
.resource_id
;
920 tex
.src_gpr
= src_gpr
;
921 tex
.dst_gpr
= ctx
->file_offset
[inst
->Dst
[0].Register
.File
] + inst
->Src
[0].Register
.Index
;
930 tex
.coord_type_x
= 1;
931 tex
.coord_type_y
= 1;
932 tex
.coord_type_z
= 1;
933 tex
.coord_type_w
= 1;
934 return r600_bc_add_tex(ctx
->bc
, &tex
);
937 static int tgsi_lrp(struct r600_shader_ctx
*ctx
)
939 struct tgsi_full_instruction
*inst
= &ctx
->parse
.FullToken
.FullInstruction
;
940 struct r600_bc_alu alu
;
945 for (i
= 0; i
< 4; i
++) {
946 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
947 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD
;
948 alu
.src
[0].sel
= 249;
950 r
= tgsi_src(ctx
, &inst
->Src
[0], i
, &alu
.src
[1]);
954 alu
.dst
.sel
= ctx
->temp_reg
;
960 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
964 r
= r600_bc_add_literal(ctx
->bc
, ctx
->value
);
968 /* (1 - src0) * src2 */
969 for (i
= 0; i
< 4; i
++) {
970 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
971 alu
.inst
= V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL
;
972 alu
.src
[0].sel
= ctx
->temp_reg
;
974 r
= tgsi_src(ctx
, &inst
->Src
[2], i
, &alu
.src
[1]);
977 alu
.dst
.sel
= ctx
->temp_reg
;
983 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
987 r
= r600_bc_add_literal(ctx
->bc
, ctx
->value
);
991 /* src0 * src1 + (1 - src0) * src2 */
992 for (i
= 0; i
< 4; i
++) {
993 memset(&alu
, 0, sizeof(struct r600_bc_alu
));
994 alu
.inst
= V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MULADD
;
996 r
= tgsi_src(ctx
, &inst
->Src
[0], i
, &alu
.src
[0]);
999 r
= tgsi_src(ctx
, &inst
->Src
[1], i
, &alu
.src
[1]);
1002 alu
.src
[2].sel
= ctx
->temp_reg
;
1003 alu
.src
[2].chan
= i
;
1004 alu
.dst
.sel
= ctx
->temp_reg
;
1009 r
= r600_bc_add_alu(ctx
->bc
, &alu
);
1013 return tgsi_helper_copy(ctx
, inst
);
1016 static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction
[] = {
1017 {TGSI_OPCODE_ARL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1018 {TGSI_OPCODE_MOV
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV
, tgsi_op2
},
1019 {TGSI_OPCODE_LIT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_lit
},
1020 {TGSI_OPCODE_RCP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1021 {TGSI_OPCODE_RSQ
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIPSQRT_IEEE
, tgsi_trans
},
1022 {TGSI_OPCODE_EXP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1023 {TGSI_OPCODE_LOG
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1024 {TGSI_OPCODE_MUL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL
, tgsi_op2
},
1025 {TGSI_OPCODE_ADD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD
, tgsi_op2
},
1026 {TGSI_OPCODE_DP3
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4
, tgsi_dp
},
1027 {TGSI_OPCODE_DP4
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4
, tgsi_dp
},
1028 {TGSI_OPCODE_DST
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1029 {TGSI_OPCODE_MIN
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1030 {TGSI_OPCODE_MAX
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MAX
, tgsi_op2
},
1031 {TGSI_OPCODE_SLT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SETGT
, tgsi_slt
},
1032 {TGSI_OPCODE_SGE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1033 {TGSI_OPCODE_MAD
, 1, V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MULADD
, tgsi_op3
},
1034 {TGSI_OPCODE_SUB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD
, tgsi_op2
},
1035 {TGSI_OPCODE_LRP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_lrp
},
1036 {TGSI_OPCODE_CND
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1038 {20, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1039 {TGSI_OPCODE_DP2A
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1041 {22, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1042 {23, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1043 {TGSI_OPCODE_FRC
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1044 {TGSI_OPCODE_CLAMP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1045 {TGSI_OPCODE_FLR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1046 {TGSI_OPCODE_ROUND
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1047 {TGSI_OPCODE_EX2
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE
, tgsi_trans
},
1048 {TGSI_OPCODE_LG2
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1049 {TGSI_OPCODE_POW
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1050 {TGSI_OPCODE_XPD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1052 {32, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1053 {TGSI_OPCODE_ABS
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV
, tgsi_op2
},
1054 {TGSI_OPCODE_RCC
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1055 {TGSI_OPCODE_DPH
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1056 {TGSI_OPCODE_COS
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1057 {TGSI_OPCODE_DDX
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1058 {TGSI_OPCODE_DDY
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1059 {TGSI_OPCODE_KILP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
}, /* predicated kill */
1060 {TGSI_OPCODE_PK2H
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1061 {TGSI_OPCODE_PK2US
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1062 {TGSI_OPCODE_PK4B
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1063 {TGSI_OPCODE_PK4UB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1064 {TGSI_OPCODE_RFL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1065 {TGSI_OPCODE_SEQ
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1066 {TGSI_OPCODE_SFL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1067 {TGSI_OPCODE_SGT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1068 {TGSI_OPCODE_SIN
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1069 {TGSI_OPCODE_SLE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1070 {TGSI_OPCODE_SNE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1071 {TGSI_OPCODE_STR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1072 {TGSI_OPCODE_TEX
, 0, 0x10, tgsi_tex
},
1073 {TGSI_OPCODE_TXD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1074 {TGSI_OPCODE_TXP
, 0, 0x10, tgsi_tex
},
1075 {TGSI_OPCODE_UP2H
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1076 {TGSI_OPCODE_UP2US
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1077 {TGSI_OPCODE_UP4B
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1078 {TGSI_OPCODE_UP4UB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1079 {TGSI_OPCODE_X2D
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1080 {TGSI_OPCODE_ARA
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1081 {TGSI_OPCODE_ARR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1082 {TGSI_OPCODE_BRA
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1083 {TGSI_OPCODE_CAL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1084 {TGSI_OPCODE_RET
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1085 {TGSI_OPCODE_SSG
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
}, /* SGN */
1086 {TGSI_OPCODE_CMP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1087 {TGSI_OPCODE_SCS
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1088 {TGSI_OPCODE_TXB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1089 {TGSI_OPCODE_NRM
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1090 {TGSI_OPCODE_DIV
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1091 {TGSI_OPCODE_DP2
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4
, tgsi_dp
},
1092 {TGSI_OPCODE_TXL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1093 {TGSI_OPCODE_BRK
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1094 {TGSI_OPCODE_IF
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1096 {75, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1097 {76, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1098 {TGSI_OPCODE_ELSE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1099 {TGSI_OPCODE_ENDIF
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1101 {79, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1102 {80, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1103 {TGSI_OPCODE_PUSHA
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1104 {TGSI_OPCODE_POPA
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1105 {TGSI_OPCODE_CEIL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1106 {TGSI_OPCODE_I2F
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1107 {TGSI_OPCODE_NOT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1108 {TGSI_OPCODE_TRUNC
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1109 {TGSI_OPCODE_SHL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1111 {88, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1112 {TGSI_OPCODE_AND
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1113 {TGSI_OPCODE_OR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1114 {TGSI_OPCODE_MOD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1115 {TGSI_OPCODE_XOR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1116 {TGSI_OPCODE_SAD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1117 {TGSI_OPCODE_TXF
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1118 {TGSI_OPCODE_TXQ
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1119 {TGSI_OPCODE_CONT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1120 {TGSI_OPCODE_EMIT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1121 {TGSI_OPCODE_ENDPRIM
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1122 {TGSI_OPCODE_BGNLOOP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1123 {TGSI_OPCODE_BGNSUB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1124 {TGSI_OPCODE_ENDLOOP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1125 {TGSI_OPCODE_ENDSUB
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1127 {103, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1128 {104, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1129 {105, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1130 {106, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1131 {TGSI_OPCODE_NOP
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1133 {108, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1134 {109, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1135 {110, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1136 {111, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1137 {TGSI_OPCODE_NRM4
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1138 {TGSI_OPCODE_CALLNZ
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1139 {TGSI_OPCODE_IFC
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1140 {TGSI_OPCODE_BREAKC
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1141 {TGSI_OPCODE_KIL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
}, /* conditional kill */
1142 {TGSI_OPCODE_END
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_end
}, /* aka HALT */
1144 {118, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1145 {TGSI_OPCODE_F2I
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1146 {TGSI_OPCODE_IDIV
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1147 {TGSI_OPCODE_IMAX
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1148 {TGSI_OPCODE_IMIN
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1149 {TGSI_OPCODE_INEG
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1150 {TGSI_OPCODE_ISGE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1151 {TGSI_OPCODE_ISHR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1152 {TGSI_OPCODE_ISLT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1153 {TGSI_OPCODE_F2U
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1154 {TGSI_OPCODE_U2F
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1155 {TGSI_OPCODE_UADD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1156 {TGSI_OPCODE_UDIV
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1157 {TGSI_OPCODE_UMAD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1158 {TGSI_OPCODE_UMAX
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1159 {TGSI_OPCODE_UMIN
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1160 {TGSI_OPCODE_UMOD
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1161 {TGSI_OPCODE_UMUL
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1162 {TGSI_OPCODE_USEQ
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1163 {TGSI_OPCODE_USGE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1164 {TGSI_OPCODE_USHR
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1165 {TGSI_OPCODE_USLT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1166 {TGSI_OPCODE_USNE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1167 {TGSI_OPCODE_SWITCH
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1168 {TGSI_OPCODE_CASE
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1169 {TGSI_OPCODE_DEFAULT
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1170 {TGSI_OPCODE_ENDSWITCH
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},
1171 {TGSI_OPCODE_LAST
, 0, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP
, tgsi_unsupported
},