Mesa (master): freedreno/computerator: support nop prefix

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 13 20:34:21 UTC 2020


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

Author: Jonathan Marek <jonathan at marek.ca>
Date:   Sat Apr 11 18:28:09 2020 -0400

freedreno/computerator: support nop prefix

Signed-off-by: Jonathan Marek <jonathan at marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4526>

---

 src/freedreno/computerator/ir3_lexer.l  | 1 +
 src/freedreno/computerator/ir3_parser.y | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/freedreno/computerator/ir3_lexer.l b/src/freedreno/computerator/ir3_lexer.l
index 5823dd0e43c..44ccd47904c 100644
--- a/src/freedreno/computerator/ir3_lexer.l
+++ b/src/freedreno/computerator/ir3_lexer.l
@@ -91,6 +91,7 @@ static int parse_reg(const char *str)
 "(ei)"                            return TOKEN(T_EI);
 "(jp)"                            return TOKEN(T_JP);
 "(rpt"[0-7]")"                    ir3_yylval.num = strtol(yytext+4, NULL, 10); return T_RPT;
+"(nop"[0-7]")"                    ir3_yylval.num = strtol(yytext+4, NULL, 10); return T_NOP;
 "("[x]?[y]?[z]?[w]?")"            ir3_yylval.num = parse_wrmask(yytext); return T_WRMASK;
 
 [h]?"r"[0-9]+"."[xyzw]            ir3_yylval.num = parse_reg(yytext); return T_REGISTER;
diff --git a/src/freedreno/computerator/ir3_parser.y b/src/freedreno/computerator/ir3_parser.y
index 349b5578eda..1dfa2c0f687 100644
--- a/src/freedreno/computerator/ir3_parser.y
+++ b/src/freedreno/computerator/ir3_parser.y
@@ -65,6 +65,7 @@ static struct ir3_instruction    *instr;   /* current instruction */
 static struct {
 	unsigned flags;
 	unsigned repeat;
+	unsigned nop;
 } iflags;
 
 static struct {
@@ -79,8 +80,9 @@ static struct ir3_instruction * new_instr(opc_t opc)
 	instr = ir3_instr_create(block, opc);
 	instr->flags = iflags.flags;
 	instr->repeat = iflags.repeat;
+	instr->nop = iflags.nop;
 	instr->line = ir3_yyget_lineno();
-	iflags.flags = iflags.repeat = 0;
+	iflags.flags = iflags.repeat = iflags.nop = 0;
 	return instr;
 }
 
@@ -266,6 +268,7 @@ static void print_token(FILE *file, int type, YYSTYPE value)
 %token <tok> T_JP
 %token <num> T_RPT
 %token <tok> T_UL
+%token <tok> T_NOP
 
 /* category 0: */
 %token <tok> T_OP_NOP
@@ -540,6 +543,7 @@ iflag:             T_SY   { iflags.flags |= IR3_INSTR_SY; }
 |                  T_JP   { iflags.flags |= IR3_INSTR_JP; }
 |                  T_RPT  { iflags.repeat = $1; }
 |                  T_UL   { iflags.flags |= IR3_INSTR_UL; }
+|                  T_NOP  { iflags.nop = $1; }
 
 iflags:
 |                  iflag iflags



More information about the mesa-commit mailing list