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:
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";
}
}
+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)
{
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
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);
[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,
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
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,
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;