}
}
+static const char *
+bi_imath_op_name(enum bi_imath_op op)
+{
+ switch (op) {
+ case BI_IMATH_ADD: return "iadd";
+ case BI_IMATH_SUB: return "isub";
+ default: return "invalid";
+ }
+}
+
const char *
bi_table_op_name(enum bi_table_op op)
{
fprintf(fp, "%s", ins->op.minmax == BI_MINMAX_MIN ? "min" : "max");
else if (ins->type == BI_BITWISE)
fprintf(fp, "%s", bi_bitwise_op_name(ins->op.bitwise));
+ else if (ins->type == BI_IMATH)
+ fprintf(fp, "%s", bi_imath_op_name(ins->op.imath));
else if (ins->type == BI_SPECIAL)
fprintf(fp, "%s", bi_special_op_name(ins->op.special));
else if (ins->type == BI_TABLE)
fprintf(fp, "\n");
}
+void
+bi_print_ports(bi_registers *regs, FILE *fp)
+{
+ for (unsigned i = 0; i < 2; ++i) {
+ if (regs->enabled[i])
+ fprintf(fp, "port %u: %u\n", i, regs->port[i]);
+ }
+
+ if (regs->write_fma || regs->write_add) {
+ fprintf(fp, "port 2 (%s): %u\n",
+ regs->write_add ? "ADD" : "FMA",
+ regs->port[2]);
+ }
+
+ if ((regs->write_fma && regs->write_add) || regs->read_port3) {
+ fprintf(fp, "port 3 (%s): %u\n",
+ regs->read_port3 ? "read" : "FMA",
+ regs->port[3]);
+ }
+}
+
void
bi_print_bundle(bi_bundle *bundle, FILE *fp)
{