RETURN_PACKED(pack);
}
+static unsigned
+bi_pack_add_1src(bi_instruction *ins, struct bi_registers *regs, unsigned op)
+{
+ struct bifrost_add_inst pack = {
+ .src0 = bi_get_src(ins, regs, 0, true),
+ .op = op
+ };
+
+ RETURN_PACKED(pack);
+}
+
static enum bifrost_csel_cond
bi_cond_to_csel(enum bi_cond cond, bool *flip, bool *invert, nir_alu_type T)
{
RETURN_PACKED(pack);
}
+static unsigned
+bi_pack_add_special(bi_instruction *ins, struct bi_registers *regs)
+{
+ unsigned op = 0;
+
+ if (ins->op.special == BI_SPECIAL_FRCP) {
+ op = BIFROST_ADD_OP_FRCP_FAST_F32;
+ } else {
+ op = BIFROST_ADD_OP_FRSQ_FAST_F32;
+ }
+
+ return bi_pack_add_1src(ins, regs, op);
+}
+
static unsigned
bi_pack_add(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
{
case BI_STORE_VAR:
return bi_pack_add_st_vary(clause, bundle.add, regs);
case BI_SPECIAL:
+ return bi_pack_add_special(bundle.add, regs);
case BI_SWIZZLE:
case BI_TEX:
case BI_ROUND:
} __attribute__((packed));
#define BIFROST_ADD_OP_BLEND (0x1952c)
+#define BIFROST_ADD_OP_FRCP_FAST_F32 (0x0cc00)
+#define BIFROST_ADD_OP_FRSQ_FAST_F32 (0x0cc20)
struct bifrost_add_inst {
unsigned src0 : 3;