summaryrefslogtreecommitdiff
path: root/assembler/lex.l
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2006-08-28 22:11:18 -0700
committerDamien Lespiau <damien.lespiau@intel.com>2013-03-04 15:54:22 +0000
commit6a88ada7e8b1ea241c037137d7f88ab22a0e1812 (patch)
tree6a1cbb38e44d28e411a245be025153d856bc37fd /assembler/lex.l
parent2a0f135784ebdf24917da1a8fd1f4a1c08a358eb (diff)
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.
Diffstat (limited to 'assembler/lex.l')
-rw-r--r--assembler/lex.l18
1 files changed, 18 insertions, 0 deletions
diff --git a/assembler/lex.l b/assembler/lex.l
index b4051498..282449b0 100644
--- a/assembler/lex.l
+++ b/assembler/lex.l
@@ -239,6 +239,24 @@ int saved_state = INITIAL;
"signed" { return SIGNED; }
"scalar" { return SCALAR; }
+ /* channel selectors */
+"x" {
+ yylval.integer = BRW_CHANNEL_X;
+ return X;
+}
+"y" {
+ yylval.integer = BRW_CHANNEL_Y;
+ return Y;
+}
+"z" {
+ yylval.integer = BRW_CHANNEL_Z;
+ return Z;
+}
+"w" {
+ yylval.integer = BRW_CHANNEL_W;
+ return W;
+}
+
[0-9]* {
yylval.integer = atoi(yytext);
return INTEGER;