#define PHYS_INDEX (ACC_INDEX + ACC_COUNT)
#define PHYS_COUNT 64
+static inline bool
+qinst_writes_tmu(struct qinst *inst)
+{
+ return (inst->dst.file == QFILE_MAGIC &&
+ v3d_qpu_magic_waddr_is_tmu(inst->dst.index));
+}
+
static bool
is_last_ldtmu(struct qinst *inst, struct qblock *block)
{
- list_for_each_entry_from(struct qinst, scan_inst, inst,
+ list_for_each_entry_from(struct qinst, scan_inst, inst->link.next,
&block->instructions, link) {
- if (inst->qpu.sig.ldtmu)
+ if (scan_inst->qpu.sig.ldtmu)
return false;
- if (v3d_qpu_writes_tmu(&inst->qpu))
+ if (qinst_writes_tmu(scan_inst))
return true;
}
inst->qpu.alu.add.op == V3D_QPU_A_TMUWT)
in_tmu_operation = false;
- if (v3d_qpu_writes_tmu(&inst->qpu))
+ if (qinst_writes_tmu(inst))
in_tmu_operation = true;
}
}
/* The spill offset for this thread takes a bit of setup, so do it once at
* program start.
*/
-static void
+void
v3d_setup_spill_base(struct v3d_compile *c)
{
c->cursor = vir_before_block(vir_entry_block(c));
/* Make sure that we don't spill the spilling setup instructions. */
for (int i = start_num_temps; i < c->num_temps; i++)
BITSET_CLEAR(c->spillable, i);
+
+ c->cursor = vir_after_block(c->cur_block);
}
static void
vir_emit_thrsw(c);
vir_TMUWT(c);
c->spills++;
+ c->tmu_dirty_rcl = true;
}
}
ralloc_free(g);
- if (V3D_DEBUG & V3D_DEBUG_SHADERDB) {
- fprintf(stderr, "SHADER-DB: %s prog %d/%d: %d spills\n",
- vir_get_stage_name(c),
- c->program_id, c->variant_id,
- c->spills);
-
- fprintf(stderr, "SHADER-DB: %s prog %d/%d: %d fills\n",
- vir_get_stage_name(c),
- c->program_id, c->variant_id,
- c->fills);
- }
-
return temp_registers;
}