summaryrefslogtreecommitdiffstats
path: root/src/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-04-14 13:14:29 -0400
committerAlyssa Rosenzweig <[email protected]>2020-04-17 16:25:35 -0400
commit6039d51e32fe98c4e785b7a9039bfc066720c91a (patch)
tree713ef3d8f977eaf957c633f3621fa98bcc59d023 /src/panfrost
parentffa9f6a7896cd1cfdfe0e8e880ab870f3da6033f (diff)
pan/bi: Pack ADD_FREXPM
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
Diffstat (limited to 'src/panfrost')
-rw-r--r--src/panfrost/bifrost/bi_pack.c12
-rw-r--r--src/panfrost/bifrost/bifrost.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c
index 043c8d57b93..db753f16671 100644
--- a/src/panfrost/bifrost/bi_pack.c
+++ b/src/panfrost/bifrost/bi_pack.c
@@ -747,6 +747,16 @@ bi_pack_fma_frexp(bi_instruction *ins, struct bi_registers *regs)
return bi_pack_fma_1src(ins, regs, op);
}
+static unsigned
+bi_pack_fma_reduce(bi_instruction *ins, struct bi_registers *regs)
+{
+ if (ins->op.reduce == BI_REDUCE_ADD_FREXPM) {
+ return bi_pack_fma_2src(ins, regs, BIFROST_FMA_OP_ADD_FREXPM);
+ } else {
+ unreachable("Invalid reduce op");
+ }
+}
+
/* We have a single convert opcode in the IR but a number of opcodes that could
* come out. In particular we have native opcodes for:
*
@@ -887,6 +897,8 @@ bi_pack_fma(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
case BI_SWIZZLE:
case BI_ROUND:
return BIFROST_FMA_NOP;
+ case BI_REDUCE_FMA:
+ return bi_pack_fma_reduce(bundle.fma, regs);
default:
unreachable("Cannot encode class as FMA");
}
diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h
index 91755375c3b..3b08eac6df6 100644
--- a/src/panfrost/bifrost/bifrost.h
+++ b/src/panfrost/bifrost/bifrost.h
@@ -98,6 +98,7 @@ enum bifrost_packed_src {
#define BIFROST_FMA_EXT (0xe0000)
#define BIFROST_FMA_OP_MOV BIFROST_FMA_EXT | (0x32d)
#define BIFROST_FMA_OP_FREXPE_LOG BIFROST_FMA_EXT | 0x3c5
+#define BIFROST_FMA_OP_ADD_FREXPM ((BIFROST_FMA_EXT | 0x1e80) >> 3)
struct bifrost_fma_inst {
unsigned src0 : 3;