[Mesa-dev] [PATCH 1/2] i965/fs: Don't use backend_visitor::instructions after creating the CFG.

Matt Turner mattst88 at gmail.com
Fri Jan 16 23:55:33 PST 2015


On Fri, Jan 16, 2015 at 11:45 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> On Tuesday, January 13, 2015 03:35:57 PM Matt Turner wrote:
>> This is a fix for a regression introduced in commit a9f8296d ("i965/fs:
>> Preserve the CFG in a few more places.").
>>
>> The errata this code works around is described in a comment before the function:
>>
>>    "[DevBW, DevCL] Errata: A destination register from a send can not be
>>     used as a destination register until after it has been sourced by an
>>     instruction with a different destination register.
>>
>> The framebuffer write's sources must be in message registers, which SEND
>> instructions cannot have as a destination. There's no way for this
>> errata to affect anything at the end of the program. Just remove the
>> code.
>
> I don't think that's the point.  The idea is that code such as
>
>    SEND g10  ...sources... rlen 4
>    MUL  g10  ... ...
>
> needs a workaround - you can't write to the destination of a SEND safely
> without reading them first.  You'd have to do:
>
>    SEND g10  ...sources... rlen 4
>    MOV  null g10           pointless read of g10, any instruction will do
>    MUL  g10  ...
>
> Normally, the results of SEND instructions are actually used.  However, they
> aren't always - for example, depth texturing returns 4 values, but we only
> care about the .X channel.

Right, and we throw up our hands and resolve all remaining
dependencies when we see the end of the basic block because there's a
subsequent basic block that may write the destination.

At the end of the program though... we can't possibly need to resolve
anything outstanding because we can't possibly overwrite it. Can we?


More information about the mesa-dev mailing list