summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50/nv50_pc_optimize.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-07-24 21:17:21 +0200
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2010-07-24 21:20:40 +0200
commit1d1bb206122b719d6959eceddd511a0294816a9a (patch)
tree5bbe273bdaabcc577676dd4c4d657f724bd94858 /src/gallium/drivers/nv50/nv50_pc_optimize.c
parentd7aac107e64e1c4c1af30806817a2888e7a4a96c (diff)
nv50: don't produce MOV immediate to output reg in store opt
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_pc_optimize.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_pc_optimize.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/nv50/nv50_pc_optimize.c b/src/gallium/drivers/nv50/nv50_pc_optimize.c
index 0811420e42..f81384f00d 100644
--- a/src/gallium/drivers/nv50/nv50_pc_optimize.c
+++ b/src/gallium/drivers/nv50/nv50_pc_optimize.c
@@ -266,11 +266,10 @@ nv_pass_fold_stores(struct nv_pass *ctx, struct nv_basic_block *b)
int j;
for (sti = b->entry; sti; sti = sti->next) {
- if (!sti->def[0])
+ if (!sti->def[0] || sti->def[0]->reg.file != NV_FILE_OUT)
continue;
- if (sti->def[0]->reg.file != NV_FILE_OUT)
- continue;
+ /* only handling MOV to $oX here */
if (sti->opcode != NV_OP_MOV && sti->opcode != NV_OP_STA)
continue;
@@ -282,8 +281,13 @@ nv_pass_fold_stores(struct nv_pass *ctx, struct nv_basic_block *b)
if (nvi->def[0]->refc > 1)
continue;
+ /* cannot MOV immediate to $oX */
+ if (nvi->src[0]->value->reg.file == NV_FILE_IMM)
+ continue;
+
nvi->def[0] = sti->def[0];
- nvi->fixed = 1;
+ sti->def[0] = NULL;
+ nvi->fixed = sti->fixed;
sti->fixed = 0;
}
DESCEND_ARBITRARY(j, nv_pass_fold_stores);