mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 10:26:12 +00:00
Avoid shift/reduce conflict in predicate by making flagreg and subreg 1 token.
Thanks to keithp for pointing out where the conflict was.
This commit is contained in:
parent
0ed5d93cc2
commit
de1a889fe3
@ -651,16 +651,11 @@ accreg: ACCREG subregnum
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
flagreg: FLAGREG subregnum
|
flagreg: FLAGREG
|
||||||
{
|
{
|
||||||
if ($1 > 0) {
|
|
||||||
fprintf(stderr,
|
|
||||||
"flag register number %d out of range", $1);
|
|
||||||
YYERROR;
|
|
||||||
}
|
|
||||||
$$.reg_file = BRW_ARCHITECTURE_REGISTER_FILE;
|
$$.reg_file = BRW_ARCHITECTURE_REGISTER_FILE;
|
||||||
$$.reg_nr = BRW_ARF_FLAG | $1;
|
$$.reg_nr = BRW_ARF_FLAG | 0;
|
||||||
$$.subreg_nr = $2;
|
$$.subreg_nr = $1;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -136,8 +136,16 @@ int saved_state = INITIAL;
|
|||||||
yylval.integer = atoi(yytext + 1);
|
yylval.integer = atoi(yytext + 1);
|
||||||
return NOTIFYREG;
|
return NOTIFYREG;
|
||||||
}
|
}
|
||||||
"f"[0-9]+ {
|
/* Unlike other registers, flagreg returns the subreg number in the lvalue
|
||||||
yylval.integer = atoi(yytext + 1);
|
* 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;
|
||||||
return FLAGREG;
|
return FLAGREG;
|
||||||
}
|
}
|
||||||
[gr][0-9]+ {
|
[gr][0-9]+ {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user