freedreno/ir3/parser: add cat7 support

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8420>
This commit is contained in:
Danylo Piliaiev 2021-01-11 18:27:12 +02:00 committed by Marge Bot
parent f8fe2ca600
commit 5e2cee57c5
3 changed files with 30 additions and 0 deletions

View File

@ -335,6 +335,10 @@ static int parse_w(const char *str)
"getspid" return TOKEN(T_OP_GETSPID);
"getwid" return TOKEN(T_OP_GETWID);
/* category 7: */
"bar" return TOKEN(T_OP_BAR);
"fence" return TOKEN(T_OP_FENCE);
"f16" return TOKEN(T_TYPE_F16);
"f32" return TOKEN(T_TYPE_F32);
"u16" return TOKEN(T_TYPE_U16);
@ -386,6 +390,7 @@ static int parse_w(const char *str)
"hc" return TOKEN(T_HC);
"hr" return TOKEN(T_HR);
"g" return 'g';
"w" return 'w';
"l" return 'l';
"<" return '<';
">" return '>';

View File

@ -515,6 +515,10 @@ static void print_token(FILE *file, int type, YYSTYPE value)
%token <tok> T_OP_GETSPID
%token <tok> T_OP_GETWID
/* category 7: */
%token <tok> T_OP_BAR
%token <tok> T_OP_FENCE
/* type qualifiers: */
%token <tok> T_TYPE_F16
%token <tok> T_TYPE_F32
@ -666,6 +670,7 @@ instr: iflags cat0_instr
| iflags cat4_instr
| iflags cat5_instr { fixup_cat5_s2en(); }
| iflags cat6_instr
| iflags cat7_instr
cat0_src1: '!' T_P0 { instr->cat0.inv1 = true; instr->cat0.comp1 = $2 >> 1; }
| T_P0 { instr->cat0.comp1 = $1 >> 1; }
@ -1037,6 +1042,19 @@ cat6_instr: cat6_load
| cat6_bindless_ibo
| cat6_todo
cat7_scope: '.' 'w' { instr->cat7.w = true; }
| '.' 'r' { instr->cat7.r = true; }
| '.' 'l' { instr->cat7.l = true; }
| '.' 'g' { instr->cat7.g = true; }
cat7_scopes:
| cat7_scope cat7_scopes
cat7_barrier: T_OP_BAR { new_instr(OPC_BAR); } cat7_scopes
| T_OP_FENCE { new_instr(OPC_FENCE); } cat7_scopes
cat7_instr: cat7_barrier
reg: T_REGISTER { $$ = new_reg($1, 0); }
| T_A0 { $$ = new_reg((61 << 3), IR3_REG_HALF); }
| T_A1 { $$ = new_reg((61 << 3) + 1, IR3_REG_HALF); }

View File

@ -308,6 +308,13 @@ static const struct test {
/* Custom test since we've never seen the blob emit these. */
INSTR_6XX(c0260004_00490000, "getspid.u32 r1.x"),
INSTR_6XX(c0260005_00494000, "getwid.u32 r1.y"),
/* cat7 */
/* dEQP-VK.compute.basic.ssbo_local_barrier_single_invocation */
INSTR_6XX(e0fa0000_00000000, "fence.g.l.r.w"),
INSTR_6XX(e09a0000_00000000, "fence.r.w"),
INSTR_6XX(f0420000_00000000, "(sy)bar.g"),
};
static void