aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-04-28 12:39:47 -0400
committerMarge Bot <[email protected]>2020-04-28 17:17:48 +0000
commit81156ad55a10b2d1fddaf64ac707279c60eb3d54 (patch)
tree940c9d5ca657556d3ff017e6f158700ad334a02b /src
parent7a689470d0f5dc7733780b61ca0822fe629c131a (diff)
pan/bi: Pack fma.fcmp16
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4789>
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/bifrost/bi_pack.c20
-rw-r--r--src/panfrost/bifrost/bifrost.h3
2 files changed, 23 insertions, 0 deletions
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
@@ -1039,6 +1039,26 @@ bi_pack_fma_cmp(bi_instruction *ins, struct bi_registers *regs)
};
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;