broadcom/compiler: rename unifa tracking fields
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 8 Apr 2021 07:08:20 +0000 (09:08 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 9 Apr 2021 10:31:40 +0000 (10:31 +0000)
The term 'last' may be misleading because the offset represents
the current unifa offset, which is the offset used by the last
load plus 4 bytes, so rename these to use the term 'current'
instead.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10100>

src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/v3d_compiler.h

index 3c570f1..89760ca 100644 (file)
@@ -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) {
index 116273d..f229f41 100644 (file)
@@ -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.