mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 10:50:10 +01:00
pan/bi: Move bi_registers to common IR structures
Port assignments are critical to scheduling, this can't just live in bi_pack. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5260>
This commit is contained in:
parent
59f8f20306
commit
79f30d8a86
4 changed files with 45 additions and 44 deletions
|
|
@ -59,50 +59,6 @@ bi_pack_header(bi_clause *clause, bi_clause *next, bool is_fragment)
|
|||
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
|
||||
|
|
|
|||
|
|
@ -411,6 +411,27 @@ bi_print_instruction(bi_instruction *ins, FILE *fp)
|
|||
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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ const char * bi_frexp_op_name(enum bi_frexp_op op);
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -301,6 +301,29 @@ typedef struct {
|
|||
};
|
||||
} 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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue