[Mesa-dev] [PATCH 6/6] i965/vec4: Optimize predicate handling for any/all.

Matt Turner mattst88 at gmail.com
Tue Dec 1 16:19:04 PST 2015


On Tue, Dec 1, 2015 at 11:07 AM, Ian Romanick <idr at freedesktop.org> wrote:
> On 11/30/2015 03:32 PM, Matt Turner wrote:
>> For a select whose condition is any(v), instead of emitting
>>
>>    cmp.nz.f0(8)    null<1>D        g1<0,4,1>D      0D
>>    mov(8)          g7<1>.xUD       0x00000000UD
>>    (+f0.any4h) mov(8) g7<1>.xUD    0xffffffffUD
>>    cmp.nz.f0(8)    null<1>D        g7<4,4,1>.xD    0D
>>    (+f0) sel(8)    g8<1>UD         g4<4,4,1>UD     g3<4,4,1>UD
>>
>> we now emit
>>
>>    cmp.nz.f0(8)    null<1>D        g1<0,4,1>D      0D
>>    (+f0.any4h) sel(8) g9<1>UD      g4<4,4,1>UD     g3<4,4,1>UD
>
> Any shaderdb changes?  Don't be a tease!

Heh. Disappointingly no :(

No vertex shaders we've collected use any() or all().

The good news is that running shader-db to confirm that result found
two problems :)

The first was caused by a mistake (I'll claim innocence and call it a
typo ;) in 5/6, and the second is fixed by the patch I just sent
("nir: Optimize useless comparisons against true/false.")

The other good news is that this ::optimize_predicate idea will extend
well for the ARB_shader_group_vote predicates.

Thanks for reviewing, Ian!


More information about the mesa-dev mailing list