aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-04-14 16:59:19 -0400
committerAlyssa Rosenzweig <[email protected]>2020-04-17 16:25:35 -0400
commitdb5c1ae8fd17f3113a88029ea90d23f10df293ed (patch)
treee4ad4f146a645b2225cedbc294bb1adb1db8eb87 /src/panfrost/bifrost
parentc3eebfeb11cd57998134c0bb903c2447296f43c7 (diff)
pan/bi: Add fexp2_fast packing
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
Diffstat (limited to 'src/panfrost/bifrost')
-rw-r--r--src/panfrost/bifrost/bi_pack.c7
-rw-r--r--src/panfrost/bifrost/bifrost.h1
-rw-r--r--src/panfrost/bifrost/disassemble.c1
3 files changed, 8 insertions, 1 deletions
diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c
index e530862a7cc..09fefd810ad 100644
--- a/src/panfrost/bifrost/bi_pack.c
+++ b/src/panfrost/bifrost/bi_pack.c
@@ -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);
diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h
index e3f822c321e..1c47dab9fc4 100644
--- a/src/panfrost/bifrost/bifrost.h
+++ b/src/panfrost/bifrost/bifrost.h
@@ -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;
diff --git a/src/panfrost/bifrost/disassemble.c b/src/panfrost/bifrost/disassemble.c
index 3babcf621de..9ff4ab77f7a 100644
--- a/src/panfrost/bifrost/disassemble.c
+++ b/src/panfrost/bifrost/disassemble.c
@@ -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 },