[Mesa-dev] [PATCH 08/23] i965/fs: Add support for specifying register horizontal strides.

Francisco Jerez currojerez at riseup.net
Thu Dec 19 14:52:37 PST 2013


Paul Berry <stereotype441 at gmail.com> writes:

>[...]
> In v2 of this patch, you add the following code to
> fs_visitor::try_copy_propagate():
>
> +   /* Bail if the result of composing both strides cannot be expressed
> +    * as another stride.
> +    */
> +   if (entry->src.stride != 1 &&
> +       (inst->src[arg].stride *
> +        type_sz(inst->src[arg].type)) % type_sz(entry->src.type) != 0)
>        return false;
>
> I don't understand.  It seems like this is trying to make sure that
> (src_stride * src_type_sz) / entry_type_sz is an integer so we can later
> use the factor (src_type_sz / entry_type_sz) as a multiplicative factor to
> correct the stride without creating a fractional result.  But I don't see
> us applying this correction factor anywhere.  Is there some code missing?

That isn't exactly the purpose of that check.

The problem arises when you are trying to compose two regions of
different base types.  If the stride in bytes of 'inst->src[arg]' is not
a multiple of the element size of 'entry->src' you end up with an
inhomogeneous stride that can only be expressed as a two-dimensional
region.  Instead of adding support for two-dimensional regions (which
would be hard, not very useful, and only a partial solution because then
we would need to handle composition of two-dimensional regions that
yield three- and four-dimensional regions as a result) I disallowed
copy-propagation in that case.

Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131219/b8b828be/attachment.pgp>


More information about the mesa-dev mailing list