v3d: Kill off vir_PF(), which is hard to use right.
authorEric Anholt <eric@anholt.net>
Wed, 13 Feb 2019 20:09:02 +0000 (12:09 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 19 Feb 2019 02:09:06 +0000 (18:09 -0800)
commit3022b4bd82c1f142aa0bfbe754e771f0fa0f26e6
tree4e44ec623610d2af3525024698b75484b90f8bfc
parent6186a8d44e954c35b32cd9628bb2de7e4ab271a8
v3d: Kill off vir_PF(), which is hard to use right.

You were allowed to pass in any old temp so that you could hopefully fold
the PF up into the def of the temp.  If we couldn't find one, it
implicitly generated a MOV(nop, reg).  However, that PF could have
different behavior depending on whether the def being folded into was a
float or int opcode, which the caller doesn't necessarily control.

Due to the fragility of the function, just switch all callers over to
vir_set_pf().  This also encourages the callers to use a _dest call for
the inst they're putting the PF on, eliminating a bunch of temps in the
pre-optimization VIR.

shader-db says the change is in the noise:

total instructions in shared programs: 6226247 -> 6227184 (0.02%)
instructions in affected programs: 851068 -> 852005 (0.11%)
src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/v3d_compiler.h
src/broadcom/compiler/vir.c