Mesa (master): pan/mdg: Lower roundmodes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 3 16:06:16 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Mon May 25 14:11:04 2020 -0400

pan/mdg: Lower roundmodes

So now we can use the IR field semantically.

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

---

 src/panfrost/midgard/midgard_emit.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/midgard/midgard_emit.c b/src/panfrost/midgard/midgard_emit.c
index 34b06a2caf4..f1bfda5018b 100644
--- a/src/panfrost/midgard/midgard_emit.c
+++ b/src/panfrost/midgard/midgard_emit.c
@@ -477,6 +477,17 @@ mir_lower_inverts(midgard_instruction *ins)
         }
 }
 
+/* Opcodes with ROUNDS are the base (rte/0) type so we can just add */
+
+static void
+mir_lower_roundmode(midgard_instruction *ins)
+{
+        if (alu_opcode_props[ins->alu.op].props & MIDGARD_ROUNDS) {
+                assert(ins->roundmode <= 0x3);
+                ins->alu.op += ins->roundmode;
+        }
+}
+
 static void
 emit_alu_bundle(compiler_context *ctx,
                 midgard_bundle *bundle,
@@ -510,8 +521,10 @@ emit_alu_bundle(compiler_context *ctx,
                 /* In case we demote to a scalar */
                 midgard_scalar_alu scalarized;
 
-                if (!ins->compact_branch)
+                if (!ins->compact_branch) {
                         mir_lower_inverts(ins);
+                        mir_lower_roundmode(ins);
+                }
 
                 if (ins->unit & UNITS_ANY_VECTOR) {
                         mir_pack_mask_alu(ins);



More information about the mesa-commit mailing list