summaryrefslogtreecommitdiff
path: root/assembler
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2006-08-22 14:42:45 -0700
committerDamien Lespiau <damien.lespiau@intel.com>2013-03-04 15:54:21 +0000
commitdc96c56d9e9da633795fe512067efcc444bcbe2d (patch)
tree78083cff309b3a6834ce755e0fc93ff2a4f9c188 /assembler
parent0d929b430b301859d775c05f4687db1665a1f6f9 (diff)
Add support for negate and abs to source operands.
Diffstat (limited to 'assembler')
-rw-r--r--assembler/gram.y35
-rw-r--r--assembler/lex.c362
-rw-r--r--assembler/lex.l2
-rw-r--r--assembler/packed_yuv_wm.g4a8
4 files changed, 219 insertions, 188 deletions
diff --git a/assembler/gram.y b/assembler/gram.y
index fdbd8c1d..0ac75c15 100644
--- a/assembler/gram.y
+++ b/assembler/gram.y
@@ -56,6 +56,7 @@
%token LCURLY RCURLY
%token COMMA
%token DOT
+%token MINUS ABS
%token TYPE_UD, TYPE_D, TYPE_UW, TYPE_W, TYPE_UB, TYPE_B,
%token TYPE_VF, TYPE_HF, TYPE_V, TYPE_F
@@ -86,7 +87,7 @@
%type <program> instrseq
%type <integer> instoption
%type <integer> unaryop binaryop binaryaccop
-%type <integer> conditionalmodifier saturate
+%type <integer> conditionalmodifier saturate negate abs
%type <integer> regtype srcimmtype execsize dstregion
%type <integer> subregnum msgtarget
%type <region> region
@@ -324,19 +325,22 @@ directsrcaccoperand: directsrcoperand
src: directsrcoperand
;
-/* XXX: srcmodifier, swizzle srcaccoperandex */
-directsrcoperand: directgenreg region regtype
+/* XXX: srcaccoperandex */
+directsrcoperand:
+ negate abs directgenreg region regtype
{
/* Returns a source operand in the src0 fields of an
* instruction.
*/
- $$.bits1.da1.src0_reg_file = $1.reg_file;
- $$.bits1.da1.src0_reg_type = $3;
- $$.bits2.da1.src0_subreg_nr = $1.subreg_nr;
- $$.bits2.da1.src0_reg_nr = $1.reg_nr;
- $$.bits2.da1.src0_vert_stride = $2.vert_stride;
- $$.bits2.da1.src0_width = $2.width;
- $$.bits2.da1.src0_horiz_stride = $2.horiz_stride;
+ $$.bits1.da1.src0_reg_file = $3.reg_file;
+ $$.bits1.da1.src0_reg_type = $5;
+ $$.bits2.da1.src0_subreg_nr = $3.subreg_nr;
+ $$.bits2.da1.src0_reg_nr = $3.reg_nr;
+ $$.bits2.da1.src0_vert_stride = $4.vert_stride;
+ $$.bits2.da1.src0_width = $4.width;
+ $$.bits2.da1.src0_horiz_stride = $4.horiz_stride;
+ $$.bits2.da1.src0_negate = $1;
+ $$.bits2.da1.src0_abs = $2;
}
;
@@ -447,6 +451,13 @@ imm32: INTEGER { $$ = $1; }
/* 1.4.12: Predication and modifiers */
/* XXX: do the predicate */
predicate:
+;
+
+negate: /* empty */ { $$ = 0; }
+ | MINUS { $$ = 1; }
+
+abs: /* empty */ { $$ = 0; }
+ | ABS { $$ = 1; }
execsize: LPAREN INTEGER RPAREN
{
@@ -542,6 +553,8 @@ void set_instruction_src0(struct brw_instruction *instr,
instr->bits2.da1.src0_width = src->bits2.da1.src0_width;
instr->bits2.da1.src0_horiz_stride =
src->bits2.da1.src0_horiz_stride;
+ instr->bits2.da1.src0_negate = src->bits2.da1.src0_negate;
+ instr->bits2.da1.src0_abs = src->bits2.da1.src0_abs;
}
}
@@ -561,6 +574,8 @@ void set_instruction_src1(struct brw_instruction *instr,
instr->bits3.da1.src1_width = src->bits2.da1.src0_width;
instr->bits3.da1.src1_horiz_stride =
src->bits2.da1.src0_horiz_stride;
+ instr->bits3.da1.src1_negate = src->bits2.da1.src0_negate;
+ instr->bits3.da1.src1_abs = src->bits2.da1.src0_abs;
}
}
diff --git a/assembler/lex.c b/assembler/lex.c
index bb00f36d..fd3c7045 100644
--- a/assembler/lex.c
+++ b/assembler/lex.c
@@ -293,47 +293,49 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 62
-#define YY_END_OF_BUFFER 63
-static yyconst short int yy_acclist[151] =
+#define YY_NUM_RULES 64
+#define YY_END_OF_BUFFER 65
+static yyconst short int yy_acclist[156] =
{ 0,
- 58, 58, 58, 58, 63, 61, 62, 60, 61, 62,
- 60, 62, 31, 61, 62, 32, 61, 62, 37, 61,
- 62, 61, 62, 38, 61, 62, 61, 62, 58, 61,
- 62, 30, 61, 62, 33, 61, 62, 34, 61, 62,
- 51, 61, 62, 47, 61, 62, 61, 62, 52, 61,
- 62, 61, 62, 49, 61, 62, 40, 61, 62, 61,
- 62, 61, 62, 42, 61, 62, 43, 61, 62, 61,
- 62, 61, 62, 41, 61, 62, 61, 62, 43, 61,
- 62, 61, 62, 61, 62, 61, 62, 61, 62, 35,
- 61, 62, 36, 61, 62, 58, 61, 62, 4, 62,
-
- 5, 62, 4, 5, 62, 4, 62, 60, 2, 58,
- 50, 46, 48, 44, 45, 58, 3, 1, 1, 59,
- 57, 39, 18, 17, 16, 14, 15, 9, 7, 8,
- 19, 53, 28, 11, 10, 23, 21, 6, 26, 22,
- 12, 20, 13, 27, 54, 55, 25, 24, 56, 29
+ 60, 60, 60, 60, 65, 63, 64, 62, 63, 64,
+ 62, 64, 31, 63, 64, 32, 63, 64, 37, 63,
+ 64, 39, 63, 64, 38, 63, 64, 63, 64, 60,
+ 63, 64, 30, 63, 64, 33, 63, 64, 34, 63,
+ 64, 53, 63, 64, 49, 63, 64, 63, 64, 54,
+ 63, 64, 63, 64, 51, 63, 64, 42, 63, 64,
+ 63, 64, 63, 64, 44, 63, 64, 45, 63, 64,
+ 63, 64, 63, 64, 43, 63, 64, 63, 64, 45,
+ 63, 64, 63, 64, 63, 64, 63, 64, 63, 64,
+ 35, 63, 64, 36, 63, 64, 39, 63, 64, 60,
+
+ 63, 64, 4, 64, 5, 64, 4, 5, 64, 4,
+ 64, 62, 2, 60, 52, 48, 50, 46, 47, 60,
+ 3, 1, 1, 61, 59, 41, 18, 17, 16, 14,
+ 15, 9, 7, 8, 19, 55, 28, 11, 10, 23,
+ 21, 6, 26, 22, 12, 20, 40, 13, 27, 56,
+ 57, 25, 24, 58, 29
} ;
-static yyconst short int yy_accept[159] =
+static yyconst short int yy_accept[164] =
{ 0,
1, 2, 3, 4, 5, 5, 5, 6, 8, 11,
- 13, 16, 19, 22, 24, 27, 29, 32, 35, 38,
- 41, 44, 47, 49, 52, 54, 57, 60, 62, 64,
- 67, 70, 72, 74, 77, 79, 82, 84, 86, 88,
- 90, 93, 96, 99, 101, 103, 106, 108, 109, 109,
- 110, 110, 110, 111, 111, 112, 113, 114, 114, 114,
- 114, 115, 115, 115, 116, 116, 116, 116, 116, 116,
- 116, 116, 116, 116, 116, 116, 116, 116, 116, 117,
- 118, 118, 119, 120, 121, 122, 123, 124, 124, 125,
- 126, 127, 128, 128, 128, 129, 129, 129, 129, 130,
-
- 131, 132, 132, 132, 132, 132, 132, 133, 133, 133,
- 134, 134, 134, 134, 135, 136, 136, 137, 138, 139,
- 140, 141, 142, 142, 142, 143, 143, 143, 143, 143,
- 143, 144, 144, 144, 145, 146, 146, 146, 146, 146,
- 147, 148, 148, 149, 149, 149, 149, 149, 149, 149,
- 149, 149, 149, 150, 150, 150, 151, 151
+ 13, 16, 19, 22, 25, 28, 30, 33, 36, 39,
+ 42, 45, 48, 50, 53, 55, 58, 61, 63, 65,
+ 68, 71, 73, 75, 78, 80, 83, 85, 87, 89,
+ 91, 94, 97, 100, 103, 105, 107, 110, 112, 113,
+ 113, 113, 114, 114, 114, 115, 115, 116, 117, 118,
+ 118, 118, 118, 119, 119, 119, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 121, 122, 122, 122, 123, 124, 125, 126, 127,
+ 128, 128, 129, 130, 131, 132, 132, 132, 133, 133,
+
+ 133, 133, 134, 135, 136, 136, 136, 136, 136, 136,
+ 137, 137, 137, 138, 138, 138, 138, 138, 139, 140,
+ 140, 141, 142, 143, 144, 145, 146, 146, 146, 147,
+ 147, 147, 148, 148, 148, 148, 149, 149, 149, 150,
+ 151, 151, 151, 151, 151, 152, 153, 153, 154, 154,
+ 154, 154, 154, 154, 154, 154, 154, 154, 155, 155,
+ 155, 156, 156
} ;
static yyconst int yy_ec[256] =
@@ -378,86 +380,88 @@ static yyconst int yy_meta[54] =
1, 1, 1
} ;
-static yyconst short int yy_base[160] =
+static yyconst short int yy_base[165] =
{ 0,
- 0, 0, 45, 54, 69, 71, 239, 240, 53, 62,
- 240, 240, 240, 67, 240, 78, 78, 240, 240, 240,
- 240, 240, 213, 240, 75, 240, 66, 192, 192, 240,
- 205, 190, 195, 70, 59, 71, 74, 195, 186, 185,
- 240, 240, 107, 240, 240, 240, 218, 84, 115, 240,
- 111, 121, 129, 202, 240, 240, 240, 195, 193, 187,
- 240, 133, 177, 240, 181, 108, 188, 172, 180, 175,
- 178, 187, 182, 117, 173, 169, 182, 174, 159, 240,
- 113, 240, 148, 165, 240, 240, 240, 175, 240, 240,
- 240, 240, 176, 175, 171, 168, 169, 163, 240, 240,
-
- 240, 164, 170, 160, 139, 157, 240, 167, 165, 240,
- 151, 155, 146, 240, 240, 166, 240, 240, 240, 240,
- 240, 240, 180, 153, 240, 162, 157, 177, 159, 155,
- 240, 153, 153, 240, 168, 133, 145, 123, 138, 240,
- 240, 120, 240, 119, 133, 118, 130, 130, 119, 107,
- 122, 84, 240, 78, 64, 240, 240, 100, 76
+ 0, 0, 45, 54, 69, 71, 243, 244, 53, 62,
+ 212, 244, 244, 67, 244, 78, 78, 244, 244, 244,
+ 244, 244, 216, 244, 75, 244, 66, 195, 195, 244,
+ 208, 193, 198, 70, 59, 71, 74, 198, 189, 188,
+ 244, 244, 244, 107, 244, 244, 244, 221, 84, 200,
+ 115, 244, 111, 121, 129, 204, 244, 244, 244, 197,
+ 195, 189, 244, 133, 179, 244, 183, 108, 190, 174,
+ 182, 177, 180, 189, 184, 117, 175, 171, 184, 176,
+ 159, 244, 167, 113, 244, 148, 165, 244, 244, 244,
+ 176, 244, 244, 244, 244, 177, 176, 172, 169, 170,
+
+ 164, 244, 244, 244, 165, 171, 161, 139, 158, 244,
+ 168, 166, 244, 152, 192, 155, 146, 244, 244, 166,
+ 244, 244, 244, 244, 244, 244, 180, 153, 244, 162,
+ 157, 244, 177, 159, 155, 244, 153, 153, 244, 168,
+ 133, 145, 123, 138, 244, 244, 120, 244, 119, 133,
+ 118, 130, 130, 119, 107, 122, 84, 244, 78, 64,
+ 244, 244, 100, 76
} ;
-static yyconst short int yy_def[160] =
+static yyconst short int yy_def[165] =
{ 0,
- 157, 1, 1, 1, 158, 158, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 159, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 159, 157, 159, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
-
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 0, 157, 157
+ 162, 1, 1, 1, 163, 163, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 164, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 164, 162, 164, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 0, 162, 162
} ;
-static yyconst short int yy_nxt[294] =
+static yyconst short int yy_nxt[298] =
{ 0,
8, 9, 10, 8, 11, 12, 8, 13, 14, 15,
16, 17, 17, 17, 17, 17, 17, 18, 19, 20,
21, 22, 23, 24, 8, 8, 25, 26, 8, 27,
8, 28, 29, 8, 30, 31, 8, 32, 8, 33,
34, 35, 8, 8, 36, 37, 38, 39, 8, 40,
- 8, 41, 42, 8, 48, 48, 43, 43, 43, 43,
- 43, 43, 8, 48, 48, 43, 43, 43, 43, 43,
- 43, 45, 46, 45, 46, 47, 81, 47, 49, 49,
- 49, 49, 49, 49, 50, 48, 48, 52, 51, 53,
- 53, 53, 53, 53, 53, 55, 56, 58, 59, 66,
-
- 44, 70, 57, 74, 72, 60, 71, 75, 156, 67,
- 73, 155, 68, 82, 83, 82, 83, 69, 79, 79,
- 79, 79, 79, 79, 52, 154, 49, 49, 49, 49,
- 49, 49, 84, 84, 84, 84, 84, 84, 52, 95,
- 53, 53, 53, 53, 53, 53, 89, 90, 91, 105,
- 82, 83, 122, 96, 97, 153, 152, 106, 151, 150,
- 149, 148, 147, 107, 146, 145, 144, 143, 123, 92,
- 79, 79, 79, 79, 79, 79, 84, 84, 84, 84,
- 84, 84, 142, 141, 140, 139, 138, 137, 136, 135,
- 134, 133, 132, 131, 130, 129, 128, 127, 126, 125,
-
- 124, 121, 120, 119, 118, 117, 116, 115, 114, 113,
- 112, 111, 110, 109, 108, 104, 103, 102, 101, 100,
- 99, 98, 94, 93, 88, 87, 86, 85, 80, 78,
- 77, 76, 65, 64, 63, 62, 61, 54, 157, 7,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157
+ 8, 41, 42, 43, 49, 49, 44, 44, 44, 44,
+ 44, 44, 43, 49, 49, 44, 44, 44, 44, 44,
+ 44, 46, 47, 46, 47, 48, 84, 48, 51, 51,
+ 51, 51, 51, 51, 52, 49, 49, 54, 53, 55,
+ 55, 55, 55, 55, 55, 57, 58, 60, 61, 68,
+
+ 45, 72, 59, 76, 74, 62, 73, 77, 161, 69,
+ 75, 160, 70, 85, 86, 85, 86, 71, 81, 81,
+ 81, 81, 81, 81, 54, 159, 51, 51, 51, 51,
+ 51, 51, 87, 87, 87, 87, 87, 87, 54, 98,
+ 55, 55, 55, 55, 55, 55, 92, 93, 94, 108,
+ 85, 86, 126, 99, 100, 158, 157, 109, 156, 155,
+ 154, 153, 152, 110, 151, 150, 149, 148, 127, 95,
+ 81, 81, 81, 81, 81, 81, 87, 87, 87, 87,
+ 87, 87, 147, 146, 145, 144, 143, 142, 141, 140,
+ 139, 138, 137, 136, 135, 134, 133, 132, 131, 130,
+
+ 129, 128, 125, 124, 123, 122, 121, 120, 119, 118,
+ 117, 116, 115, 114, 113, 112, 111, 107, 106, 105,
+ 104, 103, 102, 101, 97, 96, 91, 90, 89, 88,
+ 83, 82, 80, 79, 78, 67, 66, 65, 64, 63,
+ 56, 50, 162, 7, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162
} ;
-static yyconst short int yy_chk[294] =
+static yyconst short int yy_chk[298] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -466,31 +470,31 @@ static yyconst short int yy_chk[294] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 3, 9, 9, 3, 3, 3, 3,
3, 3, 4, 10, 10, 4, 4, 4, 4, 4,
- 4, 5, 5, 6, 6, 5, 159, 6, 14, 14,
- 14, 14, 14, 14, 16, 48, 48, 17, 16, 17,
+ 4, 5, 5, 6, 6, 5, 164, 6, 14, 14,
+ 14, 14, 14, 14, 16, 49, 49, 17, 16, 17,
17, 17, 17, 17, 17, 25, 25, 27, 27, 34,
- 158, 35, 25, 37, 36, 27, 35, 37, 155, 34,
- 36, 154, 34, 51, 51, 81, 81, 34, 43, 43,
- 43, 43, 43, 43, 49, 152, 49, 49, 49, 49,
- 49, 49, 52, 52, 52, 52, 52, 52, 53, 66,
- 53, 53, 53, 53, 53, 53, 62, 62, 62, 74,
- 83, 83, 105, 66, 66, 151, 150, 74, 149, 148,
- 147, 146, 145, 74, 144, 142, 139, 138, 105, 62,
- 79, 79, 79, 79, 79, 79, 84, 84, 84, 84,
- 84, 84, 137, 136, 135, 133, 132, 130, 129, 128,
- 127, 126, 124, 123, 116, 113, 112, 111, 109, 108,
-
- 106, 104, 103, 102, 98, 97, 96, 95, 94, 93,
- 88, 78, 77, 76, 75, 73, 72, 71, 70, 69,
- 68, 67, 65, 63, 60, 59, 58, 54, 47, 40,
- 39, 38, 33, 32, 31, 29, 28, 23, 7, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157, 157, 157, 157, 157, 157, 157, 157,
- 157, 157, 157
+ 163, 35, 25, 37, 36, 27, 35, 37, 160, 34,
+ 36, 159, 34, 53, 53, 84, 84, 34, 44, 44,
+ 44, 44, 44, 44, 51, 157, 51, 51, 51, 51,
+ 51, 51, 54, 54, 54, 54, 54, 54, 55, 68,
+ 55, 55, 55, 55, 55, 55, 64, 64, 64, 76,
+ 86, 86, 108, 68, 68, 156, 155, 76, 154, 153,
+ 152, 151, 150, 76, 149, 147, 144, 143, 108, 64,
+ 81, 81, 81, 81, 81, 81, 87, 87, 87, 87,
+ 87, 87, 142, 141, 140, 138, 137, 135, 134, 133,
+ 131, 130, 128, 127, 120, 117, 116, 115, 114, 112,
+
+ 111, 109, 107, 106, 105, 101, 100, 99, 98, 97,
+ 96, 91, 83, 80, 79, 78, 77, 75, 74, 73,
+ 72, 71, 70, 69, 67, 65, 62, 61, 60, 56,
+ 50, 48, 40, 39, 38, 33, 32, 31, 29, 28,
+ 23, 11, 7, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162
} ;
@@ -719,14 +723,14 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 158 )
+ if ( yy_current_state >= 163 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
*yy_state_ptr++ = yy_current_state;
++yy_cp;
}
- while ( yy_base[yy_current_state] != 240 );
+ while ( yy_base[yy_current_state] != 244 );
yy_find_action:
yy_current_state = *--yy_state_ptr;
@@ -961,58 +965,68 @@ YY_RULE_SETUP
#line 66 "lex.l"
{ return DOT; }
YY_BREAK
-/* XXX: this lexing of register files is shady */
case 39:
YY_RULE_SETUP
-#line 69 "lex.l"
+#line 67 "lex.l"
+{ return MINUS; }
+ YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 68 "lex.l"
+{ return ABS; }
+ YY_BREAK
+/* XXX: this lexing of register files is shady */
+case 41:
+YY_RULE_SETUP
+#line 71 "lex.l"
{
BEGIN(IN_REG);
return ACCREG;
}
YY_BREAK
-case 40:
+case 42:
YY_RULE_SETUP
-#line 73 "lex.l"
+#line 75 "lex.l"
{
BEGIN(IN_REG);
return ADDRESSREG;
}
YY_BREAK
-case 41:
+case 43:
YY_RULE_SETUP
-#line 77 "lex.l"
+#line 79 "lex.l"
{
BEGIN(IN_REG);
return MSGREG;
}
YY_BREAK
-case 42:
+case 44:
YY_RULE_SETUP
-#line 81 "lex.l"
+#line 83 "lex.l"
{
BEGIN(IN_REG);
return FLAGREG;
}
YY_BREAK
-case 43:
+case 45:
YY_RULE_SETUP
-#line 85 "lex.l"
+#line 87 "lex.l"
{
BEGIN(IN_REG);
return GENREG;
}
YY_BREAK
-case 44:
+case 46:
YY_RULE_SETUP
-#line 89 "lex.l"
+#line 91 "lex.l"
{
BEGIN(IN_REG);
return CONTROLREG;
}
YY_BREAK
-case 45:
+case 47:
YY_RULE_SETUP
-#line 93 "lex.l"
+#line 95 "lex.l"
{
BEGIN(IN_REG);
return IPREG;
@@ -1022,99 +1036,99 @@ YY_RULE_SETUP
* Lexing of register types should probably require the ":" symbol specified
* in the BNF of the assembly, but our existing source didn't use that syntax.
*/
-case 46:
-YY_RULE_SETUP
-#line 102 "lex.l"
-{ BEGIN(INITIAL); return TYPE_UD; }
- YY_BREAK
-case 47:
-YY_RULE_SETUP
-#line 103 "lex.l"
-{ BEGIN(INITIAL); return TYPE_D; }
- YY_BREAK
case 48:
YY_RULE_SETUP
#line 104 "lex.l"
-{ BEGIN(INITIAL); return TYPE_UW; }
+{ BEGIN(INITIAL); return TYPE_UD; }
YY_BREAK
case 49:
YY_RULE_SETUP
#line 105 "lex.l"
-{ BEGIN(INITIAL); return TYPE_W; }
+{ BEGIN(INITIAL); return TYPE_D; }
YY_BREAK
case 50:
YY_RULE_SETUP
#line 106 "lex.l"
-{ BEGIN(INITIAL); return TYPE_UB; }
+{ BEGIN(INITIAL); return TYPE_UW; }
YY_BREAK
case 51:
YY_RULE_SETUP
#line 107 "lex.l"
-{ BEGIN(INITIAL); return TYPE_B; }
+{ BEGIN(INITIAL); return TYPE_W; }
YY_BREAK
case 52:
YY_RULE_SETUP
#line 108 "lex.l"
-{ BEGIN(INITIAL); return TYPE_F; }
+{ BEGIN(INITIAL); return TYPE_UB; }
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 110 "lex.l"
-{ return SATURATE; }
+#line 109 "lex.l"
+{ BEGIN(INITIAL); return TYPE_B; }
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 111 "lex.l"
-{ return ALIGN1; }
+#line 110 "lex.l"
+{ BEGIN(INITIAL); return TYPE_F; }
YY_BREAK
case 55:
YY_RULE_SETUP
#line 112 "lex.l"
-{ return ALIGN16; }
+{ return SATURATE; }
YY_BREAK
case 56:
YY_RULE_SETUP
#line 113 "lex.l"
-{ return MASK_DISABLE; }
+{ return ALIGN1; }
YY_BREAK
case 57:
YY_RULE_SETUP
#line 114 "lex.l"
-{ return EOT; }
+{ return ALIGN16; }
YY_BREAK
case 58:
YY_RULE_SETUP
+#line 115 "lex.l"
+{ return MASK_DISABLE; }
+ YY_BREAK
+case 59:
+YY_RULE_SETUP
#line 116 "lex.l"
+{ return EOT; }
+ YY_BREAK
+case 60:
+YY_RULE_SETUP
+#line 118 "lex.l"
{
yylval.integer = atoi(yytext);
return INTEGER;
}
YY_BREAK
-case 59:
+case 61:
YY_RULE_SETUP
-#line 121 "lex.l"
+#line 123 "lex.l"
{
yylval.number = strtod(yytext, NULL);
return NUMBER;
}
YY_BREAK
-case 60:
+case 62:
YY_RULE_SETUP
-#line 126 "lex.l"
+#line 128 "lex.l"
{ } /* eat up whitespace */
YY_BREAK
-case 61:
+case 63:
YY_RULE_SETUP
-#line 128 "lex.l"
+#line 130 "lex.l"
{
printf("parse error at line %d: unexpected \"%s\"\n",
yylineno, yytext);
exit(1);
}
YY_BREAK
-case 62:
+case 64:
YY_RULE_SETUP
-#line 133 "lex.l"
+#line 135 "lex.l"
ECHO;
YY_BREAK
case YY_STATE_EOF(INITIAL):
@@ -1407,7 +1421,7 @@ static yy_state_type yy_get_previous_state()
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 158 )
+ if ( yy_current_state >= 163 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1437,11 +1451,11 @@ yy_state_type yy_current_state;
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 158 )
+ if ( yy_current_state >= 163 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 157);
+ yy_is_jam = (yy_current_state == 162);
if ( ! yy_is_jam )
*yy_state_ptr++ = yy_current_state;
@@ -2002,7 +2016,7 @@ int main()
return 0;
}
#endif
-#line 133 "lex.l"
+#line 135 "lex.l"
char *
diff --git a/assembler/lex.l b/assembler/lex.l
index b1a96bc7..1e58b6ac 100644
--- a/assembler/lex.l
+++ b/assembler/lex.l
@@ -64,6 +64,8 @@ int saved_state = INITIAL;
"}" { return RCURLY; }
"," { return COMMA; }
"." { return DOT; }
+"-" { return MINUS; }
+"(abs)" { return ABS; }
/* XXX: this lexing of register files is shady */
"acc" {
diff --git a/assembler/packed_yuv_wm.g4a b/assembler/packed_yuv_wm.g4a
index d6f1ba54..9affda9b 100644
--- a/assembler/packed_yuv_wm.g4a
+++ b/assembler/packed_yuv_wm.g4a
@@ -62,8 +62,8 @@ add (1) g7.28<1>F g1.22<0,1,0>UW 1UB { align1 };
/* Now, map these screen space coordinates into texture coordinates. */
/* subtract screen-space X origin of vertex 0. */
-add (8) g4<1>F g4<8,8,1>F g1<0,1,0>F { align1 };
-add (8) g5<1>F g5<8,8,1>F g1<0,1,0>F { align1 };
+add (8) g4<1>F g4<8,8,1>F -g1<0,1,0>F { align1 };
+add (8) g5<1>F g5<8,8,1>F -g1<0,1,0>F { align1 };
/* scale by texture X increment */
mul (8) g4<1>F g4<8,8,1>F g3<0,1,0>F { align1 };
mul (8) g5<1>F g5<8,8,1>F g3<0,1,0>F { align1 };
@@ -71,8 +71,8 @@ mul (8) g5<1>F g5<8,8,1>F g3<0,1,0>F { align1 };
add (8) g4<1>F g4<8,8,1>F g3.12<0,1,0>F { align1 };
add (8) g5<1>F g5<8,8,1>F g3.12<0,1,0>F { align1 };
/* subtract screen-space Y origin of vertex 0. */
-add (8) g6<1>F g6<8,8,1>F g1.4<0,1,0>F { align1 };
-add (8) g7<1>F g7<8,8,1>F g1.4<0,1,0>F { align1 };
+add (8) g6<1>F g6<8,8,1>F -g1.4<0,1,0>F { align1 };
+add (8) g7<1>F g7<8,8,1>F -g1.4<0,1,0>F { align1 };
/* scale by texture Y increment */
mul (8) g6<1>F g6<8,8,1>F g3.20<0,1,0>F { align1 };
mul (8) g7<1>F g7<8,8,1>F g3.20<0,1,0>F { align1 };