aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-01 18:06:49 -0400
committerAlyssa Rosenzweig <[email protected]>2020-05-04 11:08:15 -0400
commit20cb039457d79dd88aebff7e92cb223ae20b83d0 (patch)
tree0ed4b70ff200f3e26569e7ee666babdf8421ee3b /src/panfrost/bifrost
parent5c03340fd1a12c42fce43ba4060f39706663d541 (diff)
pan/bi: Structify DISCARD
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Diffstat (limited to 'src/panfrost/bifrost')
-rw-r--r--src/panfrost/bifrost/bifrost.h20
-rw-r--r--src/panfrost/bifrost/disassemble.c2
2 files changed, 21 insertions, 1 deletions
diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h
index c4fd86b72bc..be0c8dfdab9 100644
--- a/src/panfrost/bifrost/bifrost.h
+++ b/src/panfrost/bifrost/bifrost.h
@@ -166,6 +166,26 @@ struct bifrost_add_inst {
unsigned op : 17;
} __attribute__((packed));
+#define BIFROST_ADD_OP_DISCARD (0x19100 >> 8)
+
+enum bifrost_discard_cond {
+ BIFROST_DISCARD_FEQ = 0,
+ BIFROST_DISCARD_FNE = 1,
+ BIFROST_DISCARD_FLE = 2,
+ BIFROST_DISCARD_FLT = 3,
+};
+
+struct bifrost_add_discard {
+ unsigned src0 : 3;
+ unsigned src1 : 3;
+ enum bifrost_discard_cond cond : 2;
+ /* Zero for fp32 */
+ unsigned src0_select : 1;
+ unsigned src1_select : 1;
+ unsigned fp32 : 1;
+ unsigned op : 9;
+} __attribute__((packed));
+
#define BIFROST_ADD_OP_LD_UBO_1 (0x0c1a0 >> 3)
#define BIFROST_ADD_OP_LD_UBO_2 (0x0c1e0 >> 3)
#define BIFROST_ADD_OP_LD_UBO_3 (0x0caa0 >> 3)
diff --git a/src/panfrost/bifrost/disassemble.c b/src/panfrost/bifrost/disassemble.c
index 38fcb8adc85..73d773758ce 100644
--- a/src/panfrost/bifrost/disassemble.c
+++ b/src/panfrost/bifrost/disassemble.c
@@ -1109,7 +1109,7 @@ static const struct add_op_info add_op_infos[] = {
{ 0x17dd0, "ADD.i32.u16.Y", ADD_TWO_SRC },
{ 0x18000, "LD_VAR_ADDR", ADD_VARYING_ADDRESS, false },
{ 0x19100, "DISCARD.FEQ.f16", ADD_TWO_SRC, false },
- { 0x19188, "DISCARD.FNE.f16", ADD_TWO_SRC, false },
+ { 0x19108, "DISCARD.FNE.f16", ADD_TWO_SRC, false },
{ 0x19110, "DISCARD.FLE.f16", ADD_TWO_SRC, false },
{ 0x19118, "DISCARD.FLT.f16", ADD_TWO_SRC, false },
{ 0x19180, "DISCARD.FEQ.f32", ADD_TWO_SRC, false },