Mesa (master): intel/tools: Remove unnecessary reg number checking

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 19 02:24:09 UTC 2020


Module: Mesa
Branch: master
Commit: 27557e71102055889cc9d2213024e154655b3d92
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=27557e71102055889cc9d2213024e154655b3d92

Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Jun 16 16:53:57 2020 -0700

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 at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5514>

---

 src/intel/tools/i965_gram.y | 9 ---------
 src/intel/tools/i965_lex.l  | 2 +-
 2 files changed, 1 insertion(+), 10 deletions(-)

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; }



More information about the mesa-commit mailing list