From: Rob Clark Date: Fri, 17 Jul 2020 16:35:18 +0000 (-0700) Subject: freedreno/ir3/parser: half-precision relative regs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0472ca2aa5c47cf2b6e0b0c6972d6f5c79ba35a1;p=mesa.git freedreno/ir3/parser: half-precision relative regs Signed-off-by: Rob Clark Part-of: --- 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 T_ABS %token T_R +%token T_HR +%token T_HC + /* dst register flags */ %token T_EVEN %token 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; }