summaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost/compiler.h
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-03 07:58:05 -0500
committerMarge Bot <[email protected]>2020-03-05 14:35:38 +0000
commit44ebc275fe83c007cb7c881cd5016dc1f6ec368b (patch)
tree6851bd58852b523adb2d61ed6b0769f88805b48c /src/panfrost/bifrost/compiler.h
parentb5bdd894443507964cad63b40c0c598d115c7333 (diff)
pan/bi: Add class-specific ops
For disambiguating things like min and max within the MINMAX class. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4061>
Diffstat (limited to 'src/panfrost/bifrost/compiler.h')
-rw-r--r--src/panfrost/bifrost/compiler.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index 299cff5b017..d4ac239347a 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -118,6 +118,23 @@ struct bi_load_vary {
bool flat;
};
+/* Opcodes within a class */
+enum bi_minmax_op {
+ BI_MINMAX_MIN,
+ BI_MINMAX_MAX
+};
+
+enum bi_bitwise_op {
+ BI_BITWISE_AND,
+ BI_BITWISE_OR,
+ BI_BITWISE_XOR
+};
+
+enum bi_round_op {
+ BI_ROUND_MODE, /* use round mode */
+ BI_ROUND_ROUND /* i.e.: fround() */
+};
+
typedef struct {
struct list_head link; /* Must be first */
enum bi_class type;
@@ -150,6 +167,15 @@ typedef struct {
* int). Zero if there is no destination. Bitsize included */
nir_alu_type dest_type;
+ /* A class-specific op from which the actual opcode can be derived
+ * (along with the above information) */
+
+ union {
+ enum bi_minmax_op minmax;
+ enum bi_bitwise_op bitwise;
+ enum bi_round_op round;
+ } op;
+
/* Union for class-specific information */
union {
enum bifrost_minmax_mode minmax;