From f85746af3587bfaa9f9be0a12792e73f63d10258 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 21 Apr 2020 12:26:42 -0400 Subject: [PATCH] pan/bi: Add normal/compact/dual switch to IR For tex. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_print.c | 13 +++++++++++++ src/panfrost/bifrost/bi_print.h | 1 + src/panfrost/bifrost/compiler.h | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c index 5f718e95a37..202cbc0fb0e 100644 --- a/src/panfrost/bifrost/bi_print.c +++ b/src/panfrost/bifrost/bi_print.c @@ -304,6 +304,17 @@ bi_frexp_op_name(enum bi_frexp_op op) } } +const char * +bi_tex_op_name(enum bi_tex_op op) +{ + switch (op) { + case BI_TEX_NORMAL: return "normal"; + case BI_TEX_COMPACT: return "compact"; + case BI_TEX_DUAL: return "dual"; + default: return "invalid"; + } +} + static void bi_print_load_vary(struct bi_load_vary *load, FILE *fp) { @@ -395,6 +406,8 @@ bi_print_instruction(bi_instruction *ins, FILE *fp) fprintf(fp, ".loc%u", ins->blend_location); else if (ins->type == BI_STORE || ins->type == BI_STORE_VAR) fprintf(fp, ".v%u", ins->store_channels); + else if (ins->type == BI_TEX) + fprintf(fp, ".%s", bi_tex_op_name(ins->op.texture)); if (ins->dest) bi_print_alu_type(ins->dest_type, fp); diff --git a/src/panfrost/bifrost/bi_print.h b/src/panfrost/bifrost/bi_print.h index 76350449547..dfc916a593c 100644 --- a/src/panfrost/bifrost/bi_print.h +++ b/src/panfrost/bifrost/bi_print.h @@ -44,6 +44,7 @@ const char * bi_special_op_name(enum bi_special_op op); const char * bi_table_op_name(enum bi_table_op op); const char * bi_reduce_op_name(enum bi_reduce_op op); const char * bi_frexp_op_name(enum bi_frexp_op op); +const char * bi_tex_op_name(enum bi_tex_op op); void bi_print_instruction(bi_instruction *ins, FILE *fp); void bi_print_bundle(bi_bundle *bundle, FILE *fp); diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 96be391ca35..1cbb211b778 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -214,6 +214,12 @@ enum bi_special_op { BI_SPECIAL_EXP2_LOW, }; +enum bi_tex_op { + BI_TEX_NORMAL, + BI_TEX_COMPACT, + BI_TEX_DUAL +}; + typedef struct { struct list_head link; /* Must be first */ enum bi_class type; @@ -275,6 +281,7 @@ typedef struct { enum bi_table_op table; enum bi_frexp_op frexp; enum bi_cond compare; + enum bi_tex_op texture; /* For FMA/ADD, should we add a biased exponent? */ bool mscale; -- 2.30.2