summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvc0/nvc0_pc_optimize.c
diff options
context:
space:
mode:
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-02-23 17:29:02 +0100
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>2011-02-24 17:35:36 +0100
commitd0caaba370cb70f426180a46e5475bf8a05ac19b (patch)
treeaab76a4d7ced16cfeae6b4c7d45611f7e270f05f /src/gallium/drivers/nvc0/nvc0_pc_optimize.c
parentb0bf4ee85f01e9cbe240e49e67a947d052daa3f3 (diff)
nvc0: change TGSI CMP translation to use slct
Saves us the explicit compare instruction needed with selp.
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_pc_optimize.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_pc_optimize.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_pc_optimize.c b/src/gallium/drivers/nvc0/nvc0_pc_optimize.c
index 8b56aa427f..c5a7367a5f 100644
--- a/src/gallium/drivers/nvc0/nvc0_pc_optimize.c
+++ b/src/gallium/drivers/nvc0/nvc0_pc_optimize.c
@@ -245,7 +245,9 @@ check_swap_src_0_1(struct nv_instruction *nvi)
struct nv_ref *src0 = nvi->src[0];
struct nv_ref *src1 = nvi->src[1];
- if (!nv_op_commutative(nvi->opcode) && NV_BASEOP(nvi->opcode) != NV_OP_SET)
+ if (!nv_op_commutative(nvi->opcode) &&
+ NV_BASEOP(nvi->opcode) != NV_OP_SET &&
+ NV_BASEOP(nvi->opcode) != NV_OP_SLCT)
return;
assert(src0 && src1 && src0->value && src1->value);
@@ -266,8 +268,13 @@ check_swap_src_0_1(struct nv_instruction *nvi)
}
}
- if (nvi->src[0] != src0 && NV_BASEOP(nvi->opcode) == NV_OP_SET)
- nvi->set_cond = (nvi->set_cond & ~7) | cc_swapped[nvi->set_cond & 7];
+ if (nvi->src[0] != src0) {
+ if (NV_BASEOP(nvi->opcode) == NV_OP_SET)
+ nvi->set_cond = (nvi->set_cond & ~7) | cc_swapped[nvi->set_cond & 7];
+ else
+ if (NV_BASEOP(nvi->opcode) == NV_OP_SLCT)
+ nvi->set_cond = NV_CC_INVERSE(nvi->set_cond);
+ }
}
static void