Mesa (master): pan/midgard: Add mir_set_bytemask helper

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 25 13:55:11 UTC 2019


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Wed Oct 23 20:19:11 2019 -0400

pan/midgard: Add mir_set_bytemask helper

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>

---

 src/panfrost/midgard/compiler.h | 1 +
 src/panfrost/midgard/mir.c      | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index 425a4dd85f1..e66424d0fd8 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -518,6 +518,7 @@ midgard_reg_mode mir_typesize(midgard_instruction *ins);
 uint16_t mir_from_bytemask(uint16_t bytemask, midgard_reg_mode mode);
 uint16_t mir_bytemask(midgard_instruction *ins);
 uint16_t mir_round_bytemask_down(uint16_t mask, midgard_reg_mode mode);
+void mir_set_bytemask(midgard_instruction *ins, uint16_t bytemask);
 
 /* MIR printing */
 
diff --git a/src/panfrost/midgard/mir.c b/src/panfrost/midgard/mir.c
index 76c99a2e05c..db26acd8cb1 100644
--- a/src/panfrost/midgard/mir.c
+++ b/src/panfrost/midgard/mir.c
@@ -525,6 +525,12 @@ mir_bytemask(midgard_instruction *ins)
         return mir_to_bytemask(mir_typesize(ins), ins->mask);
 }
 
+void
+mir_set_bytemask(midgard_instruction *ins, uint16_t bytemask)
+{
+        ins->mask = mir_from_bytemask(bytemask, mir_typesize(ins));
+}
+
 /* Creates a mask of the components of a node read by an instruction, by
  * analyzing the swizzle with respect to the instruction's mask. E.g.:
  *




More information about the mesa-commit mailing list