Mesa (master): pan/bi: Pack TEX compact instructions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 22 01:16:17 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Tue Apr 21 16:08:19 2020 -0400

pan/bi: Pack TEX compact instructions

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

---

 src/panfrost/bifrost/bi_pack.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c
index d238f81b66f..0d2b9fb2e03 100644
--- a/src/panfrost/bifrost/bi_pack.c
+++ b/src/panfrost/bifrost/bi_pack.c
@@ -1215,6 +1215,24 @@ bi_pack_add_table(bi_instruction *ins, struct bi_registers *regs)
         op = BIFROST_ADD_OP_LOG2_HELP;
         return bi_pack_add_1src(ins, regs, op);
 }
+static unsigned
+bi_pack_add_tex_compact(bi_clause *clause, bi_instruction *ins, struct bi_registers *regs)
+{
+        bool f16 = ins->dest_type == nir_type_float16;
+
+        struct bifrost_tex_compact pack = {
+                .src0 = bi_get_src(ins, regs, 0, false),
+                .src1 = bi_get_src(ins, regs, 1, false),
+                .op = f16 ? BIFROST_ADD_OP_TEX_COMPACT_F16 :
+                        BIFROST_ADD_OP_TEX_COMPACT_F32,
+                .unknown = 1,
+                .tex_index = 0,
+                .sampler_index = 0
+        };
+
+        bi_write_data_register(clause, ins);
+        RETURN_PACKED(pack);
+}
 
 static unsigned
 bi_pack_add(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
@@ -1262,7 +1280,12 @@ 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_SWIZZLE:
+                return BIFROST_ADD_NOP;
         case BI_TEX:
+                if (bundle.add->op.texture == BI_TEX_COMPACT)
+                        return bi_pack_add_tex_compact(clause, bundle.add, regs);
+                else
+                        unreachable("Unknown tex type");
         case BI_ROUND:
                 return BIFROST_ADD_NOP;
         default:



More information about the mesa-commit mailing list