[Mesa-dev] [PATCH 8/8] i965/fs: Relax type check in cmod propagation.

Jason Ekstrand jason at jlekstrand.net
Thu Mar 26 13:35:29 PDT 2015


On Thu, Mar 26, 2015 at 12:27 PM, Matt Turner <mattst88 at gmail.com> wrote:
> The thing we want to avoid is int/float comparisons, but int/unsigned
> comparisons with 0 are equivalent.
>
> total instructions in shared programs: 6194829 -> 6193996 (-0.01%)
> instructions in affected programs:     117192 -> 116359 (-0.71%)
> helped:                                471
> ---
>  src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp
> index 798fef3..469f2ea 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp
> @@ -111,7 +111,9 @@ opt_cmod_propagation_local(bblock_t *block)
>                 break;
>
>              /* Comparisons operate differently for ints and floats */
> -            if (scan_inst->dst.type != inst->dst.type)
> +            if (scan_inst->dst.type != inst->dst.type &&
> +                (scan_inst->dst.type == BRW_REGISTER_TYPE_F ||
> +                 inst->dst.type == BRW_REGISTER_TYPE_F))

What about other datatypes such as D or UW?  Perhaps we should have
some sort of is_integer function and just do is_integer(a) !=
is_integer(b)?

>                 break;
>
>              /* If the instruction generating inst's source also wrote the
> --
> 2.0.5
>
> _______________________________________________
> 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