From: Alyssa Rosenzweig Date: Tue, 28 Apr 2020 16:39:47 +0000 (-0400) Subject: pan/bi: Pack fma.fcmp16 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81156ad55a10b2d1fddaf64ac707279c60eb3d54;p=mesa.git pan/bi: Pack fma.fcmp16 Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index 8395b9821a7..28625ade980 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -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"); diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h index 66e337ca996..bef8cd84f00 100644 --- a/src/panfrost/bifrost/bifrost.h +++ b/src/panfrost/bifrost/bifrost.h @@ -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;