pan/bi: Add fexp2_fast packing
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 14 Apr 2020 20:59:19 +0000 (16:59 -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
src/panfrost/bifrost/disassemble.c

index e530862a7cc70afc120886ca23af7060c1d93681..09fefd810adbf9957cde72dc001aa4129c99e444 100644 (file)
@@ -1140,12 +1140,17 @@ bi_pack_add_special(bi_instruction *ins, struct bi_registers *regs)
                         (Y ? BIFROST_ADD_OP_FRCP_FAST_F16_Y :
                         BIFROST_ADD_OP_FRCP_FAST_F16_X) :
                         BIFROST_ADD_OP_FRCP_FAST_F32;
-        } else {
+        } else if (ins->op.special == BI_SPECIAL_FRSQ) {
                 op = fp16 ?
                         (Y ? BIFROST_ADD_OP_FRSQ_FAST_F16_Y :
                         BIFROST_ADD_OP_FRSQ_FAST_F16_X) :
                         BIFROST_ADD_OP_FRSQ_FAST_F32;
 
+        } else if (ins->op.special == BI_SPECIAL_EXP2_LOW) {
+                assert(!fp16);
+                op = BIFROST_ADD_OP_FEXP2_FAST;
+        } else {
+                unreachable("Unknown special op");
         }
 
         return bi_pack_add_1src(ins, regs, op);
index e3f822c321eda0e9a539ac750b91af06d35a8da2..1c47dab9fc47f105189cdadcc46c93274efe39d2 100644 (file)
@@ -138,6 +138,7 @@ struct bifrost_fma_mscale {
 #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)
+#define BIFROST_ADD_OP_FEXP2_FAST (0x0cd58)
 
 struct bifrost_add_inst {
         unsigned src0 : 3;
index 3babcf621de02e910b90b053033a4a39f1d66d54..9ff4ab77f7a1717020f5f031c51d8056c04efc9c 100644 (file)
@@ -1041,6 +1041,7 @@ static const struct add_op_info add_op_infos[] = {
         { 0x0cc00, "FRCP_FAST.f32", ADD_ONE_SRC },
         { 0x0cc20, "FRSQ_FAST.f32", ADD_ONE_SRC },
         { 0x0cc68, "FLOG2_U.f32", ADD_ONE_SRC },
+        { 0x0cd58, "FEXP2_FAST.f32", ADD_ONE_SRC },
         { 0x0ce00, "FRCP_TABLE", ADD_ONE_SRC },
         { 0x0ce10, "FRCP_FAST.f16.X", ADD_ONE_SRC },
         { 0x0ce20, "FRSQ_TABLE", ADD_ONE_SRC },