freedreno/a6xx: Use VALIDREG in next_regid() helper
authorKristian H. Kristensen <hoegsberg@google.com>
Mon, 3 Jun 2019 21:25:39 +0000 (14:25 -0700)
committerKristian H. Kristensen <hoegsberg@google.com>
Wed, 5 Jun 2019 18:15:04 +0000 (11:15 -0700)
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a6xx/fd6_program.c

index c3345dc1636828d1d60631ae27c500effe0ce98a..2c982cc1afcaec016083039a6e4791c187e7a928 100644 (file)
@@ -300,18 +300,18 @@ setup_stages(struct fd6_program_state *state, struct stage *s, bool binning_pass
        }
 }
 
+#define VALIDREG(r)      ((r) != regid(63,0))
+#define CONDREG(r, val)  COND(VALIDREG(r), (val))
+
 static inline uint32_t
 next_regid(uint32_t reg, uint32_t increment)
 {
-       if (reg == regid(63,0))
-               return regid(63,0);
-       else
+       if (VALIDREG(reg))
                return reg + increment;
+       else
+               return regid(63,0);
 }
 
-#define VALIDREG(r)      ((r) != regid(63,0))
-#define CONDREG(r, val)  COND(VALIDREG(r), (val))
-
 static void
 setup_stateobj(struct fd_ringbuffer *ring, struct fd6_program_state *state,
                const struct ir3_shader_key *key, bool binning_pass)