1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * 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, sub license, 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:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
28 #include "pipe/p_util.h"
29 #include "pipe/p_shader_tokens.h"
30 #include "pipe/tgsi/util/tgsi_parse.h"
31 #include "pipe/tgsi/util/tgsi_util.h"
32 #include "tgsi_exec.h"
33 #include "tgsi_sse2.h"
35 #include "x86/rtasm/x86sse.h"
37 #if defined(__i386__) || defined(__386__)
80 printf( "XMM%u", reg
.idx
);
92 unsigned count
= 10 - strlen( op
);
99 #define DUMP_START() printf( "\nsse-dump start ----------------" )
100 #define DUMP_END() printf( "\nsse-dump end ----------------\n" )
101 #define DUMP( OP ) printf( "\n%s", OP )
102 #define DUMP_I( OP, I ) do {\
103 printf( "\n%s", OP );\
105 printf( "%u", I ); } while( 0 )
106 #define DUMP_R( OP, R0 ) do {\
107 printf( "\n%s", OP );\
109 _print_reg( R0 ); } while( 0 )
110 #define DUMP_RR( OP, R0, R1 ) do {\
111 printf( "\n%s", OP );\
115 _print_reg( R1 ); } while( 0 )
116 #define DUMP_RRI( OP, R0, R1, I ) do {\
117 printf( "\n%s", OP );\
123 printf( "%u", I ); } while( 0 )
130 #define DUMP_I( OP, I )
131 #define DUMP_R( OP, R0 )
132 #define DUMP_RR( OP, R0, R1 )
133 #define DUMP_RRI( OP, R0, R1, I )
137 #define FOR_EACH_CHANNEL( CHAN )\
138 for( CHAN = 0; CHAN < 4; CHAN++ )
140 #define IS_DST0_CHANNEL_ENABLED( INST, CHAN )\
141 ((INST).FullDstRegisters[0].DstRegister.WriteMask & (1 << (CHAN)))
143 #define IF_IS_DST0_CHANNEL_ENABLED( INST, CHAN )\
144 if( IS_DST0_CHANNEL_ENABLED( INST, CHAN ))
146 #define FOR_EACH_DST0_ENABLED_CHANNEL( INST, CHAN )\
147 FOR_EACH_CHANNEL( CHAN )\
148 IF_IS_DST0_CHANNEL_ENABLED( INST, CHAN )
155 #define TEMP_R0 TGSI_EXEC_TEMP_R0
158 * X86 utility functions.
161 static struct x86_reg
167 (enum x86_reg_name
) xmm
);
171 * X86 register mapping helpers.
174 static struct x86_reg
175 get_const_base( void )
182 static struct x86_reg
183 get_input_base( void )
190 static struct x86_reg
191 get_output_base( void )
198 static struct x86_reg
199 get_temp_base( void )
206 static struct x86_reg
207 get_coef_base( void )
209 return get_output_base();
213 * Data access helpers.
216 static struct x86_reg
220 return x86_make_disp(
221 x86_make_reg( file_REG32
, reg_SP
),
225 static struct x86_reg
230 return x86_make_disp(
232 (vec
* 4 + chan
) * 4 );
235 static struct x86_reg
240 return x86_make_disp(
242 (vec
* 4 + chan
) * 16 );
245 static struct x86_reg
250 return x86_make_disp(
252 (vec
* 4 + chan
) * 16 );
255 static struct x86_reg
260 return x86_make_disp(
262 (vec
* 4 + chan
) * 16 );
265 static struct x86_reg
271 return x86_make_disp(
273 ((vec
* 3 + member
) * 4 + chan
) * 4 );
277 * X86 rtasm wrappers.
282 struct x86_function
*func
,
286 DUMP_RR( "ADDPS", dst
, src
);
287 sse_addps( func
, dst
, src
);
292 struct x86_function
*func
,
296 DUMP_RR( "ANDNPS", dst
, src
);
297 sse_andnps( func
, dst
, src
);
302 struct x86_function
*func
,
306 DUMP_RR( "ANDPS", dst
, src
);
307 sse_andps( func
, dst
, src
);
312 struct x86_function
*func
,
315 DUMP_I( "CALL", addr
);
316 x86_call( func
, addr
);
321 struct x86_function
*func
,
326 DUMP_RRI( "CMPPS", dst
, src
, cc
);
327 sse_cmpps( func
, dst
, src
, cc
);
332 struct x86_function
*func
,
336 DUMP_RR( "CVTTPS2DQ", dst
, src
);
337 sse2_cvttps2dq( func
, dst
, src
);
342 struct x86_function
*func
,
346 DUMP_RR( "MAXPS", dst
, src
);
347 sse_maxps( func
, dst
, src
);
352 struct x86_function
*func
,
356 DUMP_RR( "MINPS", dst
, src
);
357 sse_minps( func
, dst
, src
);
362 struct x86_function
*func
,
366 DUMP_RR( "MOV", dst
, src
);
367 x86_mov( func
, dst
, src
);
372 struct x86_function
*func
,
376 DUMP_RR( "MOVAPS", dst
, src
);
377 sse_movaps( func
, dst
, src
);
382 struct x86_function
*func
,
386 DUMP_RR( "MOVSS", dst
, src
);
387 sse_movss( func
, dst
, src
);
392 struct x86_function
*func
,
396 DUMP_RR( "MOVUPS", dst
, src
);
397 sse_movups( func
, dst
, src
);
402 struct x86_function
*func
,
406 DUMP_RR( "MULPS", dst
, src
);
407 sse_mulps( func
, dst
, src
);
412 struct x86_function
*func
,
416 DUMP_RR( "OR", dst
, src
);
417 x86_or( func
, dst
, src
);
422 struct x86_function
*func
,
426 DUMP_RR( "ORPS", dst
, src
);
427 sse_orps( func
, dst
, src
);
432 struct x86_function
*func
,
436 DUMP_RR( "PMOVMSKB", dst
, src
);
437 sse_pmovmskb( func
, dst
, src
);
442 struct x86_function
*func
,
445 DUMP_R( "POP", dst
);
446 x86_pop( func
, dst
);
451 struct x86_function
*func
,
454 DUMP_R( "PUSH", dst
);
455 x86_push( func
, dst
);
460 struct x86_function
*func
,
464 DUMP_RR( "RCPPS", dst
, src
);
465 sse2_rcpps( func
, dst
, src
);
471 struct x86_function
*func
,
474 DUMP_I( "RET", size
);
475 x86_retw( func
, size
);
480 struct x86_function
*func
)
489 struct x86_function
*func
,
493 DUMP_RR( "RSQRTPS", dst
, src
);
494 sse_rsqrtps( func
, dst
, src
);
499 struct x86_function
*func
,
504 DUMP_RRI( "SHUFPS", dst
, src
, shuf
);
505 sse_shufps( func
, dst
, src
, shuf
);
510 struct x86_function
*func
,
514 DUMP_RR( "SUBPS", dst
, src
);
515 sse_subps( func
, dst
, src
);
520 struct x86_function
*func
,
524 DUMP_RR( "XORPS", dst
, src
);
525 sse_xorps( func
, dst
, src
);
529 * Data fetch helpers.
534 struct x86_function
*func
,
542 get_const( vec
, chan
) );
547 SHUF( 0, 0, 0, 0 ) );
552 struct x86_function
*func
,
560 get_input( vec
, chan
) );
565 struct x86_function
*func
,
572 get_output( vec
, chan
),
578 struct x86_function
*func
,
586 get_temp( vec
, chan
) );
591 struct x86_function
*func
,
600 get_coef( vec
, chan
, member
) );
605 SHUF( 0, 0, 0, 0 ) );
609 * Data store helpers.
614 struct x86_function
*func
,
621 get_input( vec
, chan
),
627 struct x86_function
*func
,
634 get_temp( vec
, chan
),
640 struct x86_function
*func
,
648 vec
+ TGSI_EXEC_NUM_TEMPS
,
653 * Coefficent fetch helpers.
658 struct x86_function
*func
,
673 struct x86_function
*func
,
688 struct x86_function
*func
,
702 * Function call helpers.
707 struct x86_function
*func
)
719 /* It is important on non-win32 platforms that temp base is pushed last.
728 struct x86_function
*func
)
730 /* Restore GP registers in a reverse order.
748 struct x86_function
*func
,
754 get_temp( TEMP_R0
, 0 ),
755 make_xmm( xmm_dst
) );
763 get_temp( TEMP_R0
, 0 ) );
776 get_temp( TEMP_R0
, 0 ) );
780 emit_func_call_dst_src(
781 struct x86_function
*func
,
788 get_temp( TEMP_R0
, 1 ),
789 make_xmm( xmm_src
) );
798 * Low-level instruction translators.
803 struct x86_function
*func
,
810 TGSI_EXEC_TEMP_7FFFFFFF_I
,
811 TGSI_EXEC_TEMP_7FFFFFFF_C
) );
816 struct x86_function
*func
,
823 make_xmm( xmm_src
) );
831 store
[0] = (float) cos( (double) store
[0] );
832 store
[1] = (float) cos( (double) store
[1] );
833 store
[2] = (float) cos( (double) store
[2] );
834 store
[3] = (float) cos( (double) store
[3] );
836 const unsigned X
= TEMP_R0
* 16;
837 store
[X
+ 0] = cosf( store
[X
+ 0] );
838 store
[X
+ 1] = cosf( store
[X
+ 1] );
839 store
[X
+ 2] = cosf( store
[X
+ 2] );
840 store
[X
+ 3] = cosf( store
[X
+ 3] );
846 struct x86_function
*func
,
860 store
[0] = (float) pow( 2.0, (double) store
[0] );
861 store
[1] = (float) pow( 2.0, (double) store
[1] );
862 store
[2] = (float) pow( 2.0, (double) store
[2] );
863 store
[3] = (float) pow( 2.0, (double) store
[3] );
865 const unsigned X
= TEMP_R0
* 16;
866 store
[X
+ 0] = powf( 2.0f
, store
[X
+ 0] );
867 store
[X
+ 1] = powf( 2.0f
, store
[X
+ 1] );
868 store
[X
+ 2] = powf( 2.0f
, store
[X
+ 2] );
869 store
[X
+ 3] = powf( 2.0f
, store
[X
+ 3] );
875 struct x86_function
*func
,
886 struct x86_function
*func
,
900 const unsigned X
= 0;
902 const unsigned X
= TEMP_R0
* 16;
904 store
[X
+ 0] = (float) floor( (double) store
[X
+ 0] );
905 store
[X
+ 1] = (float) floor( (double) store
[X
+ 1] );
906 store
[X
+ 2] = (float) floor( (double) store
[X
+ 2] );
907 store
[X
+ 3] = (float) floor( (double) store
[X
+ 3] );
912 struct x86_function
*func
,
926 const unsigned X
= 0;
928 const unsigned X
= TEMP_R0
* 16;
930 store
[X
+ 0] -= (float) floor( (double) store
[X
+ 0] );
931 store
[X
+ 1] -= (float) floor( (double) store
[X
+ 1] );
932 store
[X
+ 2] -= (float) floor( (double) store
[X
+ 2] );
933 store
[X
+ 3] -= (float) floor( (double) store
[X
+ 3] );
938 struct x86_function
*func
,
952 const unsigned X
= 0;
954 const unsigned X
= TEMP_R0
* 16;
956 store
[X
+ 0] = LOG2( store
[X
+ 0] );
957 store
[X
+ 1] = LOG2( store
[X
+ 1] );
958 store
[X
+ 2] = LOG2( store
[X
+ 2] );
959 store
[X
+ 3] = LOG2( store
[X
+ 3] );
964 struct x86_function
*func
,
975 struct x86_function
*func
,
982 make_xmm( xmm_src
) );
986 emit_mul (struct x86_function
*func
,
993 make_xmm( xmm_src
) );
998 struct x86_function
*func
,
1005 TGSI_EXEC_TEMP_80000000_I
,
1006 TGSI_EXEC_TEMP_80000000_C
) );
1009 static void XSTDCALL
1014 store
[0] = (float) pow( (double) store
[0], (double) store
[4] );
1015 store
[1] = (float) pow( (double) store
[1], (double) store
[5] );
1016 store
[2] = (float) pow( (double) store
[2], (double) store
[6] );
1017 store
[3] = (float) pow( (double) store
[3], (double) store
[7] );
1019 const unsigned X
= TEMP_R0
* 16;
1020 store
[X
+ 0] = powf( store
[X
+ 0], store
[X
+ 4] );
1021 store
[X
+ 1] = powf( store
[X
+ 1], store
[X
+ 5] );
1022 store
[X
+ 2] = powf( store
[X
+ 2], store
[X
+ 6] );
1023 store
[X
+ 3] = powf( store
[X
+ 3], store
[X
+ 7] );
1029 struct x86_function
*func
,
1033 emit_func_call_dst_src(
1042 struct x86_function
*func
,
1048 make_xmm( xmm_dst
),
1049 make_xmm( xmm_src
) );
1054 struct x86_function
*func
,
1060 make_xmm( xmm_dst
),
1061 make_xmm( xmm_src
) );
1066 struct x86_function
*func
,
1073 TGSI_EXEC_TEMP_80000000_I
,
1074 TGSI_EXEC_TEMP_80000000_C
) );
1077 static void XSTDCALL
1082 store
[0] = (float) sin( (double) store
[0] );
1083 store
[1] = (float) sin( (double) store
[1] );
1084 store
[2] = (float) sin( (double) store
[2] );
1085 store
[3] = (float) sin( (double) store
[3] );
1087 const unsigned X
= TEMP_R0
* 16;
1088 store
[X
+ 0] = sinf( store
[X
+ 0] );
1089 store
[X
+ 1] = sinf( store
[X
+ 1] );
1090 store
[X
+ 2] = sinf( store
[X
+ 2] );
1091 store
[X
+ 3] = sinf( store
[X
+ 3] );
1096 emit_sin (struct x86_function
*func
,
1107 struct x86_function
*func
,
1113 make_xmm( xmm_dst
),
1114 make_xmm( xmm_src
) );
1123 struct x86_function
*func
,
1125 const struct tgsi_full_src_register
*reg
,
1126 const unsigned chan_index
)
1128 unsigned swizzle
= tgsi_util_get_full_src_register_extswizzle( reg
, chan_index
);
1131 case TGSI_EXTSWIZZLE_X
:
1132 case TGSI_EXTSWIZZLE_Y
:
1133 case TGSI_EXTSWIZZLE_Z
:
1134 case TGSI_EXTSWIZZLE_W
:
1135 switch( reg
->SrcRegister
.File
) {
1136 case TGSI_FILE_CONSTANT
:
1140 reg
->SrcRegister
.Index
,
1144 case TGSI_FILE_INPUT
:
1148 reg
->SrcRegister
.Index
,
1152 case TGSI_FILE_TEMPORARY
:
1156 reg
->SrcRegister
.Index
,
1165 case TGSI_EXTSWIZZLE_ZERO
:
1169 TGSI_EXEC_TEMP_00000000_I
,
1170 TGSI_EXEC_TEMP_00000000_C
);
1173 case TGSI_EXTSWIZZLE_ONE
:
1177 TGSI_EXEC_TEMP_ONE_I
,
1178 TGSI_EXEC_TEMP_ONE_C
);
1185 switch( tgsi_util_get_full_src_register_sign_mode( reg
, chan_index
) ) {
1186 case TGSI_UTIL_SIGN_CLEAR
:
1187 emit_abs( func
, xmm
);
1190 case TGSI_UTIL_SIGN_SET
:
1191 emit_setsign( func
, xmm
);
1194 case TGSI_UTIL_SIGN_TOGGLE
:
1195 emit_neg( func
, xmm
);
1198 case TGSI_UTIL_SIGN_KEEP
:
1203 #define FETCH( FUNC, INST, XMM, INDEX, CHAN )\
1204 emit_fetch( FUNC, XMM, &(INST).FullSrcRegisters[INDEX], CHAN )
1212 struct x86_function
*func
,
1214 const struct tgsi_full_dst_register
*reg
,
1215 const struct tgsi_full_instruction
*inst
,
1216 unsigned chan_index
)
1218 switch( reg
->DstRegister
.File
) {
1219 case TGSI_FILE_OUTPUT
:
1223 reg
->DstRegister
.Index
,
1227 case TGSI_FILE_TEMPORARY
:
1231 reg
->DstRegister
.Index
,
1235 case TGSI_FILE_ADDRESS
:
1239 reg
->DstRegister
.Index
,
1247 switch( inst
->Instruction
.Saturate
) {
1251 case TGSI_SAT_ZERO_ONE
:
1255 case TGSI_SAT_MINUS_PLUS_ONE
:
1261 #define STORE( FUNC, INST, XMM, INDEX, CHAN )\
1262 emit_store( FUNC, XMM, &(INST).FullDstRegisters[INDEX], &(INST), CHAN )
1265 * High-level instruction translators.
1270 struct x86_function
*func
,
1271 const struct tgsi_full_src_register
*reg
)
1273 unsigned uniquemask
;
1274 unsigned registers
[4];
1275 unsigned nextregister
= 0;
1276 unsigned firstchan
= ~0;
1277 unsigned chan_index
;
1279 /* This mask stores component bits that were already tested. Note that
1280 * we test if the value is less than zero, so 1.0 and 0.0 need not to be
1282 uniquemask
= (1 << TGSI_EXTSWIZZLE_ZERO
) | (1 << TGSI_EXTSWIZZLE_ONE
);
1284 FOR_EACH_CHANNEL( chan_index
) {
1287 /* unswizzle channel */
1288 swizzle
= tgsi_util_get_full_src_register_extswizzle(
1292 /* check if the component has not been already tested */
1293 if( !(uniquemask
& (1 << swizzle
)) ) {
1294 uniquemask
|= 1 << swizzle
;
1296 /* allocate register */
1297 registers
[chan_index
] = nextregister
;
1305 /* mark the first channel used */
1306 if( firstchan
== ~0 ) {
1307 firstchan
= chan_index
;
1314 x86_make_reg( file_REG32
, reg_AX
) );
1317 x86_make_reg( file_REG32
, reg_DX
) );
1319 FOR_EACH_CHANNEL( chan_index
) {
1320 if( uniquemask
& (1 << chan_index
) ) {
1323 make_xmm( registers
[chan_index
] ),
1325 TGSI_EXEC_TEMP_00000000_I
,
1326 TGSI_EXEC_TEMP_00000000_C
),
1329 if( chan_index
== firstchan
) {
1332 x86_make_reg( file_REG32
, reg_AX
),
1333 make_xmm( registers
[chan_index
] ) );
1338 x86_make_reg( file_REG32
, reg_DX
),
1339 make_xmm( registers
[chan_index
] ) );
1342 x86_make_reg( file_REG32
, reg_AX
),
1343 x86_make_reg( file_REG32
, reg_DX
) );
1351 TGSI_EXEC_TEMP_KILMASK_I
,
1352 TGSI_EXEC_TEMP_KILMASK_C
),
1353 x86_make_reg( file_REG32
, reg_AX
) );
1357 x86_make_reg( file_REG32
, reg_DX
) );
1360 x86_make_reg( file_REG32
, reg_AX
) );
1365 struct x86_function
*func
,
1366 struct tgsi_full_instruction
*inst
,
1369 unsigned chan_index
;
1371 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1372 FETCH( func
, *inst
, 0, 0, chan_index
);
1373 FETCH( func
, *inst
, 1, 1, chan_index
);
1383 TGSI_EXEC_TEMP_ONE_I
,
1384 TGSI_EXEC_TEMP_ONE_C
) );
1385 STORE( func
, *inst
, 0, 0, chan_index
);
1391 struct x86_function
*func
,
1392 struct tgsi_full_instruction
*inst
)
1394 unsigned chan_index
;
1396 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1397 FETCH( func
, *inst
, 0, 0, chan_index
);
1398 FETCH( func
, *inst
, 1, 1, chan_index
);
1399 FETCH( func
, *inst
, 2, 2, chan_index
);
1404 TGSI_EXEC_TEMP_00000000_I
,
1405 TGSI_EXEC_TEMP_00000000_C
),
1419 STORE( func
, *inst
, 0, 0, chan_index
);
1425 struct x86_function
*func
,
1426 struct tgsi_full_instruction
*inst
)
1428 unsigned chan_index
;
1430 switch( inst
->Instruction
.Opcode
) {
1431 case TGSI_OPCODE_ARL
:
1432 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1433 FETCH( func
, *inst
, 0, 0, chan_index
);
1434 emit_f2it( func
, 0 );
1435 STORE( func
, *inst
, 0, 0, chan_index
);
1439 case TGSI_OPCODE_MOV
:
1440 /* TGSI_OPCODE_SWZ */
1441 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1442 FETCH( func
, *inst
, 0, 0, chan_index
);
1443 STORE( func
, *inst
, 0, 0, chan_index
);
1447 case TGSI_OPCODE_LIT
:
1448 if( IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_X
) ||
1449 IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_W
) ) {
1453 TGSI_EXEC_TEMP_ONE_I
,
1454 TGSI_EXEC_TEMP_ONE_C
);
1455 if( IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_X
) ) {
1456 STORE( func
, *inst
, 0, 0, CHAN_X
);
1458 if( IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_W
) ) {
1459 STORE( func
, *inst
, 0, 0, CHAN_W
);
1462 if( IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Y
) ||
1463 IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Z
) ) {
1464 if( IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Y
) ) {
1465 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1470 TGSI_EXEC_TEMP_00000000_I
,
1471 TGSI_EXEC_TEMP_00000000_C
) );
1472 STORE( func
, *inst
, 0, 0, CHAN_Y
);
1474 if( IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Z
) ) {
1475 FETCH( func
, *inst
, 1, 0, CHAN_Y
);
1480 TGSI_EXEC_TEMP_00000000_I
,
1481 TGSI_EXEC_TEMP_00000000_C
) );
1482 FETCH( func
, *inst
, 2, 0, CHAN_W
);
1487 TGSI_EXEC_TEMP_128_I
,
1488 TGSI_EXEC_TEMP_128_C
) );
1493 TGSI_EXEC_TEMP_MINUS_128_I
,
1494 TGSI_EXEC_TEMP_MINUS_128_C
) );
1495 emit_pow( func
, 1, 2 );
1496 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1510 STORE( func
, *inst
, 2, 0, CHAN_Z
);
1515 case TGSI_OPCODE_RCP
:
1516 /* TGSI_OPCODE_RECIP */
1517 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1518 emit_rcp( func
, 0, 0 );
1519 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1520 STORE( func
, *inst
, 0, 0, chan_index
);
1524 case TGSI_OPCODE_RSQ
:
1525 /* TGSI_OPCODE_RECIPSQRT */
1526 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1527 emit_rsqrt( func
, 0, 0 );
1528 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1529 STORE( func
, *inst
, 0, 0, chan_index
);
1533 case TGSI_OPCODE_EXP
:
1537 case TGSI_OPCODE_LOG
:
1541 case TGSI_OPCODE_MUL
:
1542 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1543 FETCH( func
, *inst
, 0, 0, chan_index
);
1544 FETCH( func
, *inst
, 1, 1, chan_index
);
1545 emit_mul( func
, 0, 1 );
1546 STORE( func
, *inst
, 0, 0, chan_index
);
1550 case TGSI_OPCODE_ADD
:
1551 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1552 FETCH( func
, *inst
, 0, 0, chan_index
);
1553 FETCH( func
, *inst
, 1, 1, chan_index
);
1554 emit_add( func
, 0, 1 );
1555 STORE( func
, *inst
, 0, 0, chan_index
);
1559 case TGSI_OPCODE_DP3
:
1560 /* TGSI_OPCODE_DOT3 */
1561 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1562 FETCH( func
, *inst
, 1, 1, CHAN_X
);
1563 emit_mul( func
, 0, 1 );
1564 FETCH( func
, *inst
, 1, 0, CHAN_Y
);
1565 FETCH( func
, *inst
, 2, 1, CHAN_Y
);
1566 emit_mul( func
, 1, 2 );
1567 emit_add( func
, 0, 1 );
1568 FETCH( func
, *inst
, 1, 0, CHAN_Z
);
1569 FETCH( func
, *inst
, 2, 1, CHAN_Z
);
1570 emit_mul( func
, 1, 2 );
1571 emit_add( func
, 0, 1 );
1572 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1573 STORE( func
, *inst
, 0, 0, chan_index
);
1577 case TGSI_OPCODE_DP4
:
1578 /* TGSI_OPCODE_DOT4 */
1579 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1580 FETCH( func
, *inst
, 1, 1, CHAN_X
);
1581 emit_mul( func
, 0, 1 );
1582 FETCH( func
, *inst
, 1, 0, CHAN_Y
);
1583 FETCH( func
, *inst
, 2, 1, CHAN_Y
);
1584 emit_mul( func
, 1, 2 );
1585 emit_add( func
, 0, 1 );
1586 FETCH( func
, *inst
, 1, 0, CHAN_Z
);
1587 FETCH( func
, *inst
, 2, 1, CHAN_Z
);
1588 emit_mul(func
, 1, 2 );
1589 emit_add(func
, 0, 1 );
1590 FETCH( func
, *inst
, 1, 0, CHAN_W
);
1591 FETCH( func
, *inst
, 2, 1, CHAN_W
);
1592 emit_mul( func
, 1, 2 );
1593 emit_add( func
, 0, 1 );
1594 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1595 STORE( func
, *inst
, 0, 0, chan_index
);
1599 case TGSI_OPCODE_DST
:
1600 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_X
) {
1604 TGSI_EXEC_TEMP_ONE_I
,
1605 TGSI_EXEC_TEMP_ONE_C
);
1606 STORE( func
, *inst
, 0, 0, CHAN_X
);
1608 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Y
) {
1609 FETCH( func
, *inst
, 0, 0, CHAN_Y
);
1610 FETCH( func
, *inst
, 1, 1, CHAN_Y
);
1611 emit_mul( func
, 0, 1 );
1612 STORE( func
, *inst
, 0, 0, CHAN_Y
);
1614 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Z
) {
1615 FETCH( func
, *inst
, 0, 0, CHAN_Z
);
1616 STORE( func
, *inst
, 0, 0, CHAN_Z
);
1618 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_W
) {
1619 FETCH( func
, *inst
, 0, 1, CHAN_W
);
1620 STORE( func
, *inst
, 0, 0, CHAN_W
);
1624 case TGSI_OPCODE_MIN
:
1625 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1626 FETCH( func
, *inst
, 0, 0, chan_index
);
1627 FETCH( func
, *inst
, 1, 1, chan_index
);
1632 STORE( func
, *inst
, 0, 0, chan_index
);
1636 case TGSI_OPCODE_MAX
:
1637 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1638 FETCH( func
, *inst
, 0, 0, chan_index
);
1639 FETCH( func
, *inst
, 1, 1, chan_index
);
1644 STORE( func
, *inst
, 0, 0, chan_index
);
1648 case TGSI_OPCODE_SLT
:
1649 /* TGSI_OPCODE_SETLT */
1650 emit_setcc( func
, inst
, cc_LessThan
);
1653 case TGSI_OPCODE_SGE
:
1654 /* TGSI_OPCODE_SETGE */
1655 emit_setcc( func
, inst
, cc_NotLessThan
);
1658 case TGSI_OPCODE_MAD
:
1659 /* TGSI_OPCODE_MADD */
1660 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1661 FETCH( func
, *inst
, 0, 0, chan_index
);
1662 FETCH( func
, *inst
, 1, 1, chan_index
);
1663 FETCH( func
, *inst
, 2, 2, chan_index
);
1664 emit_mul( func
, 0, 1 );
1665 emit_add( func
, 0, 2 );
1666 STORE( func
, *inst
, 0, 0, chan_index
);
1670 case TGSI_OPCODE_SUB
:
1671 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1672 FETCH( func
, *inst
, 0, 0, chan_index
);
1673 FETCH( func
, *inst
, 1, 1, chan_index
);
1674 emit_sub( func
, 0, 1 );
1675 STORE( func
, *inst
, 0, 0, chan_index
);
1679 case TGSI_OPCODE_LERP
:
1680 /* TGSI_OPCODE_LRP */
1681 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1682 FETCH( func
, *inst
, 0, 0, chan_index
);
1683 FETCH( func
, *inst
, 1, 1, chan_index
);
1684 FETCH( func
, *inst
, 2, 2, chan_index
);
1685 emit_sub( func
, 1, 2 );
1686 emit_mul( func
, 0, 1 );
1687 emit_add( func
, 0, 2 );
1688 STORE( func
, *inst
, 0, 0, chan_index
);
1692 case TGSI_OPCODE_CND
:
1696 case TGSI_OPCODE_CND0
:
1700 case TGSI_OPCODE_DOT2ADD
:
1701 /* TGSI_OPCODE_DP2A */
1705 case TGSI_OPCODE_INDEX
:
1709 case TGSI_OPCODE_NEGATE
:
1713 case TGSI_OPCODE_FRAC
:
1714 /* TGSI_OPCODE_FRC */
1715 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1716 FETCH( func
, *inst
, 0, 0, chan_index
);
1717 emit_frc( func
, 0 );
1718 STORE( func
, *inst
, 0, 0, chan_index
);
1722 case TGSI_OPCODE_CLAMP
:
1726 case TGSI_OPCODE_FLOOR
:
1727 /* TGSI_OPCODE_FLR */
1728 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1729 FETCH( func
, *inst
, 0, 0, chan_index
);
1730 emit_flr( func
, 0 );
1731 STORE( func
, *inst
, 0, 0, chan_index
);
1735 case TGSI_OPCODE_ROUND
:
1739 case TGSI_OPCODE_EXPBASE2
:
1740 /* TGSI_OPCODE_EX2 */
1741 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1742 emit_ex2( func
, 0 );
1743 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1744 STORE( func
, *inst
, 0, 0, chan_index
);
1748 case TGSI_OPCODE_LOGBASE2
:
1749 /* TGSI_OPCODE_LG2 */
1750 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1751 emit_lg2( func
, 0 );
1752 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1753 STORE( func
, *inst
, 0, 0, chan_index
);
1757 case TGSI_OPCODE_POWER
:
1758 /* TGSI_OPCODE_POW */
1759 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1760 FETCH( func
, *inst
, 1, 1, CHAN_X
);
1761 emit_pow( func
, 0, 1 );
1762 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1763 STORE( func
, *inst
, 0, 0, chan_index
);
1767 case TGSI_OPCODE_CROSSPRODUCT
:
1768 /* TGSI_OPCODE_XPD */
1769 if( IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_X
) ||
1770 IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Y
) ) {
1771 FETCH( func
, *inst
, 1, 1, CHAN_Z
);
1772 FETCH( func
, *inst
, 3, 0, CHAN_Z
);
1774 if( IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_X
) ||
1775 IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Z
) ) {
1776 FETCH( func
, *inst
, 0, 0, CHAN_Y
);
1777 FETCH( func
, *inst
, 4, 1, CHAN_Y
);
1779 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_X
) {
1780 emit_MOV( func
, 2, 0 );
1781 emit_mul( func
, 2, 1 );
1782 emit_MOV( func
, 5, 3 );
1783 emit_mul( func
, 5, 4 );
1784 emit_sub( func
, 2, 5 );
1785 STORE( func
, *inst
, 2, 0, CHAN_X
);
1787 if( IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Y
) ||
1788 IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Z
) ) {
1789 FETCH( func
, *inst
, 2, 1, CHAN_X
);
1790 FETCH( func
, *inst
, 5, 0, CHAN_X
);
1792 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Y
) {
1793 emit_mul( func
, 3, 2 );
1794 emit_mul( func
, 1, 5 );
1795 emit_sub( func
, 3, 1 );
1796 STORE( func
, *inst
, 3, 0, CHAN_Y
);
1798 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Z
) {
1799 emit_mul( func
, 5, 4 );
1800 emit_mul( func
, 0, 2 );
1801 emit_sub( func
, 5, 0 );
1802 STORE( func
, *inst
, 5, 0, CHAN_Z
);
1804 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_W
) {
1805 FETCH( func
, *inst
, 0, TGSI_EXEC_TEMP_ONE_I
, TGSI_EXEC_TEMP_ONE_C
);
1806 STORE( func
, *inst
, 0, 0, CHAN_W
);
1810 case TGSI_OPCODE_MULTIPLYMATRIX
:
1814 case TGSI_OPCODE_ABS
:
1815 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1816 FETCH( func
, *inst
, 0, 0, chan_index
);
1817 emit_abs( func
, 0) ;
1819 STORE( func
, *inst
, 0, 0, chan_index
);
1823 case TGSI_OPCODE_RCC
:
1827 case TGSI_OPCODE_DPH
:
1828 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1829 FETCH( func
, *inst
, 1, 1, CHAN_X
);
1830 emit_mul( func
, 0, 1 );
1831 FETCH( func
, *inst
, 1, 0, CHAN_Y
);
1832 FETCH( func
, *inst
, 2, 1, CHAN_Y
);
1833 emit_mul( func
, 1, 2 );
1834 emit_add( func
, 0, 1 );
1835 FETCH( func
, *inst
, 1, 0, CHAN_Z
);
1836 FETCH( func
, *inst
, 2, 1, CHAN_Z
);
1837 emit_mul( func
, 1, 2 );
1838 emit_add( func
, 0, 1 );
1839 FETCH( func
, *inst
, 1, 1, CHAN_W
);
1840 emit_add( func
, 0, 1 );
1841 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1842 STORE( func
, *inst
, 0, 0, chan_index
);
1846 case TGSI_OPCODE_COS
:
1847 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1848 emit_cos( func
, 0 );
1849 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1850 STORE( func
, *inst
, 0, 0, chan_index
);
1854 case TGSI_OPCODE_DDX
:
1858 case TGSI_OPCODE_DDY
:
1862 case TGSI_OPCODE_KIL
:
1863 emit_kil( func
, &inst
->FullSrcRegisters
[0] );
1866 case TGSI_OPCODE_PK2H
:
1870 case TGSI_OPCODE_PK2US
:
1874 case TGSI_OPCODE_PK4B
:
1878 case TGSI_OPCODE_PK4UB
:
1882 case TGSI_OPCODE_RFL
:
1886 case TGSI_OPCODE_SEQ
:
1890 case TGSI_OPCODE_SFL
:
1894 case TGSI_OPCODE_SGT
:
1898 case TGSI_OPCODE_SIN
:
1899 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1900 emit_sin( func
, 0 );
1901 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1902 STORE( func
, *inst
, 0, 0, chan_index
);
1906 case TGSI_OPCODE_SLE
:
1910 case TGSI_OPCODE_SNE
:
1914 case TGSI_OPCODE_STR
:
1918 case TGSI_OPCODE_TEX
:
1922 TGSI_EXEC_TEMP_ONE_I
,
1923 TGSI_EXEC_TEMP_ONE_C
);
1924 FOR_EACH_DST0_ENABLED_CHANNEL( *inst
, chan_index
) {
1925 STORE( func
, *inst
, 0, 0, chan_index
);
1929 case TGSI_OPCODE_TXD
:
1933 case TGSI_OPCODE_UP2H
:
1937 case TGSI_OPCODE_UP2US
:
1941 case TGSI_OPCODE_UP4B
:
1945 case TGSI_OPCODE_UP4UB
:
1949 case TGSI_OPCODE_X2D
:
1953 case TGSI_OPCODE_ARA
:
1957 case TGSI_OPCODE_ARR
:
1961 case TGSI_OPCODE_BRA
:
1965 case TGSI_OPCODE_CAL
:
1969 case TGSI_OPCODE_RET
:
1971 emit_retw( func
, 16 );
1977 case TGSI_OPCODE_SSG
:
1981 case TGSI_OPCODE_CMP
:
1982 emit_cmp (func
, inst
);
1985 case TGSI_OPCODE_SCS
:
1986 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_X
) {
1987 FETCH( func
, *inst
, 0, 0, CHAN_X
);
1988 emit_cos( func
, 0 );
1989 STORE( func
, *inst
, 0, 0, CHAN_X
);
1991 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Y
) {
1992 FETCH( func
, *inst
, 0, 0, CHAN_Y
);
1993 emit_sin( func
, 0 );
1994 STORE( func
, *inst
, 0, 0, CHAN_Y
);
1996 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_Z
) {
1997 FETCH( func
, *inst
, 0, TGSI_EXEC_TEMP_00000000_I
, TGSI_EXEC_TEMP_00000000_C
);
1998 STORE( func
, *inst
, 0, 0, CHAN_Z
);
2000 IF_IS_DST0_CHANNEL_ENABLED( *inst
, CHAN_W
) {
2001 FETCH( func
, *inst
, 0, TGSI_EXEC_TEMP_ONE_I
, TGSI_EXEC_TEMP_ONE_C
);
2002 STORE( func
, *inst
, 0, 0, CHAN_W
);
2006 case TGSI_OPCODE_TXB
:
2010 case TGSI_OPCODE_NRM
:
2014 case TGSI_OPCODE_DIV
:
2018 case TGSI_OPCODE_DP2
:
2022 case TGSI_OPCODE_TXL
:
2026 case TGSI_OPCODE_BRK
:
2030 case TGSI_OPCODE_IF
:
2034 case TGSI_OPCODE_LOOP
:
2038 case TGSI_OPCODE_REP
:
2042 case TGSI_OPCODE_ELSE
:
2046 case TGSI_OPCODE_ENDIF
:
2050 case TGSI_OPCODE_ENDLOOP
:
2054 case TGSI_OPCODE_ENDREP
:
2058 case TGSI_OPCODE_PUSHA
:
2062 case TGSI_OPCODE_POPA
:
2066 case TGSI_OPCODE_CEIL
:
2070 case TGSI_OPCODE_I2F
:
2074 case TGSI_OPCODE_NOT
:
2078 case TGSI_OPCODE_TRUNC
:
2082 case TGSI_OPCODE_SHL
:
2086 case TGSI_OPCODE_SHR
:
2090 case TGSI_OPCODE_AND
:
2094 case TGSI_OPCODE_OR
:
2098 case TGSI_OPCODE_MOD
:
2102 case TGSI_OPCODE_XOR
:
2106 case TGSI_OPCODE_SAD
:
2110 case TGSI_OPCODE_TXF
:
2114 case TGSI_OPCODE_TXQ
:
2118 case TGSI_OPCODE_CONT
:
2122 case TGSI_OPCODE_EMIT
:
2126 case TGSI_OPCODE_ENDPRIM
:
2137 struct x86_function
*func
,
2138 struct tgsi_full_declaration
*decl
)
2140 if( decl
->Declaration
.File
== TGSI_FILE_INPUT
) {
2141 unsigned first
, last
, mask
;
2144 assert( decl
->Declaration
.Declare
== TGSI_DECLARE_RANGE
);
2146 first
= decl
->u
.DeclarationRange
.First
;
2147 last
= decl
->u
.DeclarationRange
.Last
;
2148 mask
= decl
->Declaration
.UsageMask
;
2150 /* Do not touch WPOS.xy */
2152 mask
&= ~TGSI_WRITEMASK_XY
;
2153 if( mask
== TGSI_WRITEMASK_NONE
) {
2158 for( i
= first
; i
<= last
; i
++ ) {
2159 for( j
= 0; j
< NUM_CHANNELS
; j
++ ) {
2160 if( mask
& (1 << j
) ) {
2161 switch( decl
->Interpolation
.Interpolate
) {
2162 case TGSI_INTERPOLATE_CONSTANT
:
2163 emit_coef_a0( func
, 0, i
, j
);
2164 emit_inputs( func
, 0, i
, j
);
2167 case TGSI_INTERPOLATE_LINEAR
:
2168 emit_inputf( func
, 0, 0, TGSI_SWIZZLE_X
);
2169 emit_coef_dadx( func
, 1, i
, j
);
2170 emit_inputf( func
, 2, 0, TGSI_SWIZZLE_Y
);
2171 emit_coef_dady( func
, 3, i
, j
);
2172 emit_mul( func
, 0, 1 ); /* x * dadx */
2173 emit_coef_a0( func
, 4, i
, j
);
2174 emit_mul( func
, 2, 3 ); /* y * dady */
2175 emit_add( func
, 0, 4 ); /* x * dadx + a0 */
2176 emit_add( func
, 0, 2 ); /* x * dadx + y * dady + a0 */
2177 emit_inputs( func
, 0, i
, j
);
2180 case TGSI_INTERPOLATE_PERSPECTIVE
:
2181 emit_inputf( func
, 0, 0, TGSI_SWIZZLE_X
);
2182 emit_coef_dadx( func
, 1, i
, j
);
2183 emit_inputf( func
, 2, 0, TGSI_SWIZZLE_Y
);
2184 emit_coef_dady( func
, 3, i
, j
);
2185 emit_mul( func
, 0, 1 ); /* x * dadx */
2186 emit_inputf( func
, 4, 0, TGSI_SWIZZLE_W
);
2187 emit_coef_a0( func
, 5, i
, j
);
2188 emit_rcp( func
, 4, 4 ); /* 1.0 / w */
2189 emit_mul( func
, 2, 3 ); /* y * dady */
2190 emit_add( func
, 0, 5 ); /* x * dadx + a0 */
2191 emit_add( func
, 0, 2 ); /* x * dadx + y * dady + a0 */
2192 emit_mul( func
, 0, 4 ); /* (x * dadx + y * dady + a0) / w */
2193 emit_inputs( func
, 0, i
, j
);
2207 struct tgsi_token
*tokens
,
2208 struct x86_function
*func
)
2210 struct tgsi_parse_context parse
;
2214 func
->csr
= func
->store
;
2219 get_argument( 0 ) );
2223 get_argument( 1 ) );
2227 get_argument( 2 ) );
2231 get_argument( 3 ) );
2233 tgsi_parse_init( &parse
, tokens
);
2235 while( !tgsi_parse_end_of_tokens( &parse
) ) {
2236 tgsi_parse_token( &parse
);
2238 switch( parse
.FullToken
.Token
.Type
) {
2239 case TGSI_TOKEN_TYPE_DECLARATION
:
2242 case TGSI_TOKEN_TYPE_INSTRUCTION
:
2245 &parse
.FullToken
.FullInstruction
);
2253 tgsi_parse_free( &parse
);
2261 * Fragment shaders are responsible for interpolating shader inputs. Because on
2262 * x86 we have only 4 GP registers, and here we have 5 shader arguments (input,
2263 * output, const, temp and coef), the code is split into two phases --
2264 * DECLARATION and INSTRUCTION phase.
2265 * GP register holding the output argument is aliased with the coeff argument,
2266 * as outputs are not needed in the DECLARATION phase.
2270 struct tgsi_token
*tokens
,
2271 struct x86_function
*func
)
2273 struct tgsi_parse_context parse
;
2274 boolean instruction_phase
= FALSE
;
2278 func
->csr
= func
->store
;
2280 /* DECLARATION phase, do not load output argument. */
2284 get_argument( 0 ) );
2288 get_argument( 2 ) );
2292 get_argument( 3 ) );
2296 get_argument( 4 ) );
2298 tgsi_parse_init( &parse
, tokens
);
2300 while( !tgsi_parse_end_of_tokens( &parse
) ) {
2301 tgsi_parse_token( &parse
);
2303 switch( parse
.FullToken
.Token
.Type
) {
2304 case TGSI_TOKEN_TYPE_DECLARATION
:
2307 &parse
.FullToken
.FullDeclaration
);
2310 case TGSI_TOKEN_TYPE_INSTRUCTION
:
2311 if( !instruction_phase
) {
2312 /* INSTRUCTION phase, overwrite coeff with output. */
2313 instruction_phase
= TRUE
;
2317 get_argument( 1 ) );
2321 &parse
.FullToken
.FullInstruction
);
2329 tgsi_parse_free( &parse
);