intel/tools: Remove unnecessary reg number checking

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>
This commit is contained in:
Matt Turner 2020-06-16 16:53:57 -07:00 committed by Marge Bot
parent f8110226ba
commit 27557e7110
2 changed files with 1 additions and 10 deletions

View File

@ -1771,10 +1771,6 @@ indirectmsgreg:
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)
@ -1875,16 +1871,11 @@ statereg:
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;
}
;

View File

@ -311,7 +311,7 @@ sechalf { return SECHALF; }
:?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; }