aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2020-07-17 09:35:18 -0700
committerRob Clark <[email protected]>2020-07-18 09:14:13 -0700
commit0472ca2aa5c47cf2b6e0b0c6972d6f5c79ba35a1 (patch)
tree36856ebe02dd006082c4a7de9c5ffdff569d06d6
parent79b0651c245093479bf0430b87b16fedae5a9764 (diff)
freedreno/ir3/parser: half-precision relative regs
Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5957>
-rw-r--r--src/freedreno/ir3/ir3_lexer.l2
-rw-r--r--src/freedreno/ir3/ir3_parser.y5
2 files changed, 7 insertions, 0 deletions
diff --git a/src/freedreno/ir3/ir3_lexer.l b/src/freedreno/ir3/ir3_lexer.l
index 823cb1587dc..f93d25b5328 100644
--- a/src/freedreno/ir3/ir3_lexer.l
+++ b/src/freedreno/ir3/ir3_lexer.l
@@ -308,6 +308,8 @@ static int parse_reg(const char *str)
"|" return '|';
"c" return 'c';
"r" return 'r';
+"hc" return TOKEN(T_HC);
+"hr" return TOKEN(T_HR);
"g" return 'g';
"l" return 'l';
"<" return '<';
diff --git a/src/freedreno/ir3/ir3_parser.y b/src/freedreno/ir3/ir3_parser.y
index 27c52bd21e9..6c06f1d3e03 100644
--- a/src/freedreno/ir3/ir3_parser.y
+++ b/src/freedreno/ir3/ir3_parser.y
@@ -266,6 +266,9 @@ static void print_token(FILE *file, int type, YYSTYPE value)
%token <tok> T_ABS
%token <tok> T_R
+%token <tok> T_HR
+%token <tok> T_HC
+
/* dst register flags */
%token <tok> T_EVEN
%token <tok> T_POS_INFINITY
@@ -873,6 +876,8 @@ offset: { $$ = 0; }
relative: 'r' '<' T_A0 offset '>' { new_reg(0, IR3_REG_RELATIV)->array.offset = $4; }
| 'c' '<' T_A0 offset '>' { new_reg(0, IR3_REG_RELATIV | IR3_REG_CONST)->array.offset = $4; }
+| T_HR '<' T_A0 offset '>' { new_reg(0, IR3_REG_RELATIV | IR3_REG_HALF)->array.offset = $4; }
+| T_HC '<' T_A0 offset '>' { new_reg(0, IR3_REG_RELATIV | IR3_REG_CONST | IR3_REG_HALF)->array.offset = $4; }
immediate: integer { new_reg(0, IR3_REG_IMMED)->iim_val = $1; }
| '(' integer ')' { new_reg(0, IR3_REG_IMMED)->fim_val = $2; }