[Mesa-stable] [Mesa-dev] [PATCH] i965/fs: Fix lowering of integer multiplication with cmod.

Kenneth Graunke kenneth at whitecape.org
Wed May 27 11:53:12 PDT 2015


On Wednesday, May 27, 2015 10:58:01 AM Matt Turner wrote:
> If the multiplication's result is unused, except by a conditional_mod,
> the destination will be null. Since the final instruction in the lowered
> sequence is a partial-write, we can't put the conditional mod on it and
> we have to store the full result to a register and do a MOV with a
> conditional mod.
> 
> Cc: "10.6" <mesa-stable at lists.freedesktop.org>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90580
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 42a0d78..5cc4fe6 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -3606,6 +3606,10 @@ fs_visitor::lower_integer_multiplication()
>            * schedule multi-component multiplications much better.
>            */
>  
> +         if (inst->conditional_mod && inst->dst.is_null()) {
> +            inst->dst = fs_reg(GRF, alloc.allocate(dispatch_width / 8),
> +                               inst->dst.type, dispatch_width);
> +         }
>           fs_reg low = inst->dst;
>           fs_reg high(GRF, alloc.allocate(dispatch_width / 8),
>                       inst->dst.type, dispatch_width);
> @@ -3655,6 +3659,13 @@ fs_visitor::lower_integer_multiplication()
>           low.stride = 2;
>  
>           insert(ADD(dst, low, high));
> +
> +         if (inst->conditional_mod) {
> +            fs_reg null(retype(brw_null_reg(), inst->dst.type));
> +            fs_inst *mov = MOV(null, inst->dst);
> +            mov->conditional_mod = inst->conditional_mod;
> +            insert(mov);
> +         }
>        }
>  #undef insert
>  
> 

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-stable/attachments/20150527/9ec232fe/attachment.sig>


More information about the mesa-stable mailing list