freedreno/ir3/parser: half-precision relative regs
authorRob Clark <robdclark@chromium.org>
Fri, 17 Jul 2020 16:35:18 +0000 (09:35 -0700)
committerRob Clark <robdclark@chromium.org>
Sat, 18 Jul 2020 16:14:13 +0000 (09:14 -0700)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5957>

src/freedreno/ir3/ir3_lexer.l
src/freedreno/ir3/ir3_parser.y

index 823cb1587dcb21120901a50f8471f5cfb70e006f..f93d25b5328fb5f2250eda09b83f90e1242747a6 100644 (file)
@@ -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 '<';
index 27c52bd21e91aeb0097a38d4de44c08aff258300..6c06f1d3e03157ed5fecfa4ca23837993ea8e893 100644 (file)
@@ -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; }