aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost/bi_pack.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-04-24 20:48:59 -0400
committerMarge Bot <[email protected]>2020-04-27 14:52:26 +0000
commitd31e4879f0b0034f817e60acdd05574ed610e56b (patch)
treec31aeecc401aef7795fbc7431af43b44526ad7bb /src/panfrost/bifrost/bi_pack.c
parent7b31f04bacfdb5420bc953ecdff0591058574f44 (diff)
pan/bi: Pack FMA SEL8
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4766>
Diffstat (limited to 'src/panfrost/bifrost/bi_pack.c')
-rw-r--r--src/panfrost/bifrost/bi_pack.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c
index 211c9e0fa1a..67912b6aaee 100644
--- a/src/panfrost/bifrost/bi_pack.c
+++ b/src/panfrost/bifrost/bi_pack.c
@@ -930,6 +930,27 @@ bi_pack_fma_select(bi_instruction *ins, struct bi_registers *regs)
unsigned swiz = (ins->swizzle[0][0] | (ins->swizzle[1][0] << 1));
unsigned op = BIFROST_FMA_SEL_16(swiz);
return bi_pack_fma_2src(ins, regs, op);
+ } else if (size == 8) {
+ unsigned swiz = 0;
+
+ for (unsigned c = 0; c < 4; ++c) {
+ if (ins->swizzle[c][0]) {
+ /* Ensure lowering restriction is met */
+ assert(ins->swizzle[c][0] == 2);
+ swiz |= (1 << c);
+ }
+ }
+
+ struct bifrost_fma_sel8 pack = {
+ .src0 = bi_get_src(ins, regs, 0, true),
+ .src1 = bi_get_src(ins, regs, 1, true),
+ .src2 = bi_get_src(ins, regs, 2, true),
+ .src3 = bi_get_src(ins, regs, 3, true),
+ .swizzle = swiz,
+ .op = BIFROST_FMA_OP_SEL8
+ };
+
+ RETURN_PACKED(pack);
} else {
unreachable("Unimplemented");
}