case REG_CLASS_TEXW:
return (tag != TAG_LOAD_STORE_4);
case REG_CLASS_WORK:
- return (tag == TAG_ALU_4);
+ return IS_ALU(tag);
default:
unreachable("Invalid class");
}
return (tag == TAG_TEXTURE_4);
case REG_CLASS_LDST:
case REG_CLASS_WORK:
- return (tag == TAG_ALU_4) || (tag == TAG_LOAD_STORE_4);
+ return IS_ALU(tag) || (tag == TAG_LOAD_STORE_4);
default:
unreachable("Invalid class");
}
{
size_t sz = BITSET_WORDS(ctx->temp_count) * sizeof(BITSET_WORD);
- /* Bitfields for the various types of registers we could have */
+ /* Bitfields for the various types of registers we could have. aluw can
+ * be written by either ALU or load/store */
unsigned *alur = calloc(sz, 1);
unsigned *aluw = calloc(sz, 1);
mark_node_class(aluw, ins->dest);
mark_node_class(alur, ins->src[0]);
mark_node_class(alur, ins->src[1]);
+ mark_node_class(alur, ins->src[2]);
break;
case TAG_LOAD_STORE_4:
+ mark_node_class(aluw, ins->dest);
mark_node_class(ldst, ins->src[0]);
mark_node_class(ldst, ins->src[1]);
mark_node_class(ldst, ins->src[2]);
midgard_instruction *ins)
{
switch (ins->type) {
- case TAG_ALU_4: {
+ case TAG_ALU_4:
+ case TAG_ALU_8:
+ case TAG_ALU_12:
+ case TAG_ALU_16: {
+ if (ins->compact_branch)
+ return;
+
struct phys_reg src1 = index_to_reg(ctx, g, ins->src[0]);
struct phys_reg src2 = index_to_reg(ctx, g, ins->src[1]);
struct phys_reg dest = index_to_reg(ctx, g, ins->dest);
void
install_registers(compiler_context *ctx, struct ra_graph *g)
{
- mir_foreach_block(ctx, block) {
- mir_foreach_instr_in_block(block, ins) {
- install_registers_instr(ctx, g, ins);
- }
- }
-
+ mir_foreach_instr_global(ctx, ins)
+ install_registers_instr(ctx, g, ins);
}