Samuel Iglesias Gonsálvez <sigles...@igalia.com> writes:

> Now the VEC4_OPCODE_FROM_DOUBLE's destination data is written with
> stride 2. We need to take into account this when doing the split
> so we don't overwrite data.
>

You should probably fix the destination type of your
VEC4_OPCODE_FROM_DOUBLE instructions in PATCH 17 instead so you don't
need to special-case VEC4_OPCODE_FROM_DOUBLE in this lowering pass.

> Signed-off-by: Samuel Iglesias Gonsálvez <sigles...@igalia.com>
> ---
>  src/intel/compiler/brw_vec4.cpp | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/compiler/brw_vec4.cpp b/src/intel/compiler/brw_vec4.cpp
> index b26f8035811..f4eea954404 100644
> --- a/src/intel/compiler/brw_vec4.cpp
> +++ b/src/intel/compiler/brw_vec4.cpp
> @@ -2198,6 +2198,7 @@ vec4_visitor::lower_simd_width()
>           linst->group = channel_offset;
>           linst->size_written = size_written;
>  
> +         bool d2f_pass = (inst->opcode == VEC4_OPCODE_FROM_DOUBLE && n > 0);
>           /* Compute split dst region */
>           dst_reg dst;
>           if (needs_temp) {
> @@ -2212,7 +2213,11 @@ vec4_visitor::lower_simd_width()
>                 inst->insert_before(block, copy);
>              }
>           } else {
> -            dst = horiz_offset(inst->dst, channel_offset);
> +            /* d2x conversion is done with a destination's stride of 2. We 
> need
> +             * to take into account when splitting it.
> +             */
> +            unsigned stride = d2f_pass ? 2 : 1;
> +            dst = horiz_offset(inst->dst, stride * channel_offset);
>           }
>           linst->dst = dst;
>  
> -- 
> 2.11.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to