diff options
author | Eric Anholt <[email protected]> | 2018-07-20 13:06:50 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2018-07-23 10:21:43 -0700 |
commit | e7ae9003415cdb52c345bc1a9bd5fa71f0240dda (patch) | |
tree | af5eab545d75d9da0ca3118bebd49a36216db03a /src/broadcom/compiler/vir_register_allocate.c | |
parent | 58c1d3860fefc16878670f1d25dc8187a81cb01b (diff) |
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%)
Diffstat (limited to 'src/broadcom/compiler/vir_register_allocate.c')
-rw-r--r-- | src/broadcom/compiler/vir_register_allocate.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/broadcom/compiler/vir_register_allocate.c b/src/broadcom/compiler/vir_register_allocate.c index aa5e2139c1b..5a856acd7ed 100644 --- a/src/broadcom/compiler/vir_register_allocate.c +++ b/src/broadcom/compiler/vir_register_allocate.c @@ -445,6 +445,19 @@ v3d_register_allocate(struct v3d_compile *c, bool *spilled) class_bits[inst->dst.index] &= CLASS_BIT_PHYS; break; + case V3D_QPU_A_RECIP: + case V3D_QPU_A_RSQRT: + case V3D_QPU_A_EXP: + case V3D_QPU_A_LOG: + case V3D_QPU_A_SIN: + case V3D_QPU_A_RSQRT2: + /* The SFU instructions write directly to the + * phys regfile. + */ + assert(inst->dst.file == QFILE_TEMP); + class_bits[inst->dst.index] &= CLASS_BIT_PHYS; + break; + default: break; } |