a0 is the only address register, and cr0 is the only control register,
so there's no need to return the register number, espcially since the
lexer explicitly consumes "a0" and "cr0".
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5514>
addrreg:
ADDRREG subregnum
{
- if ($1 != 0)
- error(&@1, "Address register number %d"
- "out of range\n", $1);
-
int subnr = (p->devinfo->gen >= 8) ? 16 : 8;
if ($2 > subnr)
controlreg:
CONTROLREG subregnum
{
- if ($1 > 0)
- error(&@1, "Control register number %d"
- " out of range\n", $1);
-
if ($2 > 4)
error(&@2, "control sub register number %d"
" out of range\n", $2);
$$ = brw_cr0_reg($2);
- $$.nr = $1;
}
;
:?W { return TYPE_W; }
/* Address registers */
-"a0" { yylval.integer = atoi(yytext + 1); BEGIN(REG); return ADDRREG; }
+"a0" { return ADDRREG; }
/* accumulator registers */
"acc"[0-9]+ { yylval.integer = atoi(yytext + 3); return ACCREG; }