Commit d31e4879 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig Committed by Marge Bot
Browse files

pan/bi: Pack FMA SEL8



Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <mesa/mesa!4766>
parent 7b31f04b
......@@ -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");
}
......
......@@ -112,6 +112,17 @@ struct bifrost_fma_2src {
unsigned op : 17;
} __attribute__((packed));
#define BIFROST_FMA_OP_SEL8 (0x71)
struct bifrost_fma_sel8 {
unsigned src0 : 3;
unsigned src1 : 3;
unsigned src2 : 3;
unsigned src3 : 3;
unsigned swizzle : 4;
unsigned op : 7;
} __attribute__((packed));
#define BIFROST_FMA_OP_MSCALE (0x50 >> 3)
struct bifrost_fma_mscale {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment