Mesa (staging/22.0): panfrost: Fix pack_32_2x16 implementation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 28 17:06:35 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 95f5d373508cb7961168b5bd10decf18a08a80c1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=95f5d373508cb7961168b5bd10decf18a08a80c1

Author: Icecream95 <ixn at disroot.org>
Date:   Wed Apr 27 10:31:14 2022 +1200

panfrost: Fix pack_32_2x16 implementation

Fixes: 6f0eff548c1 ("pan/bi: Implement packing ops between 32-bit vec1 and 16-bit vec2")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16181>
(cherry picked from commit 76cea8e27b3bb16cf752962ca53da42ab4bf51e4)

Conflicts:
	src/panfrost/bifrost/bifrost_compile.c

---

 .pick_status.json                      |  2 +-
 src/panfrost/bifrost/bifrost_compile.c | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index bbc7509a757..f4c922c038b 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -460,7 +460,7 @@
         "description": "panfrost: Fix pack_32_2x16 implementation",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "because_sha": "6f0eff548c16c12309edec812b6573c63fdc866d"
     },
     {
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 18611be7e0d..1887f9ef651 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -1858,7 +1858,6 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
          * are the exceptions that need to handle swizzles specially. */
 
         switch (instr->op) {
-        case nir_op_pack_32_2x16:
         case nir_op_vec2:
         case nir_op_vec3:
         case nir_op_vec4: {
@@ -1903,7 +1902,10 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
                 bi_mov_i32_to(b, bi_word(dst, 1), bi_word(bi_src_index(&instr->src[0].src), 1));
                 return;
 
-        case nir_op_mov: {
+        case nir_op_mov:
+        case nir_op_pack_32_2x16: {
+                unsigned src_comps = nir_src_num_components(instr->src[0].src);
+
                 bi_index idx = bi_src_index(&instr->src[0].src);
                 bi_index unoffset_srcs[4] = { idx, idx, idx, idx };
 
@@ -1914,8 +1916,8 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
                         comps > 3 ? instr->src[0].swizzle[3] : 0,
                 };
 
-                if (sz == 1) sz = 16;
-                bi_make_vec_to(b, dst, unoffset_srcs, channels, comps, sz);
+                if (src_sz == 1) src_sz = 16;
+                bi_make_vec_to(b, dst, unoffset_srcs, channels, src_comps, src_sz);
                 return;
         }
 



More information about the mesa-commit mailing list