[Mesa-dev] [PATCH 2/2] i965: run brw_vec4 optimizations in loop
Matt Turner
mattst88 at gmail.com
Mon Nov 30 09:36:07 PST 2015
On Thu, Nov 26, 2015 at 7:57 AM, Juan A. Suarez Romero
<jasuarez at igalia.com> wrote:
> On Wed, 2015-11-25 at 16:16 -0800, Matt Turner wrote:
>> In the piglit test you cited, opt_vector_float() does this to the
>> relevant code:
>>
>> cmp.nz.f0.0 null:F, vgrf6.xyzz:F, vgrf14.xyzz:F
>> -mov vgrf2.0.x:D, 0D
>> (+f0.0.any4h) mov vgrf2.0.x:D, -1D
>> -mov vgrf2.0.yzw:D, 0D
>> +mov vgrf2.0:F, [0F, 0F, 0F, 0F]
>> cmp.nz.f0.0 null:D, vgrf2.xyzw:D, 0D
>>
>
>
> Now that you point to this change, is it correct?
>
> Before the change, vgrf2.0.x is initialized to 0, and if the previous
> cmp success then assigned -1.
>
>
> But after the change, the value is initialized to 0 *after* the
> conditional check, so it ends up always with 0 (-1D is never assigned).
>
> So seems opt_vector_float() is doing something wrong (probably not
> checking if the component can be assigned in a conditional).
>
> Am I missing something?
I believe you're exactly right.
I suspect we should reset last_reg to -1 in opt_vector_float() if we
see a read of last_reg.
More information about the mesa-dev
mailing list