diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index 3c570f1da65..89760caffde 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -2638,14 +2638,14 @@ emit_ldunifa(struct v3d_compile *c, struct qreg *result) *result = vir_emit_def(c, ldunifa); else vir_emit_nondef(c, ldunifa); - c->last_unifa_offset += 4; + c->current_unifa_offset += 4; } static void ntq_emit_load_ubo_unifa(struct v3d_compile *c, nir_intrinsic_instr *instr) { /* Every ldunifa auto-increments the unifa address by 4 bytes, so our - * last unifa offset is 4 bytes ahead of the offset of the last load. + * current unifa offset is 4 bytes ahead of the offset of the last load. */ static const int32_t max_unifa_skip_dist = MAX_UNIFA_SKIP_DISTANCE - 4; @@ -2670,17 +2670,17 @@ ntq_emit_load_ubo_unifa(struct v3d_compile *c, nir_intrinsic_instr *instr) bool skip_unifa = false; uint32_t ldunifa_skips = 0; if (dynamic_src) { - c->last_unifa_block = NULL; - } else if (c->cur_block == c->last_unifa_block && - c->last_unifa_index == index && - c->last_unifa_offset <= const_offset && - c->last_unifa_offset + max_unifa_skip_dist >= const_offset) { + c->current_unifa_block = NULL; + } else if (c->cur_block == c->current_unifa_block && + c->current_unifa_index == index && + c->current_unifa_offset <= const_offset && + c->current_unifa_offset + max_unifa_skip_dist >= const_offset) { skip_unifa = true; - ldunifa_skips = (const_offset - c->last_unifa_offset) / 4; + ldunifa_skips = (const_offset - c->current_unifa_offset) / 4; } else { - c->last_unifa_block = c->cur_block; - c->last_unifa_index = index; - c->last_unifa_offset = const_offset; + c->current_unifa_block = c->cur_block; + c->current_unifa_index = index; + c->current_unifa_offset = const_offset; } if (!skip_unifa) { diff --git a/src/broadcom/compiler/v3d_compiler.h b/src/broadcom/compiler/v3d_compiler.h index 116273dd07a..f229f414e85 100644 --- a/src/broadcom/compiler/v3d_compiler.h +++ b/src/broadcom/compiler/v3d_compiler.h @@ -668,14 +668,14 @@ struct v3d_compile { */ uint32_t min_threads_for_reg_alloc; - /* Last UBO index and offset used with a unifa/ldunifa sequence and the - * block where it was emitted. This is used to skip unifa writes (and - * their 3 delay slot) when the next UBO load reads right after the - * previous one in the same block. + /* The UBO index and block used with the last unifa load, as well as the + * current unifa offset *after* emitting that load. This is used to skip + * unifa writes (and their 3 delay slot) when the next UBO load reads + * right after the previous one in the same block. */ - struct qblock *last_unifa_block; - int32_t last_unifa_index; - uint32_t last_unifa_offset; + struct qblock *current_unifa_block; + int32_t current_unifa_index; + uint32_t current_unifa_offset; /* State for whether we're executing on each channel currently. 0 if * yes, otherwise a block number + 1 that the channel jumped to.