pan/bi: Add fexp2_fast packing

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
This commit is contained in:
Alyssa Rosenzweig 2020-04-14 16:59:19 -04:00
parent c3eebfeb11
commit db5c1ae8fd
3 changed files with 8 additions and 1 deletions

View 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);

View 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;

View 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 },