ir3: Add EOLM and EOGM a7xx flags to NOP

Apparently the ignored bits have meaning.
- EOLM - Is set on a NOP after the last cat6 instruction.
         Must be set outside of control flow including preambles.
         Doesn't seem to affect correctness.
- EOGM - Is set on a NOP after the last cat5/cat6 instruction.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37009>
This commit is contained in:
Danylo Piliaiev 2023-07-27 10:48:39 +02:00 committed by Marge Bot
parent 0e6b24451d
commit 065d2547e7
5 changed files with 31 additions and 2 deletions

View file

@ -402,6 +402,12 @@ typedef enum ir3_instruction_flags {
* their sources.
*/
IR3_INSTR_IMM_OFFSET = BIT(21),
/* a7xx, set on a nop after all cat6 */
IR3_INSTR_EOLM = BIT(22),
/* a7xx, set on a nop after all cat5/cat6 */
IR3_INSTR_EOGM = BIT(23),
} ir3_instruction_flags;
struct ir3_instruction {

View file

@ -171,6 +171,8 @@ static int parse_reg(const char *str)
"(jp)" return TOKEN(T_JP);
"(eq)" return TOKEN(T_EQ_FLAG);
"(sat)" return TOKEN(T_SAT);
"(eolm)" return TOKEN(T_EOLM);
"(eogm)" return TOKEN(T_EOGM);
"(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;

View file

@ -460,6 +460,8 @@ static void print_token(FILE *file, int type, YYSTYPE value)
%token <num> T_RPT
%token <tok> T_UL
%token <tok> T_NOP
%token <tok> T_EOLM
%token <tok> T_EOGM
/* category 0: */
%token <tok> T_OP_NOP
@ -932,6 +934,8 @@ iflag: T_SY { iflags.flags |= IR3_INSTR_SY; }
| T_RPT { iflags.repeat = $1; }
| T_UL { iflags.flags |= IR3_INSTR_UL; }
| T_NOP { iflags.nop = $1; }
| T_EOLM { iflags.flags |= IR3_INSTR_EOLM; }
| T_EOGM { iflags.flags |= IR3_INSTR_EOGM; }
iflags:
| iflag iflags

View file

@ -68,6 +68,9 @@ static const struct test {
INSTR_6XX(07020000_00000000, "predf"),
INSTR_6XX(07820000_00000000, "prede"),
INSTR_7XX(00000003_00000000, "(eolm)(eogm)nop"),
INSTR_7XX(00000001_00000000, "(eolm)nop"),
/* cat1 */
INSTR_6XX(20244000_00000020, "mov.f32f32 r0.x, c8.x"),
INSTR_6XX(20200000_00000020, "mov.f16f16 hr0.x, hc8.x"),

View file

@ -50,15 +50,29 @@ SOFTWARE.
<map name="INV1">src->cat0.inv1</map>
<map name="INV2">src->cat0.inv2</map>
<map name="EQ">!!(src->flags &amp; IR3_INSTR_EQ)</map>
<map name="EOLM">!!(src->flags &amp; IR3_INSTR_EOLM)</map>
<map name="EOGM">!!(src->flags &amp; IR3_INSTR_EOGM)</map>
</encode>
</bitset>
<bitset name="#instruction-cat0-0src" extends="#instruction-cat0">
<display>
{SY}{SS}{EQ}{JP}{REPEAT}{NAME}
{SY}{SS}{EQ}{JP}{EOLM}{EOGM}{REPEAT}{NAME}
</display>
<pattern low="32" high="36">xxxxx</pattern>
<field name="EOLM" pos="32" type="bool" display="(eolm)">
<doc>
Is set on a NOP after the last cat6 instruction. Must be set outside
of control flow including preambles. Doesn't seem to affect correctness.
</doc>
</field>
<field name="EOGM" pos="33" type="bool" display="(eogm)">
<doc>
Is set on a NOP after the last cat5/cat6 instruction. Must be set outside
of control flow including preambles. Doesn't seem to affect correctness.
</doc>
</field>
<pattern low="34" high="36">000</pattern>
<pattern low="37" high="39">000</pattern> <!-- BRTYPE -->
<pattern low="45" high="47">000</pattern> <!-- src1 -->
<pattern low="52" high="54">000</pattern> <!-- src0 -->