v3d: Do bool-to-cond for discard_if as well.
authorEric Anholt <eric@anholt.net>
Wed, 13 Feb 2019 21:42:41 +0000 (13:42 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 19 Feb 2019 02:09:06 +0000 (18:09 -0800)
commit6186a8d44e954c35b32cd9628bb2de7e4ab271a8
tree726c16bf7f8e530506ce7693f8eed020e55c3b39
parent718eef62cb7f3379ea6c64c68d58f5fa613f08ac
v3d: Do bool-to-cond for discard_if as well.

Turns this minimal conditional discard (glsl-fs-discard-01.shader_test):

0x3de0b086c5fe9000 fcmp.pushn  -, r1, r5; mov  r2, 0
0x3dec3086bbfc001f nop                  ; mov.ifa  r2, -1
0x3c047186bbe80000 nop                  ; mov.pushz  -, r2
0x3dea3186ba837000 setmsf.ifna  -, 0    ; nop

into:

0x3c00b186c582a000 fcmp.pushn  -, r2, r5; nop
0x3de83186ba837000 setmsf.ifa  -, 0     ; nop

total instructions in shared programs: 6229820 -> 6226247 (-0.06%)
src/broadcom/compiler/nir_to_vir.c