From: Matt Turner Date: Tue, 16 Jun 2020 23:53:57 +0000 (-0700) Subject: intel/tools: Remove unnecessary reg number checking X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27557e71102055889cc9d2213024e154655b3d92;p=mesa.git 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 Part-of: --- diff --git a/src/intel/tools/i965_gram.y b/src/intel/tools/i965_gram.y index e208b0ebc47..989401d3b1e 100644 --- a/src/intel/tools/i965_gram.y +++ b/src/intel/tools/i965_gram.y @@ -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; } ; diff --git a/src/intel/tools/i965_lex.l b/src/intel/tools/i965_lex.l index 3732c6c24c0..9768c83d5a6 100644 --- a/src/intel/tools/i965_lex.l +++ b/src/intel/tools/i965_lex.l @@ -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; }