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

Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri Apr 24 20:52:17 2020 -0400

pan/bi: Pack ADD SEL16

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766>

---

 src/panfrost/bifrost/bi_pack.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c
index 67912b6aaee..ee85fad6fe2 100644
--- a/src/panfrost/bifrost/bi_pack.c
+++ b/src/panfrost/bifrost/bi_pack.c
@@ -1276,6 +1276,17 @@ bi_pack_add_tex_compact(bi_clause *clause, 
bi_instruction *ins, struct bi_regist
         RETURN_PACKED(pack);
 }
 
+static unsigned
+bi_pack_add_select(bi_instruction *ins, struct bi_registers *regs)
+{
+        unsigned size = nir_alu_type_get_type_size(ins->dest_type);
+        assert(size == 16);
+
+        unsigned swiz = (ins->swizzle[0][0] | (ins->swizzle[1][0] << 1));
+        unsigned op = BIFROST_ADD_SEL_16(swiz);
+        return bi_pack_add_2src(ins, regs, op);
+}
+
 static unsigned
 bi_pack_add(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
 {
@@ -1322,7 +1333,7 @@ bi_pack_add(bi_clause *clause, bi_bundle bundle, struct 
bi_registers *regs)
         case BI_TABLE:
                 return bi_pack_add_table(bundle.add, regs);
         case BI_SELECT:
-                return BIFROST_ADD_NOP;
+                return bi_pack_add_select(bundle.add, regs);
         case BI_TEX:
                 if (bundle.add->op.texture == BI_TEX_COMPACT)
                         return bi_pack_add_tex_compact(clause, bundle.add, 
regs);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to