From: Alyssa Rosenzweig Date: Tue, 14 Apr 2020 19:25:04 +0000 (-0400) Subject: pan/bi: Add log2_help packing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d3643cdd81bf2f1ad6ddf10d80e38d0ddaf9f908;p=mesa.git pan/bi: Add log2_help packing Signed-off-by: Alyssa Rosenzweig Part-of: --- 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 @@ -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: 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;