aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-04-14 15:25:04 -0400
committerAlyssa Rosenzweig <[email protected]>2020-04-17 16:25:35 -0400
commitd3643cdd81bf2f1ad6ddf10d80e38d0ddaf9f908 (patch)
treee97fdd930e7d71650de336d2e8d2c963dbdf4f3c /src/panfrost/bifrost
parent6039d51e32fe98c4e785b7a9039bfc066720c91a (diff)
pan/bi: Add log2_help 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.c11
-rw-r--r--src/panfrost/bifrost/bifrost.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c
index db753f16671..1b968942cd1 100644
--- a/src/panfrost/bifrost/bi_pack.c
+++ b/src/panfrost/bifrost/bi_pack.c
@@ -1130,6 +1130,16 @@ bi_pack_add_special(bi_instruction *ins, struct bi_registers *regs)
}
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)
{
if (!bundle.add)
@@ -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:
diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h
index 3b08eac6df6..7cdc39b7771 100644
--- a/src/panfrost/bifrost/bifrost.h
+++ b/src/panfrost/bifrost/bifrost.h
@@ -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;