nv50,nvc0: fix condition code change when commuting SET sources
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Mon, 7 Feb 2011 18:03:09 +0000 (19:03 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 9 Feb 2011 15:04:59 +0000 (16:04 +0100)
src/gallium/drivers/nv50/nv50_pc_optimize.c
src/gallium/drivers/nvc0/nvc0_pc_optimize.c

index 27eb3817bf107b0f34fbbd581f977612f8801ac1..679e5ea14856ffdaae8299e220c80657f6555de3 100644 (file)
@@ -299,7 +299,7 @@ check_swap_src_0_1(struct nv_instruction *nvi)
    }
 
    if (nvi->opcode == NV_OP_SET && nvi->src[0] != src0)
-      nvi->set_cond = cc_swapped[nvi->set_cond];
+      nvi->set_cond = (nvi->set_cond & ~7) | cc_swapped[nvi->set_cond & 7];
 }
 
 static int
index a6791529fa7a57f7a9d692b00382a51ebcef04fd..2e554dbe4e49ba2783145f877be06d78cf848eb3 100644 (file)
@@ -258,8 +258,8 @@ check_swap_src_0_1(struct nv_instruction *nvi)
       }
    }
 
-   if (nvi->src[0] != src0 && nvi->opcode == NV_OP_SET)
-      nvi->set_cond = cc_swapped[nvi->set_cond];
+   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];
 }
 
 static void