aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/bifrost/bi_print.c17
-rw-r--r--src/panfrost/bifrost/bi_print.h1
-rw-r--r--src/panfrost/bifrost/bifrost.h16
-rw-r--r--src/panfrost/bifrost/disassemble.c9
4 files changed, 40 insertions, 3 deletions
diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c
index 389d4fff409..2a03b3cab5d 100644
--- a/src/panfrost/bifrost/bi_print.c
+++ b/src/panfrost/bifrost/bi_print.c
@@ -27,6 +27,23 @@
#include "bi_print.h"
const char *
+bi_clause_type_name(enum bifrost_clause_type T)
+{
+ switch (T) {
+ case BIFROST_CLAUSE_NONE: return "";
+ case BIFROST_CLAUSE_LOAD_VARY: return "load_vary";
+ case BIFROST_CLAUSE_UBO: return "ubo";
+ case BIFROST_CLAUSE_TEX: return "tex";
+ case BIFROST_CLAUSE_SSBO_LOAD: return "load";
+ case BIFROST_CLAUSE_SSBO_STORE: return "store";
+ case BIFROST_CLAUSE_BLEND: return "blend";
+ case BIFROST_CLAUSE_ATEST: return "atest";
+ case BIFROST_CLAUSE_64BIT: return "64";
+ default: return "??";
+ }
+}
+
+const char *
bi_output_mod_name(enum bifrost_outmod mod)
{
switch (mod) {
diff --git a/src/panfrost/bifrost/bi_print.h b/src/panfrost/bifrost/bi_print.h
index 545f5254ae4..04e3851c11f 100644
--- a/src/panfrost/bifrost/bi_print.h
+++ b/src/panfrost/bifrost/bi_print.h
@@ -31,6 +31,7 @@
#include "bifrost.h"
#include "compiler.h"
+const char * bi_clause_type_name(enum bifrost_clause_type T);
const char * bi_output_mod_name(enum bifrost_outmod mod);
const char * bi_minmax_mode_name(enum bifrost_minmax_mode mod);
const char * bi_round_mode_name(enum bifrost_roundmode mod);
diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h
index c7e6bcf8630..959ef94f6c1 100644
--- a/src/panfrost/bifrost/bifrost.h
+++ b/src/panfrost/bifrost/bifrost.h
@@ -29,6 +29,18 @@
#include <stdint.h>
#include <stdbool.h>
+enum bifrost_clause_type {
+ BIFROST_CLAUSE_NONE = 0,
+ BIFROST_CLAUSE_LOAD_VARY = 1,
+ BIFROST_CLAUSE_UBO = 2,
+ BIFROST_CLAUSE_TEX = 3,
+ BIFROST_CLAUSE_SSBO_LOAD = 5,
+ BIFROST_CLAUSE_SSBO_STORE = 6,
+ BIFROST_CLAUSE_BLEND = 9,
+ BIFROST_CLAUSE_ATEST = 13,
+ BIFROST_CLAUSE_64BIT = 15
+};
+
struct bifrost_header {
unsigned unk0 : 7;
// If true, convert any infinite result of any floating-point operation to
@@ -66,9 +78,9 @@ struct bifrost_header {
unsigned datareg : 6;
unsigned scoreboard_deps: 8;
unsigned scoreboard_index: 3;
- unsigned clause_type: 4;
+ enum bifrost_clause_type clause_type: 4;
unsigned unk3 : 1; // part of clauseType?
- unsigned next_clause_type: 4;
+ enum bifrost_clause_type next_clause_type: 4;
unsigned unk4 : 1; // part of nextClauseType?
} __attribute__((packed));
diff --git a/src/panfrost/bifrost/disassemble.c b/src/panfrost/bifrost/disassemble.c
index 367cc5b9626..e025d5c89d4 100644
--- a/src/panfrost/bifrost/disassemble.c
+++ b/src/panfrost/bifrost/disassemble.c
@@ -136,8 +136,15 @@ bool dump_clause(FILE *fp, uint32_t *words, unsigned *size, unsigned offset, boo
void dump_header(FILE *fp, struct bifrost_header header, bool verbose)
{
+ fprintf(fp, "id(%du) ", header.scoreboard_index);
+
if (header.clause_type != 0) {
- fprintf(fp, "id(%du) ", header.scoreboard_index);
+ const char *name = bi_clause_type_name(header.clause_type);
+
+ if (name[0] == '?')
+ fprintf(fp, "unk%u ", header.clause_type);
+ else
+ fprintf(fp, "%s ", name);
}
if (header.scoreboard_deps != 0) {