nv50: fix constant_operand opt mul by 2 case
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sun, 25 Jul 2010 21:32:18 +0000 (23:32 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Mon, 26 Jul 2010 09:20:39 +0000 (11:20 +0200)
src/gallium/drivers/nv50/nv50_pc_optimize.c

index 0018131fb5e12cad3227b83eb2cfa9019d7188cd..107ef0f4bf4383cd22330892fa93ad1697cb9d17 100644 (file)
@@ -465,11 +465,7 @@ constant_operand(struct nv_pc *pc,
       if ((type == NV_TYPE_F32 && val->reg.imm.f32 == 2.0f) ||
           (NV_TYPE_ISINT(type) && val->reg.imm.u32 == 2)) {
          nvi->opcode = NV_OP_ADD;
-         nv_reference(pc, &nvi->src[s], NULL);
-         if (!s) {
-            nvi->src[0] = nvi->src[1];
-            nvi->src[1] = NULL;
-         }
+         nv_reference(pc, &nvi->src[s], nvi->src[t]->value);
       } else
       if (type == NV_TYPE_F32 && val->reg.imm.f32 == -1.0f) {
          nvi->opcode = NV_OP_NEG;