nvc0: don't swap sources if either value is not in a GPR
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 16 Feb 2011 10:42:28 +0000 (11:42 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 16 Feb 2011 14:45:31 +0000 (15:45 +0100)
The memory / immediate source should already be in the only valid
position.

src/gallium/drivers/nvc0/nvc0_pc_optimize.c

index 12a3149..3d03400 100644 (file)
@@ -245,6 +245,9 @@ check_swap_src_0_1(struct nv_instruction *nvi)
       return;
    assert(src0 && src1 && src0->value && src1->value);
 
+   if (src1->value->reg.file != NV_FILE_GPR)
+      return;
+
    if (is_cspace_load(src0->value->insn)) {
       if (!is_cspace_load(src1->value->insn)) {
          nvi->src[0] = src1;