[Mesa-dev] [PATCH 1/2] i965: Emit MOVs for neg/abs.

Paul Berry stereotype441 at gmail.com
Thu Aug 15 15:49:42 PDT 2013


On 12 August 2013 13:18, Matt Turner <mattst88 at gmail.com> wrote:

> Necessary to avoid combining a bitcast and a modifier into a single
> operation. Otherwise if safe, the MOV should be removed by
> copy-propagation or register coalescing.
> ---
>  src/mesa/drivers/dri/i965/brw_fs_visitor.cpp   | 4 ++--
>  src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
>

This patch is:

Reviewed-by: Paul Berry <stereoytpe441 at gmail.com>


>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> index ee7728c..fa4554b 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> @@ -361,12 +361,12 @@ fs_visitor::visit(ir_expression *ir)
>        break;
>     case ir_unop_neg:
>        op[0].negate = !op[0].negate;
> -      this->result = op[0];
> +      emit(MOV(this->result, op[0]));
>        break;
>     case ir_unop_abs:
>        op[0].abs = true;
>        op[0].negate = false;
> -      this->result = op[0];
> +      emit(MOV(this->result, op[0]));
>        break;
>     case ir_unop_sign:
>        temp = fs_reg(this, ir->type);
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> index 8d4a5d4..05c0091 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> @@ -1391,12 +1391,12 @@ vec4_visitor::visit(ir_expression *ir)
>        break;
>     case ir_unop_neg:
>        op[0].negate = !op[0].negate;
> -      this->result = op[0];
> +      emit(MOV(result_dst, op[0]));
>        break;
>     case ir_unop_abs:
>        op[0].abs = true;
>        op[0].negate = false;
> -      this->result = op[0];
> +      emit(MOV(result_dst, op[0]));
>        break;
>
>     case ir_unop_sign:
> --
> 1.8.3.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130815/d7f74862/attachment.html>


More information about the mesa-dev mailing list