return bi_pack_fma_1src(ins, regs, op);
}
+static unsigned
+bi_pack_fma_reduce(bi_instruction *ins, struct bi_registers *regs)
+{
+ if (ins->op.reduce == BI_REDUCE_ADD_FREXPM) {
+ return bi_pack_fma_2src(ins, regs, BIFROST_FMA_OP_ADD_FREXPM);
+ } else {
+ unreachable("Invalid reduce op");
+ }
+}
+
/* We have a single convert opcode in the IR but a number of opcodes that could
* come out. In particular we have native opcodes for:
*
case BI_SWIZZLE:
case BI_ROUND:
return BIFROST_FMA_NOP;
+ case BI_REDUCE_FMA:
+ return bi_pack_fma_reduce(bundle.fma, regs);
default:
unreachable("Cannot encode class as FMA");
}
#define BIFROST_FMA_EXT (0xe0000)
#define BIFROST_FMA_OP_MOV BIFROST_FMA_EXT | (0x32d)
#define BIFROST_FMA_OP_FREXPE_LOG BIFROST_FMA_EXT | 0x3c5
+#define BIFROST_FMA_OP_ADD_FREXPM ((BIFROST_FMA_EXT | 0x1e80) >> 3)
struct bifrost_fma_inst {
unsigned src0 : 3;