i965/vec4: Use can_do_writemask in can_reswizzle
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 5 Apr 2016 21:10:04 +0000 (14:10 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 15 Apr 2016 21:04:38 +0000 (14:04 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4.cpp

index 4d0efa8fbfd9bba14abebe64e5c3c6f56f36b913..87b5ff98f8c44a2357c0fbb0774df697f9046a30 100644 (file)
@@ -965,10 +965,12 @@ vec4_instruction::can_reswizzle(const struct brw_device_info *devinfo,
                                 int swizzle_mask)
 {
    /* Gen6 MATH instructions can not execute in align16 mode, so swizzles
-    * or writemasking are not allowed.
+    * are not allowed.
     */
-   if (devinfo->gen == 6 && is_math() &&
-       (swizzle != BRW_SWIZZLE_XYZW || dst_writemask != WRITEMASK_XYZW))
+   if (devinfo->gen == 6 && is_math() && swizzle != BRW_SWIZZLE_XYZW)
+      return false;
+
+   if (!can_do_writemask(devinfo) && dst_writemask != WRITEMASK_XYZW)
       return false;
 
    /* If this instruction sets anything not referenced by swizzle, then we'd