diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-03-04 09:21:25 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-05 14:35:38 +0000 |
commit | aef0f00cbc976a29e5b66da4b2abbd2bcd9c0d52 (patch) | |
tree | c206025e4c62ece5d3f3e71510350932ba594102 /src/panfrost/bifrost | |
parent | 5d16a8109c88c869ce17e6b680e2922bb983caa6 (diff) |
pan/bi: Move bi_interp_mode_name to bi_print
Instead of open-coding it in the middle of the disassembler.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4061>
Diffstat (limited to 'src/panfrost/bifrost')
-rw-r--r-- | src/panfrost/bifrost/bi_print.c | 12 | ||||
-rw-r--r-- | src/panfrost/bifrost/bi_print.h | 1 | ||||
-rw-r--r-- | src/panfrost/bifrost/disassemble.c | 14 |
3 files changed, 14 insertions, 13 deletions
diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c index 020ef70c36b..ad82c3a2aed 100644 --- a/src/panfrost/bifrost/bi_print.c +++ b/src/panfrost/bifrost/bi_print.c @@ -79,6 +79,18 @@ bi_csel_cond_name(enum bifrost_csel_cond cond) } const char * +bi_interp_mode_name(enum bifrost_interp_mode mode) +{ + switch (mode) { + case BIFROST_INTERP_PER_FRAG: return ".per_frag"; + case BIFROST_INTERP_CENTROID: return ".centroid"; + case BIFROST_INTERP_DEFAULT: return ""; + case BIFROST_INTERP_EXPLICIT: return ".explicit"; + default: return ".unknown"; + } +} + +const char * bi_ldst_type_name(enum bifrost_ldst_type type) { switch (type) { diff --git a/src/panfrost/bifrost/bi_print.h b/src/panfrost/bifrost/bi_print.h index 8b90fa1e7da..fa12fb8031f 100644 --- a/src/panfrost/bifrost/bi_print.h +++ b/src/panfrost/bifrost/bi_print.h @@ -33,6 +33,7 @@ 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); const char * bi_csel_cond_name(enum bifrost_csel_cond cond); +const char * bi_interp_mode_name(enum bifrost_interp_mode mode); const char * bi_ldst_type_name(enum bifrost_ldst_type type); #endif diff --git a/src/panfrost/bifrost/disassemble.c b/src/panfrost/bifrost/disassemble.c index 6c1bebda1ec..367cc5b9626 100644 --- a/src/panfrost/bifrost/disassemble.c +++ b/src/panfrost/bifrost/disassemble.c @@ -1216,19 +1216,7 @@ static void dump_add(FILE *fp, uint64_t word, struct bifrost_regs regs, fprintf(fp, ".reuse"); if (ADD.op & 0x400) fprintf(fp, ".flat"); - switch ((ADD.op >> 7) & 0x3) { - case BIFROST_INTERP_PER_FRAG: - fprintf(fp, ".per_frag"); - break; - case BIFROST_INTERP_CENTROID: - fprintf(fp, ".centroid"); - break; - case BIFROST_INTERP_DEFAULT: - break; - case BIFROST_INTERP_EXPLICIT: - fprintf(fp, ".explicit"); - break; - } + fprintf(fp, "%s", bi_interp_mode_name((ADD.op >> 7) & 0x3)); fprintf(fp, ".v%d", ((ADD.op >> 5) & 0x3) + 1); } else if (info.src_type == ADD_BRANCH) { enum bifrost_branch_code branchCode = (enum bifrost_branch_code) ((ADD.op >> 6) & 0x3f); |