return u;
}
-/* Represents the assignment of ports for a given bundle */
-
-struct bi_registers {
- /* Register to assign to each port */
- unsigned port[4];
-
- /* Read ports can be disabled */
- bool enabled[2];
-
- /* Should we write FMA? what about ADD? If only a single port is
- * enabled it is in port 2, else ADD/FMA is 2/3 respectively */
- bool write_fma, write_add;
-
- /* Should we read with port 3? */
- bool read_port3;
-
- /* Packed uniform/constant */
- uint8_t uniform_constant;
-
- /* Whether writes are actually for the last instruction */
- bool first_instruction;
-};
-
-static inline void
-bi_print_ports(struct bi_registers *regs)
-{
- for (unsigned i = 0; i < 2; ++i) {
- if (regs->enabled[i])
- printf("port %u: %u\n", i, regs->port[i]);
- }
-
- if (regs->write_fma || regs->write_add) {
- printf("port 2 (%s): %u\n",
- regs->write_add ? "ADD" : "FMA",
- regs->port[2]);
- }
-
- if ((regs->write_fma && regs->write_add) || regs->read_port3) {
- printf("port 3 (%s): %u\n",
- regs->read_port3 ? "read" : "FMA",
- regs->port[3]);
- }
-}
-
/* The uniform/constant slot allows loading a contiguous 64-bit immediate or
* pushed uniform per bundle. Figure out which one we need in the bundle (the
* scheduler needs to ensure we only have one type per bundle), validate
fprintf(fp, "\n");
}
+void
+bi_print_ports(struct bi_registers *regs)
+{
+ for (unsigned i = 0; i < 2; ++i) {
+ if (regs->enabled[i])
+ printf("port %u: %u\n", i, regs->port[i]);
+ }
+
+ if (regs->write_fma || regs->write_add) {
+ printf("port 2 (%s): %u\n",
+ regs->write_add ? "ADD" : "FMA",
+ regs->port[2]);
+ }
+
+ if ((regs->write_fma && regs->write_add) || regs->read_port3) {
+ printf("port 3 (%s): %u\n",
+ regs->read_port3 ? "read" : "FMA",
+ regs->port[3]);
+ }
+}
+
void
bi_print_bundle(bi_bundle *bundle, FILE *fp)
{
const char * bi_tex_op_name(enum bi_tex_op op);
void bi_print_instruction(bi_instruction *ins, FILE *fp);
+void bi_print_ports(struct bi_registers *regs);
void bi_print_bundle(bi_bundle *bundle, FILE *fp);
void bi_print_clause(bi_clause *clause, FILE *fp);
void bi_print_block(bi_block *block, FILE *fp);
};
} bi_instruction;
+/* Represents the assignment of ports for a given bi_bundle */
+
+struct bi_registers {
+ /* Register to assign to each port */
+ unsigned port[4];
+
+ /* Read ports can be disabled */
+ bool enabled[2];
+
+ /* Should we write FMA? what about ADD? If only a single port is
+ * enabled it is in port 2, else ADD/FMA is 2/3 respectively */
+ bool write_fma, write_add;
+
+ /* Should we read with port 3? */
+ bool read_port3;
+
+ /* Packed uniform/constant */
+ uint8_t uniform_constant;
+
+ /* Whether writes are actually for the last instruction */
+ bool first_instruction;
+};
+
/* A bi_bundle contains two paired instruction pointers. If a slot is unfilled,
* leave it NULL; the emitter will fill in a nop.
*/