Mesa (master): vc4: Allow unpack_8[abcd]_f's src to stay in r4.

Eric Anholt anholt at kemper.freedesktop.org
Fri Aug 21 06:43:51 UTC 2015


Module: Mesa
Branch: master
Commit: c800fef2e2c65f7d81215cb316de6f73b15ba6c5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c800fef2e2c65f7d81215cb316de6f73b15ba6c5

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Aug 18 22:07:47 2015 -0700

vc4: Allow unpack_8[abcd]_f's src to stay in r4.

I had QPU emit code to do it, but forgot to flag the register class.

total instructions in shared programs: 97974 -> 97590 (-0.39%)
instructions in affected programs:     25291 -> 24907 (-1.52%)

---

 src/gallium/drivers/vc4/vc4_register_allocate.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/vc4/vc4_register_allocate.c b/src/gallium/drivers/vc4/vc4_register_allocate.c
index 58d812b..9301314 100644
--- a/src/gallium/drivers/vc4/vc4_register_allocate.c
+++ b/src/gallium/drivers/vc4/vc4_register_allocate.c
@@ -279,7 +279,21 @@ vc4_register_allocate(struct vc4_context *vc4, struct vc4_compile *c)
                 }
 
                 if (qir_src_needs_a_file(inst)) {
-                        class_bits[inst->src[0].index] &= CLASS_BIT_A;
+                        switch (inst->op) {
+                        case QOP_UNPACK_8A_F:
+                        case QOP_UNPACK_8B_F:
+                        case QOP_UNPACK_8C_F:
+                        case QOP_UNPACK_8D_F:
+                                /* Special case: these can be done as R4
+                                 * unpacks, as well.
+                                 */
+                                class_bits[inst->src[0].index] &= (CLASS_BIT_A |
+                                                                   CLASS_BIT_R4);
+                                break;
+                        default:
+                                class_bits[inst->src[0].index] &= CLASS_BIT_A;
+                                break;
+                        }
                 }
                 ip++;
         }




More information about the mesa-commit mailing list