nvc0: try to swap immediates to first source too
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 15 Jan 2011 13:10:27 +0000 (14:10 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 15 Jan 2011 13:14:55 +0000 (14:14 +0100)
src/gallium/drivers/nvc0/nvc0_pc_optimize.c

index 8dce32b..acc72bf 100644 (file)
@@ -249,6 +249,13 @@ check_swap_src_0_1(struct nv_instruction *nvi)
          nvi->src[0] = src1;
          nvi->src[1] = src0;
       }
+   } else
+   if (is_immd32_load(src0->value->insn)) {
+      if (!is_cspace_load(src1->value->insn) &&
+          !is_immd32_load(src1->value->insn)) {
+         nvi->src[0] = src1;
+         nvi->src[1] = src0;
+      }
    }
 
    if (nvi->src[0] != src0 && nvi->opcode == NV_OP_SET)