intel/tools: Remove unnecessary reg number checking
authorMatt Turner <mattst88@gmail.com>
Tue, 16 Jun 2020 23:53:57 +0000 (16:53 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 19 Jun 2020 02:10:40 +0000 (02:10 +0000)
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>

src/intel/tools/i965_gram.y
src/intel/tools/i965_lex.l

index e208b0ebc47b3a310cfaedbf1cba7b3da821d522..989401d3b1e9daf73d609abc6843f69859b24353 100644 (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;
        }
        ;
 
index 3732c6c24c044296aeddd6c59ff46f38c65e3a4c..9768c83d5a6c605bfb7a6d4d59c875e934f39178 100644 (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; }