From: Xiang, Haihao Date: Tue, 25 Mar 2014 05:55:14 +0000 (+0800) Subject: assembler: distinguish the channel of .z from the condition of .z X-Git-Tag: intel-gpu-tools-1.7~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=737d248a127f51d20555de53b9dfe28ca4682b54;p=profile%2Fextras%2Fintel-gpu-tools.git assembler: distinguish the channel of .z from the condition of .z The scratch patch only works for generic register Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75631 Tested-by: Matt Turner Signed-off-by: Xiang, Haihao Signed-off-by: Damien Lespiau --- diff --git a/assembler/lex.l b/assembler/lex.l index 81a52ba..1ba576b 100644 --- a/assembler/lex.l +++ b/assembler/lex.l @@ -24,6 +24,8 @@ int yycolumn = 1; %x CHANNEL %x LINENUMBER %x FILENAME +%x REG +%x DOTSEL %% \/\/.*[\r\n] { yycolumn = 1; } /* eat up single-line comments */ @@ -247,8 +249,46 @@ yylval.integer = BRW_CHANNEL_W; [gr][0-9]+ { yylval.integer = atoi(yytext + 1); + BEGIN(REG); return GENREG; } +"<" { return LANGLE; } +[0-9][0-9]* { + yylval.integer = strtoul(yytext, NULL, 10); + return INTEGER; +} +">" { return RANGLE; } + +"," { return COMMA; } +"." { BEGIN(DOTSEL); return DOT; } +";" { return SEMICOLON; } + +"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][0-9]* { + yylval.integer = strtoul(yytext, NULL, 10); + BEGIN(REG); + return INTEGER; +} +. { + yyless(0); + BEGIN(INITIAL); +} + [gr] { return GENREGFILE; } @@ -296,6 +336,11 @@ yylval.integer = BRW_CHANNEL_W; return LMS; } +. { + yyless(0); + BEGIN(INITIAL); +} + /* * 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.