pan/midgard: Add make_compiler_temp_reg helper
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 29 Jul 2019 23:52:36 +0000 (16:52 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 30 Jul 2019 17:01:19 +0000 (10:01 -0700)
Corrollary to make_compiler_temp (for SSA).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/compiler.h

index 7f5714d..93c3968 100644 (file)
@@ -388,6 +388,12 @@ make_compiler_temp(compiler_context *ctx)
 }
 
 static inline unsigned
+make_compiler_temp_reg(compiler_context *ctx)
+{
+        return ((ctx->func->impl->reg_alloc + ctx->temp_alloc++) << 1) | IS_REG;
+}
+
+static inline unsigned
 nir_src_index(compiler_context *ctx, nir_src *src)
 {
         if (src->is_ssa)