Add support for swizzle control on source operands.

This required restructuring to store source operands in a new structure rather
than being stored in instructions, as swizzle is align16-only and shares
storage with other fields for align1 mode.

These changes were not tested on real programs using swizzle.
This commit is contained in:
Eric Anholt
2006-08-28 22:11:18 -07:00
committed by Damien Lespiau
parent 2a0f135784
commit 6a88ada7e8
3 changed files with 224 additions and 90 deletions
+22
View File
@@ -26,6 +26,8 @@
*
*/
#include <sys/types.h>
typedef unsigned char GLubyte;
typedef short GLshort;
typedef unsigned int GLuint;
@@ -36,6 +38,26 @@ typedef float GLfloat;
void yyerror (char *msg);
/**
* This structure is the internal representation of source operands in the
* parser.
*/
struct src_operand {
int reg_file, reg_nr, subreg_nr, reg_type;
int abs, negate;
int horiz_stride, width, vert_stride;
int address_mode; /* 0 if direct, 1 if register-indirect */
int indirect_offset; /* XXX */
int swizzle_set;
int swizzle_x, swizzle_y, swizzle_z, swizzle_w;
uint32_t imm32; /* only set if reg_file == BRW_IMMEDIATE_VALUE */
} src_operand;
/**
* This structure is just the list container for instructions accumulated by
* the parser.