pan/bi: Pack FMA IADD/ISUB 32

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
This commit is contained in:
Alyssa Rosenzweig 2020-05-04 14:28:47 -04:00 committed by Marge Bot
parent cf3c3563e0
commit a463b2c2ed
2 changed files with 18 additions and 2 deletions

View file

@ -1149,7 +1149,20 @@ bi_pack_fma_round(bi_instruction *ins, struct bi_registers *regs)
return bi_pack_fma_1src(ins, regs, op);
}
static unsigned
bi_pack_fma_imath(bi_instruction *ins, struct bi_registers *regs)
{
/* Scheduler: only ADD can have 8/16-bit imath */
assert(ins->dest_type == nir_type_int32 || ins->dest_type == nir_type_uint32);
unsigned op = ins->op.imath == BI_IMATH_ADD
? BIFROST_FMA_IADD_32
: BIFROST_FMA_ISUB_32;
return bi_pack_fma_2src(ins, regs, op);
}
static unsigned
bi_pack_fma(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
{
@ -1172,7 +1185,7 @@ bi_pack_fma(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
case BI_FREXP:
return bi_pack_fma_frexp(bundle.fma, regs);
case BI_IMATH:
unreachable("Packing todo");
return bi_pack_fma_imath(bundle.fma, regs);
case BI_MINMAX:
return bi_pack_fma_addmin(bundle.fma, regs);
case BI_MOV:

View file

@ -115,6 +115,9 @@ struct bifrost_fma_inst {
unsigned op : 20;
} __attribute__((packed));
#define BIFROST_FMA_IADD_32 (0x4ff98 >> 3)
#define BIFROST_FMA_ISUB_32 (0x4ffd8 >> 3)
struct bifrost_fma_2src {
unsigned src0 : 3;
unsigned src1 : 3;