Used in log2. Needs a new class as well due to scheduling silliness.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
}
}
+const char *
+bi_reduce_op_name(enum bi_reduce_op op)
+{
+ switch (op) {
+ case BI_REDUCE_ADD_FREXPM: return "add_frexpm";
+ default: return "invalid";
+ }
+}
+
static void
bi_print_load_vary(struct bi_load_vary *load, FILE *fp)
{
fprintf(fp, "%s", bi_special_op_name(ins->op.special));
else if (ins->type == BI_TABLE)
fprintf(fp, "%s", bi_table_op_name(ins->op.table));
+ else if (ins->type == BI_REDUCE_FMA)
+ fprintf(fp, "%s", bi_reduce_op_name(ins->op.reduce));
else if (ins->type == BI_CMP)
fprintf(fp, "%s", bi_cond_name(ins->op.compare));
else
const char * bi_cond_name(enum bi_cond cond);
const char * bi_special_op_name(enum bi_special_op op);
const char * bi_table_op_name(enum bi_table_op op);
+const char * bi_reduce_op_name(enum bi_reduce_op op);
void bi_print_instruction(bi_instruction *ins, FILE *fp);
void bi_print_bundle(bi_bundle *bundle, FILE *fp);
[BI_MINMAX] = BI_GENERIC | BI_SCHED_ADD | BI_NO_ABS_ABS_FP16_FMA | BI_MODS, /* | FMA on some? */
[BI_MOV] = BI_SCHED_ALL,
[BI_FMOV] = BI_MODS | BI_SCHED_ALL,
+ [BI_REDUCE_FMA] = BI_SCHED_FMA,
[BI_SHIFT] = BI_SCHED_ALL,
[BI_STORE] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD | BI_VECTOR | BI_DATA_REG_SRC,
[BI_STORE_VAR] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD | BI_VECTOR | BI_DATA_REG_SRC,
BI_LOAD_VAR_ADDRESS,
BI_MINMAX,
BI_MOV,
+ BI_REDUCE_FMA,
BI_SHIFT,
BI_STORE,
BI_STORE_VAR,
BI_TABLE_LOG2_U_OVER_U_1_LOW,
};
+enum bi_reduce_op {
+ /* Takes two fp32 arguments and returns x + frexp(y). Used in
+ * low-precision log2 argument reduction on newer models. */
+
+ BI_REDUCE_ADD_FREXPM,
+};
+
enum bi_special_op {
BI_SPECIAL_FRCP,
BI_SPECIAL_FRSQ,
enum bi_bitwise_op bitwise;
enum bi_round_op round;
enum bi_special_op special;
+ enum bi_reduce_op reduce;
enum bi_table_op table;
enum bi_cond compare;
} op;
{ true, 0x01e08, "SEL.YX.i16", FMA_TWO_SRC },
{ true, 0x01e10, "SEL.XY.i16", FMA_TWO_SRC },
{ true, 0x01e18, "SEL.YY.i16", FMA_TWO_SRC },
+ { true, 0x01e80, "ADD_FREXPM.f32", FMA_TWO_SRC },
{ true, 0x00800, "IMAD", FMA_THREE_SRC },
{ true, 0x078db, "POPCNT", FMA_ONE_SRC },
};