Mesa (master): nv50: fix stupid thinko in emit_set

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Tue Sep 15 13:37:25 UTC 2009


Module: Mesa
Branch: master
Commit: d3a9cf54c0a95fb60ac8921e100d51b53c44541b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d3a9cf54c0a95fb60ac8921e100d51b53c44541b

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Tue Sep 15 15:24:32 2009 +0200

nv50: fix stupid thinko in emit_set

When swapping sources 0 and 1, EQ of course does *not*
become NE, etc.

Introduced in 2b963f5c723401aa2646bd48eefe065cd335e280.

---

 src/gallium/drivers/nv50/nv50_program.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index d7bef1e..eb90d5e 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -854,12 +854,14 @@ static void
 emit_set(struct nv50_pc *pc, unsigned ccode, struct nv50_reg *dst, int wp,
 	 struct nv50_reg *src0, struct nv50_reg *src1)
 {
+	static const unsigned cc_swapped[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
+
 	struct nv50_program_exec *e = exec(pc);
 	struct nv50_reg *rdst;
 
 	assert(ccode < 16);
 	if (check_swap_src_0_1(pc, &src0, &src1))
-		ccode = ccode ^ 0x7;
+		ccode = cc_swapped[ccode & 7] | (ccode & 8);
 
 	rdst = dst;
 	if (dst && dst->type != P_TEMP)




More information about the mesa-commit mailing list