pan/bi: Pack fma.fcmp16

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4789>
This commit is contained in:
Alyssa Rosenzweig 2020-04-28 12:39:47 -04:00 committed by Marge Bot
parent 7a689470d0
commit 81156ad55a
2 changed files with 23 additions and 0 deletions

View file

@ -1038,6 +1038,26 @@ bi_pack_fma_cmp(bi_instruction *ins, struct bi_registers *regs)
.op = BIFROST_FMA_OP_FCMP_GL
};
RETURN_PACKED(pack);
} else if (Tl == nir_type_float16 && Tr == nir_type_float16) {
bool flip = false;
bool l = bi_pack_fp16_abs(ins, regs, &flip);
enum bifrost_fcmp_cond cond = bi_fcmp_cond(ins->cond);
if (flip)
cond = bi_flip_fcmp(cond);
struct bifrost_fma_fcmp16 pack = {
.src0 = bi_get_src(ins, regs, flip ? 1 : 0, true),
.src1 = bi_get_src(ins, regs, flip ? 0 : 1, true),
.src0_swizzle = bi_swiz16(ins, flip ? 1 : 0),
.src1_swizzle = bi_swiz16(ins, flip ? 0 : 1),
.abs1 = l,
.unk = 0,
.cond = cond,
.op = BIFROST_FMA_OP_FCMP_GL_16,
};
RETURN_PACKED(pack);
} else {
unreachable("Unknown cmp type");

View file

@ -422,6 +422,9 @@ struct bifrost_add_fcmp {
unsigned op : 6;
} __attribute__((packed));
#define BIFROST_FMA_OP_FCMP_GL_16 (0xc8000 >> 13)
#define BIFROST_FMA_OP_FCMP_D3D_16 (0xcc000 >> 13)
struct bifrost_fma_fcmp16 {
unsigned src0 : 3;
unsigned src1 : 3;