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.
28 #include <tgsi/tgsi_parse.h>
29 #include <tgsi/tgsi_scan.h>
30 #include "r600_shader.h"
31 #include "r600_context.h"
34 struct c_vector
**v
[TGSI_FILE_COUNT
];
35 struct tgsi_shader_info info
;
36 struct tgsi_parse_context parser
;
37 const struct tgsi_token
*tokens
;
38 struct c_shader
*shader
;
42 static unsigned tgsi_file_to_c_file(unsigned file
);
43 static unsigned tgsi_sname_to_c_sname(unsigned sname
);
44 static int tgsi_opcode_to_c_opcode(unsigned opcode
, unsigned *copcode
);
46 static int tgsi_shader_init(struct tgsi_shader
*ts
,
47 const struct tgsi_token
*tokens
,
48 struct c_shader
*shader
)
54 tgsi_scan_shader(ts
->tokens
, &ts
->info
);
55 tgsi_parse_init(&ts
->parser
, ts
->tokens
);
56 /* initialize to NULL in case of error */
57 for (i
= 0; i
< C_FILE_COUNT
; i
++) {
60 for (i
= 0; i
< TGSI_FILE_COUNT
; i
++) {
61 if (ts
->info
.file_count
[i
] > 0) {
62 ts
->v
[i
] = calloc(ts
->info
.file_count
[i
], sizeof(void*));
63 if (ts
->v
[i
] == NULL
) {
64 fprintf(stderr
, "%s:%d unsupported %d %d\n", __func__
, __LINE__
, i
, ts
->info
.file_count
[i
]);
72 static void tgsi_shader_destroy(struct tgsi_shader
*ts
)
76 for (i
= 0; i
< TGSI_FILE_COUNT
; i
++) {
79 tgsi_parse_free(&ts
->parser
);
82 static int ntransform_declaration(struct tgsi_shader
*ts
)
84 struct tgsi_full_declaration
*fd
= &ts
->parser
.FullToken
.FullDeclaration
;
91 if (fd
->Declaration
.Dimension
) {
92 fprintf(stderr
, "%s:%d unsupported\n", __func__
, __LINE__
);
95 for (i
= fd
->Range
.First
; i
<= fd
->Range
.Last
; i
++) {
97 name
= C_SEMANTIC_GENERIC
;
98 file
= tgsi_file_to_c_file(fd
->Declaration
.File
);
99 if (file
== TGSI_FILE_NULL
) {
100 fprintf(stderr
, "%s:%d unsupported\n", __func__
, __LINE__
);
103 if (fd
->Declaration
.Semantic
) {
104 name
= tgsi_sname_to_c_sname(fd
->Semantic
.Name
);
105 sid
= fd
->Semantic
.Index
;
107 v
= c_shader_vector_new(ts
->shader
, file
, name
, sid
);
109 fprintf(stderr
, "%s:%d unsupported\n", __func__
, __LINE__
);
112 ts
->v
[fd
->Declaration
.File
][i
] = v
;
117 static int ntransform_immediate(struct tgsi_shader
*ts
)
119 struct tgsi_full_immediate
*fd
= &ts
->parser
.FullToken
.FullImmediate
;
124 if (fd
->Immediate
.DataType
!= TGSI_IMM_FLOAT32
) {
125 fprintf(stderr
, "%s:%d unsupported\n", __func__
, __LINE__
);
128 name
= C_SEMANTIC_GENERIC
;
129 file
= C_FILE_IMMEDIATE
;
130 v
= c_shader_vector_new(ts
->shader
, file
, name
, 0);
132 fprintf(stderr
, "%s:%d unsupported\n", __func__
, __LINE__
);
135 v
->channel
[0]->value
= fd
->u
[0].Uint
;
136 v
->channel
[1]->value
= fd
->u
[1].Uint
;
137 v
->channel
[2]->value
= fd
->u
[2].Uint
;
138 v
->channel
[3]->value
= fd
->u
[3].Uint
;
139 ts
->v
[TGSI_FILE_IMMEDIATE
][0] = v
;
143 static int ntransform_instruction(struct tgsi_shader
*ts
)
145 struct tgsi_full_instruction
*fi
= &ts
->parser
.FullToken
.FullInstruction
;
146 struct c_shader
*shader
= ts
->shader
;
147 struct c_instruction instruction
;
151 if (fi
->Instruction
.NumDstRegs
> 1) {
152 fprintf(stderr
, "%s %d unsupported\n", __func__
, __LINE__
);
155 if (fi
->Instruction
.Saturate
) {
156 fprintf(stderr
, "%s %d unsupported\n", __func__
, __LINE__
);
159 if (fi
->Instruction
.Predicate
) {
160 fprintf(stderr
, "%s %d unsupported\n", __func__
, __LINE__
);
163 if (fi
->Instruction
.Label
) {
164 fprintf(stderr
, "%s %d unsupported\n", __func__
, __LINE__
);
167 if (fi
->Instruction
.Texture
) {
168 fprintf(stderr
, "%s %d unsupported\n", __func__
, __LINE__
);
171 for (i
= 0; i
< fi
->Instruction
.NumSrcRegs
; i
++) {
172 if (fi
->Src
[i
].Register
.Indirect
||
173 fi
->Src
[i
].Register
.Dimension
||
174 fi
->Src
[i
].Register
.Absolute
) {
175 fprintf(stderr
, "%s %d unsupported\n", __func__
, __LINE__
);
179 for (i
= 0; i
< fi
->Instruction
.NumDstRegs
; i
++) {
180 if (fi
->Dst
[i
].Register
.Indirect
|| fi
->Dst
[i
].Register
.Dimension
) {
181 fprintf(stderr
, "%s %d unsupported\n", __func__
, __LINE__
);
185 r
= tgsi_opcode_to_c_opcode(fi
->Instruction
.Opcode
, &opcode
);
187 fprintf(stderr
, "%s:%d unsupported\n", __func__
, __LINE__
);
190 if (opcode
== C_OPCODE_END
) {
191 return c_node_cfg_link(ts
->node
, &shader
->end
);
193 /* FIXME add flow instruction handling */
194 memset(&instruction
, 0, sizeof(struct c_instruction
));
196 for (j
= 0; j
< 4; j
++) {
197 instruction
.op
[instruction
.nop
].opcode
= opcode
;
198 instruction
.op
[instruction
.nop
].ninput
= fi
->Instruction
.NumSrcRegs
;
199 for (i
= 0; i
< fi
->Instruction
.NumSrcRegs
; i
++) {
200 instruction
.op
[instruction
.nop
].input
[i
].vector
= ts
->v
[fi
->Src
[i
].Register
.File
][fi
->Src
[i
].Register
.Index
];
203 instruction
.op
[instruction
.nop
].input
[i
].swizzle
= fi
->Src
[i
].Register
.SwizzleX
;
206 instruction
.op
[instruction
.nop
].input
[i
].swizzle
= fi
->Src
[i
].Register
.SwizzleY
;
209 instruction
.op
[instruction
.nop
].input
[i
].swizzle
= fi
->Src
[i
].Register
.SwizzleZ
;
212 instruction
.op
[instruction
.nop
].input
[i
].swizzle
= fi
->Src
[i
].Register
.SwizzleW
;
218 instruction
.op
[instruction
.nop
].output
.vector
= ts
->v
[fi
->Dst
[0].Register
.File
][fi
->Dst
[0].Register
.Index
];
221 instruction
.op
[instruction
.nop
].output
.swizzle
= (fi
->Dst
[0].Register
.WriteMask
& 0x1) ? C_SWIZZLE_X
: C_SWIZZLE_D
;
224 instruction
.op
[instruction
.nop
].output
.swizzle
= (fi
->Dst
[0].Register
.WriteMask
& 0x1) ? C_SWIZZLE_Y
: C_SWIZZLE_D
;
227 instruction
.op
[instruction
.nop
].output
.swizzle
= (fi
->Dst
[0].Register
.WriteMask
& 0x1) ? C_SWIZZLE_Z
: C_SWIZZLE_D
;
230 instruction
.op
[instruction
.nop
].output
.swizzle
= (fi
->Dst
[0].Register
.WriteMask
& 0x1) ? C_SWIZZLE_W
: C_SWIZZLE_D
;
237 return c_node_add_new_instruction(ts
->node
, &instruction
);
240 int c_shader_from_tgsi(struct c_shader
*shader
, unsigned type
,
241 const struct tgsi_token
*tokens
)
243 struct tgsi_shader ts
;
246 c_shader_init(shader
, type
);
247 r
= tgsi_shader_init(&ts
, tokens
, shader
);
251 ts
.node
= &shader
->entry
;
252 while (!tgsi_parse_end_of_tokens(&ts
.parser
)) {
253 tgsi_parse_token(&ts
.parser
);
254 switch (ts
.parser
.FullToken
.Token
.Type
) {
255 case TGSI_TOKEN_TYPE_IMMEDIATE
:
256 r
= ntransform_immediate(&ts
);
260 case TGSI_TOKEN_TYPE_DECLARATION
:
261 r
= ntransform_declaration(&ts
);
265 case TGSI_TOKEN_TYPE_INSTRUCTION
:
266 r
= ntransform_instruction(&ts
);
275 tgsi_shader_destroy(&ts
);
278 c_shader_destroy(shader
);
279 tgsi_shader_destroy(&ts
);
283 static unsigned tgsi_file_to_c_file(unsigned file
)
286 case TGSI_FILE_CONSTANT
:
287 return C_FILE_CONSTANT
;
288 case TGSI_FILE_INPUT
:
290 case TGSI_FILE_OUTPUT
:
291 return C_FILE_OUTPUT
;
292 case TGSI_FILE_TEMPORARY
:
293 return C_FILE_TEMPORARY
;
294 case TGSI_FILE_SAMPLER
:
295 return C_FILE_SAMPLER
;
296 case TGSI_FILE_ADDRESS
:
297 return C_FILE_ADDRESS
;
298 case TGSI_FILE_IMMEDIATE
:
299 return C_FILE_IMMEDIATE
;
300 case TGSI_FILE_PREDICATE
:
301 return C_FILE_PREDICATE
;
302 case TGSI_FILE_SYSTEM_VALUE
:
303 return C_FILE_SYSTEM_VALUE
;
307 fprintf(stderr
, "%s:%d unsupported file %d\n", __func__
, __LINE__
, file
);
312 static unsigned tgsi_sname_to_c_sname(unsigned sname
)
315 case TGSI_SEMANTIC_POSITION
:
316 return C_SEMANTIC_POSITION
;
317 case TGSI_SEMANTIC_COLOR
:
318 return C_SEMANTIC_COLOR
;
319 case TGSI_SEMANTIC_BCOLOR
:
320 return C_SEMANTIC_BCOLOR
;
321 case TGSI_SEMANTIC_FOG
:
322 return C_SEMANTIC_FOG
;
323 case TGSI_SEMANTIC_PSIZE
:
324 return C_SEMANTIC_PSIZE
;
325 case TGSI_SEMANTIC_GENERIC
:
326 return C_SEMANTIC_GENERIC
;
327 case TGSI_SEMANTIC_NORMAL
:
328 return C_SEMANTIC_NORMAL
;
329 case TGSI_SEMANTIC_FACE
:
330 return C_SEMANTIC_FACE
;
331 case TGSI_SEMANTIC_EDGEFLAG
:
332 return C_SEMANTIC_EDGEFLAG
;
333 case TGSI_SEMANTIC_PRIMID
:
334 return C_SEMANTIC_PRIMID
;
335 case TGSI_SEMANTIC_INSTANCEID
:
336 return C_SEMANTIC_INSTANCEID
;
338 return C_SEMANTIC_GENERIC
;
342 static int tgsi_opcode_to_c_opcode(unsigned opcode
, unsigned *copcode
)
345 case TGSI_OPCODE_MOV
:
346 *copcode
= C_OPCODE_MOV
;
348 case TGSI_OPCODE_MUL
:
349 *copcode
= C_OPCODE_MUL
;
351 case TGSI_OPCODE_MAD
:
352 *copcode
= C_OPCODE_MAD
;
354 case TGSI_OPCODE_END
:
355 *copcode
= C_OPCODE_END
;
357 case TGSI_OPCODE_ARL
:
358 *copcode
= C_OPCODE_ARL
;
360 case TGSI_OPCODE_LIT
:
361 *copcode
= C_OPCODE_LIT
;
363 case TGSI_OPCODE_RCP
:
364 *copcode
= C_OPCODE_RCP
;
366 case TGSI_OPCODE_RSQ
:
367 *copcode
= C_OPCODE_RSQ
;
369 case TGSI_OPCODE_EXP
:
370 *copcode
= C_OPCODE_EXP
;
372 case TGSI_OPCODE_LOG
:
373 *copcode
= C_OPCODE_LOG
;
375 case TGSI_OPCODE_ADD
:
376 *copcode
= C_OPCODE_ADD
;
378 case TGSI_OPCODE_DP3
:
379 *copcode
= C_OPCODE_DP3
;
381 case TGSI_OPCODE_DP4
:
382 *copcode
= C_OPCODE_DP4
;
384 case TGSI_OPCODE_DST
:
385 *copcode
= C_OPCODE_DST
;
387 case TGSI_OPCODE_MIN
:
388 *copcode
= C_OPCODE_MIN
;
390 case TGSI_OPCODE_MAX
:
391 *copcode
= C_OPCODE_MAX
;
393 case TGSI_OPCODE_SLT
:
394 *copcode
= C_OPCODE_SLT
;
396 case TGSI_OPCODE_SGE
:
397 *copcode
= C_OPCODE_SGE
;
399 case TGSI_OPCODE_SUB
:
400 *copcode
= C_OPCODE_SUB
;
402 case TGSI_OPCODE_LRP
:
403 *copcode
= C_OPCODE_LRP
;
405 case TGSI_OPCODE_CND
:
406 *copcode
= C_OPCODE_CND
;
408 case TGSI_OPCODE_DP2A
:
409 *copcode
= C_OPCODE_DP2A
;
411 case TGSI_OPCODE_FRC
:
412 *copcode
= C_OPCODE_FRC
;
414 case TGSI_OPCODE_CLAMP
:
415 *copcode
= C_OPCODE_CLAMP
;
417 case TGSI_OPCODE_FLR
:
418 *copcode
= C_OPCODE_FLR
;
420 case TGSI_OPCODE_ROUND
:
421 *copcode
= C_OPCODE_ROUND
;
423 case TGSI_OPCODE_EX2
:
424 *copcode
= C_OPCODE_EX2
;
426 case TGSI_OPCODE_LG2
:
427 *copcode
= C_OPCODE_LG2
;
429 case TGSI_OPCODE_POW
:
430 *copcode
= C_OPCODE_POW
;
432 case TGSI_OPCODE_XPD
:
433 *copcode
= C_OPCODE_XPD
;
435 case TGSI_OPCODE_ABS
:
436 *copcode
= C_OPCODE_ABS
;
438 case TGSI_OPCODE_RCC
:
439 *copcode
= C_OPCODE_RCC
;
441 case TGSI_OPCODE_DPH
:
442 *copcode
= C_OPCODE_DPH
;
444 case TGSI_OPCODE_COS
:
445 *copcode
= C_OPCODE_COS
;
447 case TGSI_OPCODE_DDX
:
448 *copcode
= C_OPCODE_DDX
;
450 case TGSI_OPCODE_DDY
:
451 *copcode
= C_OPCODE_DDY
;
453 case TGSI_OPCODE_KILP
:
454 *copcode
= C_OPCODE_KILP
;
456 case TGSI_OPCODE_PK2H
:
457 *copcode
= C_OPCODE_PK2H
;
459 case TGSI_OPCODE_PK2US
:
460 *copcode
= C_OPCODE_PK2US
;
462 case TGSI_OPCODE_PK4B
:
463 *copcode
= C_OPCODE_PK4B
;
465 case TGSI_OPCODE_PK4UB
:
466 *copcode
= C_OPCODE_PK4UB
;
468 case TGSI_OPCODE_RFL
:
469 *copcode
= C_OPCODE_RFL
;
471 case TGSI_OPCODE_SEQ
:
472 *copcode
= C_OPCODE_SEQ
;
474 case TGSI_OPCODE_SFL
:
475 *copcode
= C_OPCODE_SFL
;
477 case TGSI_OPCODE_SGT
:
478 *copcode
= C_OPCODE_SGT
;
480 case TGSI_OPCODE_SIN
:
481 *copcode
= C_OPCODE_SIN
;
483 case TGSI_OPCODE_SLE
:
484 *copcode
= C_OPCODE_SLE
;
486 case TGSI_OPCODE_SNE
:
487 *copcode
= C_OPCODE_SNE
;
489 case TGSI_OPCODE_STR
:
490 *copcode
= C_OPCODE_STR
;
492 case TGSI_OPCODE_TEX
:
493 *copcode
= C_OPCODE_TEX
;
495 case TGSI_OPCODE_TXD
:
496 *copcode
= C_OPCODE_TXD
;
498 case TGSI_OPCODE_TXP
:
499 *copcode
= C_OPCODE_TXP
;
501 case TGSI_OPCODE_UP2H
:
502 *copcode
= C_OPCODE_UP2H
;
504 case TGSI_OPCODE_UP2US
:
505 *copcode
= C_OPCODE_UP2US
;
507 case TGSI_OPCODE_UP4B
:
508 *copcode
= C_OPCODE_UP4B
;
510 case TGSI_OPCODE_UP4UB
:
511 *copcode
= C_OPCODE_UP4UB
;
513 case TGSI_OPCODE_X2D
:
514 *copcode
= C_OPCODE_X2D
;
516 case TGSI_OPCODE_ARA
:
517 *copcode
= C_OPCODE_ARA
;
519 case TGSI_OPCODE_ARR
:
520 *copcode
= C_OPCODE_ARR
;
522 case TGSI_OPCODE_BRA
:
523 *copcode
= C_OPCODE_BRA
;
525 case TGSI_OPCODE_CAL
:
526 *copcode
= C_OPCODE_CAL
;
528 case TGSI_OPCODE_RET
:
529 *copcode
= C_OPCODE_RET
;
531 case TGSI_OPCODE_SSG
:
532 *copcode
= C_OPCODE_SSG
;
534 case TGSI_OPCODE_CMP
:
535 *copcode
= C_OPCODE_CMP
;
537 case TGSI_OPCODE_SCS
:
538 *copcode
= C_OPCODE_SCS
;
540 case TGSI_OPCODE_TXB
:
541 *copcode
= C_OPCODE_TXB
;
543 case TGSI_OPCODE_NRM
:
544 *copcode
= C_OPCODE_NRM
;
546 case TGSI_OPCODE_DIV
:
547 *copcode
= C_OPCODE_DIV
;
549 case TGSI_OPCODE_DP2
:
550 *copcode
= C_OPCODE_DP2
;
552 case TGSI_OPCODE_TXL
:
553 *copcode
= C_OPCODE_TXL
;
555 case TGSI_OPCODE_BRK
:
556 *copcode
= C_OPCODE_BRK
;
559 *copcode
= C_OPCODE_IF
;
561 case TGSI_OPCODE_ELSE
:
562 *copcode
= C_OPCODE_ELSE
;
564 case TGSI_OPCODE_ENDIF
:
565 *copcode
= C_OPCODE_ENDIF
;
567 case TGSI_OPCODE_PUSHA
:
568 *copcode
= C_OPCODE_PUSHA
;
570 case TGSI_OPCODE_POPA
:
571 *copcode
= C_OPCODE_POPA
;
573 case TGSI_OPCODE_CEIL
:
574 *copcode
= C_OPCODE_CEIL
;
576 case TGSI_OPCODE_I2F
:
577 *copcode
= C_OPCODE_I2F
;
579 case TGSI_OPCODE_NOT
:
580 *copcode
= C_OPCODE_NOT
;
582 case TGSI_OPCODE_TRUNC
:
583 *copcode
= C_OPCODE_TRUNC
;
585 case TGSI_OPCODE_SHL
:
586 *copcode
= C_OPCODE_SHL
;
588 case TGSI_OPCODE_AND
:
589 *copcode
= C_OPCODE_AND
;
592 *copcode
= C_OPCODE_OR
;
594 case TGSI_OPCODE_MOD
:
595 *copcode
= C_OPCODE_MOD
;
597 case TGSI_OPCODE_XOR
:
598 *copcode
= C_OPCODE_XOR
;
600 case TGSI_OPCODE_SAD
:
601 *copcode
= C_OPCODE_SAD
;
603 case TGSI_OPCODE_TXF
:
604 *copcode
= C_OPCODE_TXF
;
606 case TGSI_OPCODE_TXQ
:
607 *copcode
= C_OPCODE_TXQ
;
609 case TGSI_OPCODE_CONT
:
610 *copcode
= C_OPCODE_CONT
;
612 case TGSI_OPCODE_EMIT
:
613 *copcode
= C_OPCODE_EMIT
;
615 case TGSI_OPCODE_ENDPRIM
:
616 *copcode
= C_OPCODE_ENDPRIM
;
618 case TGSI_OPCODE_BGNLOOP
:
619 *copcode
= C_OPCODE_BGNLOOP
;
621 case TGSI_OPCODE_BGNSUB
:
622 *copcode
= C_OPCODE_BGNSUB
;
624 case TGSI_OPCODE_ENDLOOP
:
625 *copcode
= C_OPCODE_ENDLOOP
;
627 case TGSI_OPCODE_ENDSUB
:
628 *copcode
= C_OPCODE_ENDSUB
;
630 case TGSI_OPCODE_NOP
:
631 *copcode
= C_OPCODE_NOP
;
633 case TGSI_OPCODE_NRM4
:
634 *copcode
= C_OPCODE_NRM4
;
636 case TGSI_OPCODE_CALLNZ
:
637 *copcode
= C_OPCODE_CALLNZ
;
639 case TGSI_OPCODE_IFC
:
640 *copcode
= C_OPCODE_IFC
;
642 case TGSI_OPCODE_BREAKC
:
643 *copcode
= C_OPCODE_BREAKC
;
645 case TGSI_OPCODE_KIL
:
646 *copcode
= C_OPCODE_KIL
;
648 case TGSI_OPCODE_F2I
:
649 *copcode
= C_OPCODE_F2I
;
651 case TGSI_OPCODE_IDIV
:
652 *copcode
= C_OPCODE_IDIV
;
654 case TGSI_OPCODE_IMAX
:
655 *copcode
= C_OPCODE_IMAX
;
657 case TGSI_OPCODE_IMIN
:
658 *copcode
= C_OPCODE_IMIN
;
660 case TGSI_OPCODE_INEG
:
661 *copcode
= C_OPCODE_INEG
;
663 case TGSI_OPCODE_ISGE
:
664 *copcode
= C_OPCODE_ISGE
;
666 case TGSI_OPCODE_ISHR
:
667 *copcode
= C_OPCODE_ISHR
;
669 case TGSI_OPCODE_ISLT
:
670 *copcode
= C_OPCODE_ISLT
;
672 case TGSI_OPCODE_F2U
:
673 *copcode
= C_OPCODE_F2U
;
675 case TGSI_OPCODE_U2F
:
676 *copcode
= C_OPCODE_U2F
;
678 case TGSI_OPCODE_UADD
:
679 *copcode
= C_OPCODE_UADD
;
681 case TGSI_OPCODE_UDIV
:
682 *copcode
= C_OPCODE_UDIV
;
684 case TGSI_OPCODE_UMAD
:
685 *copcode
= C_OPCODE_UMAD
;
687 case TGSI_OPCODE_UMAX
:
688 *copcode
= C_OPCODE_UMAX
;
690 case TGSI_OPCODE_UMIN
:
691 *copcode
= C_OPCODE_UMIN
;
693 case TGSI_OPCODE_UMOD
:
694 *copcode
= C_OPCODE_UMOD
;
696 case TGSI_OPCODE_UMUL
:
697 *copcode
= C_OPCODE_UMUL
;
699 case TGSI_OPCODE_USEQ
:
700 *copcode
= C_OPCODE_USEQ
;
702 case TGSI_OPCODE_USGE
:
703 *copcode
= C_OPCODE_USGE
;
705 case TGSI_OPCODE_USHR
:
706 *copcode
= C_OPCODE_USHR
;
708 case TGSI_OPCODE_USLT
:
709 *copcode
= C_OPCODE_USLT
;
711 case TGSI_OPCODE_USNE
:
712 *copcode
= C_OPCODE_USNE
;
714 case TGSI_OPCODE_SWITCH
:
715 *copcode
= C_OPCODE_SWITCH
;
717 case TGSI_OPCODE_CASE
:
718 *copcode
= C_OPCODE_CASE
;
720 case TGSI_OPCODE_DEFAULT
:
721 *copcode
= C_OPCODE_DEFAULT
;
723 case TGSI_OPCODE_ENDSWITCH
:
724 *copcode
= C_OPCODE_ENDSWITCH
;
727 fprintf(stderr
, "%s:%d unsupported opcode %d\n", __func__
, __LINE__
, opcode
);