[Mesa-dev] [Mesa-stable] [PATCH] i965/vec4: Use reads_accumulator_implicitly(), not MACH checks.

Juan A. Suarez Romero jasuarez at igalia.com
Tue Apr 25 09:57:26 UTC 2017


On Sat, 2017-04-22 at 16:28 -0700, Kenneth Graunke wrote:
> Curro pointed out that I should not just check for MACH, but use
> the reads_accumulator_implicitly() helper, which would also prevent
> the same bug with MAC and SADA2 (if we ever decide to use them).
> 

This seems to rely on commit 2faf227ec2e (i965/vec4: Avoid reswizzling
MACH instructions in opt_register_coalesce()), which is not available
in stable.

But taking a look at it, I think it could be good candidate to be also
in stable.


WDYT? Can we propose 2faf227ec2e to stable?


	J.A.

> Cc: Francisco Jerez <currojerez at riseup.net>
> Cc: mesa-stable at lists.freedesktop.org
> ---
>  src/intel/compiler/brw_vec4.cpp | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> Curro - sorry, I already pushed the MACH patch...but I agree with your
> feedback, so here it is as a follow-up patch :)
> 
> Emil - you'll need to cherry-pick 9347acac440190af67fce7b5f28e8eee7245fb6d
> before picking this patch.  I forgot to nominate it for stable, sorry!
> 
> diff --git a/src/intel/compiler/brw_vec4.cpp b/src/intel/compiler/brw_vec4.cpp
> index 4bb774bf10e..0909ddb5861 100644
> --- a/src/intel/compiler/brw_vec4.cpp
> +++ b/src/intel/compiler/brw_vec4.cpp
> @@ -1071,11 +1071,11 @@ vec4_instruction::can_reswizzle(const struct gen_device_info *devinfo,
>     if (devinfo->gen == 6 && is_math() && swizzle != BRW_SWIZZLE_XYZW)
>        return false;
>  
> -   /* Don't touch MACH - it uses the accumulator results from an earlier
> -    * MUL - so we'd need to reswizzle both.  We don't do that, so just
> -    * avoid it entirely.
> +   /* We can't swizzle implicit accumulator access.  We'd have to
> +    * reswizzle the producer of the accumulator value in addition
> +    * to the consumer (i.e. both MUL and MACH).  Just skip this.
>      */
> -   if (opcode == BRW_OPCODE_MACH)
> +   if (reads_accumulator_implicitly())
>        return false;
>  
>     if (!can_do_writemask(devinfo) && dst_writemask != WRITEMASK_XYZW)


More information about the mesa-dev mailing list