diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-05-01 18:13:54 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2020-05-04 11:08:15 -0400 |
commit | 6627b20de3511da153f2733a649b22c13d9e570a (patch) | |
tree | 24d937f0a9960946d074edf70409eda41635671f /src/panfrost/bifrost/compiler.h | |
parent | 6e5d2072939617bd6e0abe8b36cfadca83bed6f6 (diff) |
pan/bi: Unwrap BRANCH into CONDITIONAL class
We can simplify the IR considerably and unify more conditions, which
gives conditional discard for free.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Diffstat (limited to 'src/panfrost/bifrost/compiler.h')
-rw-r--r-- | src/panfrost/bifrost/compiler.h | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index e438a58845e..16f44ff0103 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -86,7 +86,8 @@ extern unsigned bi_class_props[BI_NUM_CLASSES]; /* abs/neg/outmod valid for a float op */ #define BI_MODS (1 << 0) -/* bit 1 unused */ +/* Accepts a bi_cond */ +#define BI_CONDITIONAL (1 << 1) /* Accepts a bifrost_roundmode */ #define BI_ROUNDMODE (1 << 2) @@ -154,15 +155,6 @@ enum bi_cond { BI_COND_NE, }; -struct bi_branch { - /* Types are specified in src_types and must be compatible (either both - * int, or both float, 16/32, and same size or 32/16 if float. Types - * ignored if BI_COND_ALWAYS is set for an unconditional branch. */ - - enum bi_cond cond; - struct bi_block *target; -}; - /* Opcodes within a class */ enum bi_minmax_op { BI_MINMAX_MIN, @@ -270,6 +262,9 @@ typedef struct { /* For VECTOR ops, how many channels are written? */ unsigned vector_channels; + /* The comparison op. BI_COND_ALWAYS may not be valid. */ + enum bi_cond cond; + /* A class-specific op from which the actual opcode can be derived * (along with the above information) */ @@ -290,11 +285,7 @@ typedef struct { union { enum bifrost_minmax_mode minmax; struct bi_load_vary load_vary; - struct bi_branch branch; - - /* For CSEL, the comparison op. BI_COND_ALWAYS doesn't make - * sense here but you can always just use a move for that */ - enum bi_cond cond; + struct bi_block *branch_target; /* For BLEND -- the location 0-7 */ unsigned blend_location; |