v3d: Switch to using the new SFU instructions on V3D 4.x.
authorEric Anholt <eric@anholt.net>
Fri, 20 Jul 2018 20:06:50 +0000 (13:06 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 23 Jul 2018 17:21:43 +0000 (10:21 -0700)
commite7ae9003415cdb52c345bc1a9bd5fa71f0240dda
treeaf5eab545d75d9da0ca3118bebd49a36216db03a
parent58c1d3860fefc16878670f1d25dc8187a81cb01b
v3d: Switch to using the new SFU instructions on V3D 4.x.

These instructions let us write directly to the phys regfile, instead of
just R4.  That lets us avoid moving out of R4 to avoid conflicting with
other SFU results, and to avoid conflicting with thread switches.

There is still an extra instruction of latency, which is not represented
in the scheduler at the moment.  If you use the result before it's ready,
the QPU will just stall, unlike the magic R4 mode where you'd read the
previous value.  That means that the following shader-db results aren't
quite representative (since we now cause some stalls instead of emitting
nops), but they're impressive enough that I'm happy with the change.

total instructions in shared programs: 95669 -> 91275 (-4.59%)
instructions in affected programs:     82590 -> 78196 (-5.32%)
src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/qpu_schedule.c
src/broadcom/compiler/v3d_compiler.h
src/broadcom/compiler/vir.c
src/broadcom/compiler/vir_opt_dead_code.c
src/broadcom/compiler/vir_register_allocate.c
src/broadcom/qpu/qpu_instr.c
src/broadcom/qpu/qpu_instr.h