Mesa (master): pan/bi: Add discard ops

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 3 00:21:55 UTC 2020


Module: Mesa
Branch: master
Commit: 178d9d42696876fe244543a2c897e4c702a51cbd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=178d9d42696876fe244543a2c897e4c702a51cbd

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Fri Feb 28 07:05:31 2020 -0500

pan/bi: Add discard ops

These run on the ADD unit and evidently need to be their own clause
(probably treated as a high-latency instruction). Like csel, they can
either do a float comparison directly or ingest a 0/1 value.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4025>

---

 src/panfrost/bifrost/disassemble.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/panfrost/bifrost/disassemble.c b/src/panfrost/bifrost/disassemble.c
index 3e3f6a9bc6c..463eafa48a2 100644
--- a/src/panfrost/bifrost/disassemble.c
+++ b/src/panfrost/bifrost/disassemble.c
@@ -1318,6 +1318,13 @@ static const struct add_op_info add_op_infos[] = {
         { 0x18100, "LD_VAR_ADDR.f32", ADD_VARYING_ADDRESS, true },
         { 0x18200, "LD_VAR_ADDR.i32", ADD_VARYING_ADDRESS, true },
         { 0x18300, "LD_VAR_ADDR.u32", ADD_VARYING_ADDRESS, true },
+        // Conditional discards (discard_if) in NIR. Compares the first two
+        // sources and discards if the result is true
+        { 0x19181, "DISCARD.FEQ.f32", ADD_TWO_SRC, true },
+        { 0x19189, "DISCARD.FNE.f32", ADD_TWO_SRC, true },
+        { 0x1918C, "DISCARD.GL.f32", ADD_TWO_SRC, true }, /* Consumes ICMP.GL/etc with fixed 0 argument */
+        { 0x19190, "DISCARD.FLE.f32", ADD_TWO_SRC, true },
+        { 0x19198, "DISCARD.FLT.f32", ADD_TWO_SRC, true },
         // Implements alpha-to-coverage, as well as possibly the late depth and
         // stencil tests. The first source is the existing sample mask in R60
         // (possibly modified by gl_SampleMask), and the second source is the alpha



More information about the mesa-commit mailing list