Mesa (nv50-compiler): nv50: cannot move from local mem to output reg directly

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Sun Sep 12 09:42:09 UTC 2010


Module: Mesa
Branch: nv50-compiler
Commit: d4fd11a628b0e48d76fab4a0b94470a7592faf26
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d4fd11a628b0e48d76fab4a0b94470a7592faf26

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Sun Sep 12 11:19:24 2010 +0200

nv50: cannot move from local mem to output reg directly

---

 src/gallium/drivers/nv50/nv50_pc.c          |    3 ++-
 src/gallium/drivers/nv50/nv50_pc_optimize.c |    3 ++-
 src/gallium/drivers/nv50/nv50_pc_print.c    |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_pc.c b/src/gallium/drivers/nv50/nv50_pc.c
index 26ad9b4..0511acf 100644
--- a/src/gallium/drivers/nv50/nv50_pc.c
+++ b/src/gallium/drivers/nv50/nv50_pc.c
@@ -57,6 +57,7 @@ nv50_indirect_opnd(struct nv_instruction *i)
    switch (i->opcode) {
    case NV_OP_MOV:
    case NV_OP_LDA:
+   case NV_OP_STA:
       return 0;
    default:
       return 1;
@@ -341,7 +342,7 @@ nv_print_program(struct nv_pc *pc)
          nv_print_function(pc->root[i]);
 }
 
-#ifdef NV50_PC_DEBUG
+#ifdef NV50PC_DEBUG
 static void
 nv_do_print_cfgraph(struct nv_pc *pc, FILE *f, struct nv_basic_block *b)
 {
diff --git a/src/gallium/drivers/nv50/nv50_pc_optimize.c b/src/gallium/drivers/nv50/nv50_pc_optimize.c
index edda6c0..8653bc6 100644
--- a/src/gallium/drivers/nv50/nv50_pc_optimize.c
+++ b/src/gallium/drivers/nv50/nv50_pc_optimize.c
@@ -327,7 +327,8 @@ nv_pass_fold_stores(struct nv_pass *ctx, struct nv_basic_block *b)
 
       /* cannot write to $oX when using immediate */
       for (j = 0; j < 4 && nvi->src[j]; ++j)
-         if (nvi->src[j]->value->reg.file == NV_FILE_IMM)
+         if (nvi->src[j]->value->reg.file == NV_FILE_IMM ||
+             nvi->src[j]->value->reg.file == NV_FILE_MEM_L)
             break;
       if (j < 4 && nvi->src[j])
          continue;
diff --git a/src/gallium/drivers/nv50/nv50_pc_print.c b/src/gallium/drivers/nv50/nv50_pc_print.c
index a714019..984f6cb 100644
--- a/src/gallium/drivers/nv50/nv50_pc_print.c
+++ b/src/gallium/drivers/nv50/nv50_pc_print.c
@@ -220,7 +220,7 @@ nv_print_value(struct nv_value *value, struct nv_value *ind, ubyte type)
       PRINT(" %s%cc%i", mgta, reg_pfx, nv_value_id(value));
       break;
    case NV_FILE_MEM_L:
-      nv_print_address('l', -1, ind, 4 * nv_value_id(value));
+      nv_print_address('l', -1, ind, nv_value_id(value));
       break;
    case NV_FILE_MEM_S:
       nv_print_address('s', -1, ind, 4 * nv_value_id(value));




More information about the mesa-commit mailing list