vc4: Remove dead i == 0 code from the cos() implementation.
authorEric Anholt <eric@anholt.net>
Fri, 21 Sep 2018 22:00:21 +0000 (15:00 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 22 Sep 2018 00:16:43 +0000 (17:16 -0700)
The loop starts at 1.

src/gallium/drivers/vc4/vc4_program.c

index 1f46b64005bd79ff2a21a083c45ff1462b277b10..3c439806d36ee4e8fe67e0df3daa182b9db081d5 100644 (file)
@@ -758,13 +758,10 @@ ntq_fcos(struct vc4_compile *c, struct qreg src)
                 if (i != 1)
                         x = qir_FMUL(c, x, x2);
 
-                struct qreg mul = qir_FMUL(c,
+                sum = qir_FADD(c, qir_FMUL(c,
                                            x,
-                                           qir_uniform_f(c, coeff[i]));
-                if (i == 0)
-                        sum = mul;
-                else
-                        sum = qir_FADD(c, sum, mul);
+                                           qir_uniform_f(c, coeff[i])),
+                               sum);
         }
         return sum;
 }