From d3a9cf54c0a95fb60ac8921e100d51b53c44541b Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Tue, 15 Sep 2009 15:24:32 +0200 Subject: [PATCH] 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 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index d7bef1ebeea..eb90d5e66f9 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) -- 2.30.2