i965: Delete dead dFdy flipping code.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 18 May 2016 17:35:54 +0000 (10:35 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 20 May 2016 21:30:09 +0000 (14:30 -0700)
Rob's nir_lower_wpos_ytransform() pass flips dFdy in the opposite case
of what I expected, so we always take the negate_value case.  It doesn't
really matter.

v2: Write src0 before src1 in ADD instructions (requested by Matt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_generator.cpp

index 599287e10254029e64d5c102041a00d7665000c3..2a486513691f1d3393fb020d29385980b8582c4e 100644 (file)
@@ -1113,8 +1113,6 @@ void
 fs_generator::generate_ddy(enum opcode opcode,
                            struct brw_reg dst, struct brw_reg src)
 {
-   bool negate_value = true;
-
    if (opcode == FS_OPCODE_DDY_FINE) {
       /* From the Ivy Bridge PRM, volume 4 part 3, section 3.3.9 (Register
        * Region Restrictions):
@@ -1164,20 +1162,11 @@ fs_generator::generate_ddy(enum opcode opcode,
       if (unroll_to_simd8) {
          brw_set_default_exec_size(p, BRW_EXECUTE_8);
          brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
-         if (negate_value) {
-            brw_ADD(p, firsthalf(dst), firsthalf(src1), negate(firsthalf(src0)));
-            brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
-            brw_ADD(p, sechalf(dst), sechalf(src1), negate(sechalf(src0)));
-         } else {
-            brw_ADD(p, firsthalf(dst), firsthalf(src0), negate(firsthalf(src1)));
-            brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
-            brw_ADD(p, sechalf(dst), sechalf(src0), negate(sechalf(src1)));
-         }
+         brw_ADD(p, firsthalf(dst), negate(firsthalf(src0)), firsthalf(src1));
+         brw_set_default_compression_control(p, BRW_COMPRESSION_2NDHALF);
+         brw_ADD(p, sechalf(dst), negate(sechalf(src0)), sechalf(src1));
       } else {
-         if (negate_value)
-            brw_ADD(p, dst, src1, negate(src0));
-         else
-            brw_ADD(p, dst, src0, negate(src1));
+         brw_ADD(p, dst, negate(src0), src1);
       }
       brw_pop_insn_state(p);
    } else {
@@ -1196,10 +1185,7 @@ fs_generator::generate_ddy(enum opcode opcode,
                                     BRW_WIDTH_4,
                                     BRW_HORIZONTAL_STRIDE_0,
                                     BRW_SWIZZLE_XYZW, WRITEMASK_XYZW);
-      if (negate_value)
-         brw_ADD(p, dst, src1, negate(src0));
-      else
-         brw_ADD(p, dst, src0, negate(src1));
+      brw_ADD(p, dst, negate(src0), src1);
    }
 }