[Mesa-dev] [PATCH 1/3] gallium/ttn: minor cleanup

Rob Clark robdclark at gmail.com
Wed Apr 8 15:34:06 PDT 2015


From: Rob Clark <robclark at freedesktop.org>

Extract tgsi_dst->Index into a local.. split out from 'gallium/ttn: add
support for temp arrays' for noise reduction..

Signed-off-by: Rob Clark <robclark at freedesktop.org>
---
 src/gallium/auxiliary/nir/tgsi_to_nir.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index da935a4..fcccdad 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -340,17 +340,18 @@ ttn_get_dest(struct ttn_compile *c, struct tgsi_full_dst_register *tgsi_fdst)
 {
    struct tgsi_dst_register *tgsi_dst = &tgsi_fdst->Register;
    nir_alu_dest dest;
+   unsigned index = tgsi_dst->Index;
 
    memset(&dest, 0, sizeof(dest));
 
    if (tgsi_dst->File == TGSI_FILE_TEMPORARY) {
-      dest.dest.reg.reg = c->temp_regs[tgsi_dst->Index].reg;
-      dest.dest.reg.base_offset = c->temp_regs[tgsi_dst->Index].offset;
+      dest.dest.reg.reg = c->temp_regs[index].reg;
+      dest.dest.reg.base_offset = c->temp_regs[index].offset;
    } else if (tgsi_dst->File == TGSI_FILE_OUTPUT) {
-      dest.dest.reg.reg = c->output_regs[tgsi_dst->Index].reg;
-      dest.dest.reg.base_offset = c->output_regs[tgsi_dst->Index].offset;
+      dest.dest.reg.reg = c->output_regs[index].reg;
+      dest.dest.reg.base_offset = c->output_regs[index].offset;
    } else if (tgsi_dst->File == TGSI_FILE_ADDRESS) {
-      assert(tgsi_dst->Index == 0);
+      assert(index == 0);
       dest.dest.reg.reg = c->addr_reg;
    }
 
-- 
2.1.0



More information about the mesa-dev mailing list