broadcom/compiler: preserve ordering of unifa/ldunifa sequences

unifa writes the addresss from which follow-up ldunifa loads,
and each ldunifa increments the unifa addeess by 32-bit so the
loads need to be ordered too.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>
This commit is contained in:
Iago Toral Quiroga 2021-02-11 12:13:02 +01:00 committed by Marge Bot
parent 97c078488f
commit 42880fdf5d

View file

@ -83,6 +83,7 @@ struct schedule_state {
struct schedule_node *last_vpm;
struct schedule_node *last_unif;
struct schedule_node *last_rtop;
struct schedule_node *last_unifa;
enum direction dir;
/* Estimated cycle when the current instruction would start. */
uint32_t time;
@ -228,6 +229,11 @@ process_waddr_deps(struct schedule_state *state, struct schedule_node *n,
add_write_dep(state, &state->last_tmu_write, n);
break;
case V3D_QPU_WADDR_UNIFA:
if (state->devinfo->ver >= 40)
add_write_dep(state, &state->last_unifa, n);
break;
case V3D_QPU_WADDR_NOP:
break;
@ -400,6 +406,10 @@ calculate_deps(struct schedule_state *state, struct schedule_node *n)
if (vir_has_uniform(qinst))
add_write_dep(state, &state->last_unif, n);
/* Both unifa and ldunifa must preserve ordering */
if (inst->sig.ldunifa || inst->sig.ldunifarf)
add_write_dep(state, &state->last_unifa, n);
if (v3d_qpu_reads_flags(inst))
add_read_dep(state, state->last_sf, n);
if (v3d_qpu_writes_flags(inst))