mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 17:40:11 +01:00
pan/bi: Add fp16 support for frcp/frsq
More ops. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4470>
This commit is contained in:
parent
d7bb7b79a8
commit
c37c799284
2 changed files with 15 additions and 2 deletions
|
|
@ -989,11 +989,20 @@ static unsigned
|
||||||
bi_pack_add_special(bi_instruction *ins, struct bi_registers *regs)
|
bi_pack_add_special(bi_instruction *ins, struct bi_registers *regs)
|
||||||
{
|
{
|
||||||
unsigned op = 0;
|
unsigned op = 0;
|
||||||
|
bool fp16 = ins->dest_type == nir_type_float16;
|
||||||
|
bool Y = ins->swizzle[0][0];
|
||||||
|
|
||||||
if (ins->op.special == BI_SPECIAL_FRCP) {
|
if (ins->op.special == BI_SPECIAL_FRCP) {
|
||||||
op = BIFROST_ADD_OP_FRCP_FAST_F32;
|
op = fp16 ?
|
||||||
|
(Y ? BIFROST_ADD_OP_FRCP_FAST_F16_Y :
|
||||||
|
BIFROST_ADD_OP_FRCP_FAST_F16_X) :
|
||||||
|
BIFROST_ADD_OP_FRCP_FAST_F32;
|
||||||
} else {
|
} else {
|
||||||
op = BIFROST_ADD_OP_FRSQ_FAST_F32;
|
op = fp16 ?
|
||||||
|
(Y ? BIFROST_ADD_OP_FRSQ_FAST_F16_Y :
|
||||||
|
BIFROST_ADD_OP_FRSQ_FAST_F16_X) :
|
||||||
|
BIFROST_ADD_OP_FRSQ_FAST_F32;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return bi_pack_add_1src(ins, regs, op);
|
return bi_pack_add_1src(ins, regs, op);
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,11 @@ struct bifrost_fma_2src {
|
||||||
|
|
||||||
#define BIFROST_ADD_OP_BLEND (0x1952c)
|
#define BIFROST_ADD_OP_BLEND (0x1952c)
|
||||||
#define BIFROST_ADD_OP_FRCP_FAST_F32 (0x0cc00)
|
#define BIFROST_ADD_OP_FRCP_FAST_F32 (0x0cc00)
|
||||||
|
#define BIFROST_ADD_OP_FRCP_FAST_F16_X (0x0ce10)
|
||||||
|
#define BIFROST_ADD_OP_FRCP_FAST_F16_Y (0x0ce30)
|
||||||
#define BIFROST_ADD_OP_FRSQ_FAST_F32 (0x0cc20)
|
#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)
|
||||||
|
|
||||||
struct bifrost_add_inst {
|
struct bifrost_add_inst {
|
||||||
unsigned src0 : 3;
|
unsigned src0 : 3;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue