mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-09 08:56:11 +00:00
Change the rule for flag register
The shift/reduce conflict mentioned in the comment has been fixed, so flagreg can return the reg number in the lvalue now. In addition, it will be easy to add support for flag register f1 on Ivy bridge Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
This commit is contained in:
parent
128053f120
commit
f3f6ba24e6
@ -1847,12 +1847,24 @@ accreg: ACCREG subregnum
|
||||
}
|
||||
;
|
||||
|
||||
flagreg: FLAGREG
|
||||
flagreg: FLAGREG subregnum
|
||||
{
|
||||
if ($1 > 0) {
|
||||
fprintf(stderr,
|
||||
"flag register number %d out of range\n", $1);
|
||||
YYERROR;
|
||||
}
|
||||
|
||||
if ($2 > 1) {
|
||||
fprintf(stderr,
|
||||
"flag subregister number %d out of range\n", $1);
|
||||
YYERROR;
|
||||
}
|
||||
|
||||
memset (&$$, '\0', sizeof ($$));
|
||||
$$.reg_file = BRW_ARCHITECTURE_REGISTER_FILE;
|
||||
$$.reg_nr = BRW_ARF_FLAG | 0;
|
||||
$$.subreg_nr = $1;
|
||||
$$.reg_nr = BRW_ARF_FLAG | $1;
|
||||
$$.subreg_nr = $2;
|
||||
}
|
||||
;
|
||||
|
||||
|
@ -210,18 +210,12 @@ yylval.integer = BRW_CHANNEL_W;
|
||||
yylval.integer = atoi(yytext + 1);
|
||||
return NOTIFYREG;
|
||||
}
|
||||
/* Unlike other registers, flagreg returns the subreg number in the lvalue
|
||||
* rather than the reg number, to avoid a shift/reduce conflict in the
|
||||
* predicate control.
|
||||
*/
|
||||
"f0."[0-9]+ {
|
||||
yylval.integer = atoi(yytext + 3);
|
||||
return FLAGREG;
|
||||
}
|
||||
"f0" {
|
||||
yylval.integer = 0;
|
||||
|
||||
"f"[0-9] {
|
||||
yylval.integer = atoi(yytext + 1);
|
||||
return FLAGREG;
|
||||
}
|
||||
|
||||
[gr][0-9]+ {
|
||||
yylval.integer = atoi(yytext + 1);
|
||||
return GENREG;
|
||||
|
Loading…
x
Reference in New Issue
Block a user