[Mesa-dev] [PATCH] i965/fs: Optimize LRP with x == y into a MOV.

Jordan Justen jljusten at gmail.com
Thu Jan 9 22:49:38 PST 2014


Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

On Thu, Jan 9, 2014 at 8:58 PM, Matt Turner <mattst88 at gmail.com> wrote:
> total instructions in shared programs: 1487331 -> 1485988 (-0.09%)
> instructions in affected programs:     45638 -> 44295 (-2.94%)
> GAINED:                                7
> LOST:                                  0
> ---
> No change from the equivalent vec4 change.
>
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index ee1b0c2..c2955d6 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -2000,6 +2000,16 @@ fs_visitor::opt_algebraic()
>              break;
>           }
>           break;
> +      case BRW_OPCODE_LRP:
> +         if (inst->src[1].equals(inst->src[2])) {
> +            inst->opcode = BRW_OPCODE_MOV;
> +            inst->src[0] = inst->src[1];
> +            inst->src[1] = reg_undef;
> +            inst->src[2] = reg_undef;
> +            progress = true;
> +            break;
> +         }
> +         break;
>        case BRW_OPCODE_SEL:
>           if (inst->saturate && inst->src[1].file == IMM) {
>              switch (inst->conditional_mod) {
> --
> 1.8.3.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list