pan/bi: Add BI_TABLE for fast table accesses
Used to implement SPECIAL ops. Separate class since they are faster which means you can pair them with actual work on FMA. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
This commit is contained in:
@@ -1140,6 +1140,7 @@ bi_pack_add(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
|
||||
return bi_pack_add_st_vary(clause, bundle.add, regs);
|
||||
case BI_SPECIAL:
|
||||
return bi_pack_add_special(bundle.add, regs);
|
||||
case BI_TABLE:
|
||||
case BI_SWIZZLE:
|
||||
case BI_TEX:
|
||||
case BI_ROUND:
|
||||
|
@@ -152,6 +152,7 @@ bi_class_name(enum bi_class cl)
|
||||
case BI_STORE_VAR: return "store_var";
|
||||
case BI_SPECIAL: return "special";
|
||||
case BI_SWIZZLE: return "swizzle";
|
||||
case BI_TABLE: return "table";
|
||||
case BI_TEX: return "tex";
|
||||
case BI_ROUND: return "round";
|
||||
default: return "unknown_class";
|
||||
@@ -251,6 +252,15 @@ bi_bitwise_op_name(enum bi_bitwise_op op)
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
bi_table_op_name(enum bi_table_op op)
|
||||
{
|
||||
switch (op) {
|
||||
case BI_TABLE_LOG2_U_OVER_U_1_LOW: return "log2.help";
|
||||
default: return "invalid";
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
bi_special_op_name(enum bi_special_op op)
|
||||
{
|
||||
@@ -326,6 +336,8 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
|
||||
fprintf(fp, ins->op.round == BI_ROUND_MODE ? "roundMode": "round");
|
||||
else if (ins->type == BI_SPECIAL)
|
||||
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_CMP)
|
||||
fprintf(fp, "%s", bi_cond_name(ins->op.compare));
|
||||
else
|
||||
|
@@ -41,6 +41,7 @@ const char * bi_ldst_type_name(enum bifrost_ldst_type type);
|
||||
const char * bi_class_name(enum bi_class cl);
|
||||
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);
|
||||
|
||||
void bi_print_instruction(bi_instruction *ins, FILE *fp);
|
||||
void bi_print_bundle(bi_bundle *bundle, FILE *fp);
|
||||
|
@@ -52,6 +52,7 @@ unsigned bi_class_props[BI_NUM_CLASSES] = {
|
||||
[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_SPECIAL] = BI_SCHED_ADD | BI_SCHED_SLOW,
|
||||
[BI_TABLE] = BI_SCHED_ADD,
|
||||
[BI_SWIZZLE] = BI_SCHED_ALL | BI_SWIZZLABLE,
|
||||
[BI_TEX] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD | BI_VECTOR,
|
||||
[BI_ROUND] = BI_GENERIC | BI_ROUNDMODE | BI_SCHED_ALL,
|
||||
|
@@ -71,8 +71,9 @@ enum bi_class {
|
||||
BI_SHIFT,
|
||||
BI_STORE,
|
||||
BI_STORE_VAR,
|
||||
BI_SPECIAL, /* _FAST, _TABLE on supported GPUs */
|
||||
BI_SPECIAL, /* _FAST on supported GPUs */
|
||||
BI_SWIZZLE,
|
||||
BI_TABLE,
|
||||
BI_TEX,
|
||||
BI_ROUND,
|
||||
BI_NUM_CLASSES
|
||||
@@ -182,6 +183,15 @@ enum bi_round_op {
|
||||
BI_ROUND_ROUND /* i.e.: fround() */
|
||||
};
|
||||
|
||||
enum bi_table_op {
|
||||
/* fp32 log2() with low precision, suitable for GL or half_log2() in
|
||||
* CL. In the first argument, takes x. Letting u be such that x =
|
||||
* 2^{-m} u with m integer and 0.75 <= u < 1.5, returns
|
||||
* log2(u) / (u - 1). */
|
||||
|
||||
BI_TABLE_LOG2_U_OVER_U_1_LOW,
|
||||
};
|
||||
|
||||
enum bi_special_op {
|
||||
BI_SPECIAL_FRCP,
|
||||
BI_SPECIAL_FRSQ,
|
||||
@@ -244,6 +254,7 @@ typedef struct {
|
||||
enum bi_bitwise_op bitwise;
|
||||
enum bi_round_op round;
|
||||
enum bi_special_op special;
|
||||
enum bi_table_op table;
|
||||
enum bi_cond compare;
|
||||
} op;
|
||||
|
||||
|
Reference in New Issue
Block a user