pan/bi: Add log2_help packing
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 14 Apr 2020 19:25:04 +0000 (15:25 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 17 Apr 2020 20:25:35 +0000 (16:25 -0400)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>

src/panfrost/bifrost/bi_pack.c
src/panfrost/bifrost/bifrost.h

index db753f16671dc2198d468e886c13e7c383b1ffdd..1b968942cd1a262a5319729831b7c58e2649bf38 100644 (file)
@@ -1129,6 +1129,16 @@ bi_pack_add_special(bi_instruction *ins, struct bi_registers *regs)
         return bi_pack_add_1src(ins, regs, op);
 }
 
+static unsigned
+bi_pack_add_table(bi_instruction *ins, struct bi_registers *regs)
+{
+        unsigned op = 0;
+        assert(ins->dest_type == nir_type_float32);
+
+        op = BIFROST_ADD_OP_LOG2_HELP;
+        return bi_pack_add_1src(ins, regs, op);
+}
+
 static unsigned
 bi_pack_add(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
 {
@@ -1173,6 +1183,7 @@ bi_pack_add(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
         case BI_SPECIAL:
                 return bi_pack_add_special(bundle.add, regs);
         case BI_TABLE:
+                return bi_pack_add_table(bundle.add, regs);
         case BI_SWIZZLE:
         case BI_TEX:
         case BI_ROUND:
index 3b08eac6df65c020bdf1ee4301835f5ab7e407f7..7cdc39b77714af296b44c931a4ede0c21cfbed50 100644 (file)
@@ -118,6 +118,7 @@ struct bifrost_fma_2src {
 #define BIFROST_ADD_OP_FRSQ_FAST_F32 (0x0cc20)
 #define BIFROST_ADD_OP_FRSQ_FAST_F16_X (0x0ce50)
 #define BIFROST_ADD_OP_FRSQ_FAST_F16_Y (0x0ce70)
+#define BIFROST_ADD_OP_LOG2_HELP  (0x0cc68)
 
 struct bifrost_add_inst {
         unsigned src0 : 3;