[Mesa-dev] [PATCH] nir: Make vec-to-movs handle src/dest aliasing.

Eric Anholt eric at anholt.net
Fri Jan 23 14:34:59 PST 2015


Connor Abbott <cwabbott0 at gmail.com> writes:

> Argh, nevermind, I was reading it wrong...
>
> On Thu, Jan 22, 2015 at 8:18 PM, Connor Abbott <cwabbott0 at gmail.com> wrote:
>> What happens if you have something like foo = vec3(foo.z, bar.x,
>> foo.x)? I don't think emitting vector mov's for only the contiguous
>> components is enough.
>>
>> On Thu, Jan 22, 2015 at 4:51 PM, Eric Anholt <eric at anholt.net> wrote:
>>> +static unsigned
>>> +insert_movs(nir_alu_instr *vec, unsigned start_channel,
>>> +            unsigned start_src_idx, void *mem_ctx)
>
> We need a comment explaining what this function does and what it
> returns. Also, it only creates a single move so it should be called
> insert_mov().

How about:

/**
 * For a given writemask channel in the vec instruction, insert a MOV of all
 * the src values that come from the same reg to the destination of the vec
 * instruction.
 */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150123/21442101/attachment.sig>


More information about the mesa-dev mailing list