Mesa (master): vc4: Fix use of r3 as a temp in 8-bit unpacking.

Eric Anholt anholt at kemper.freedesktop.org
Mon Dec 15 22:33:32 UTC 2014


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Dec 15 11:10:14 2014 -0800

vc4: Fix use of r3 as a temp in 8-bit unpacking.

We're actually allocating out of r3 now, and I missed it because I'd typed
this one as qpu_rn(3) instead of qpu_r3().

---

 src/gallium/drivers/vc4/vc4_qpu_emit.c |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_qpu_emit.c b/src/gallium/drivers/vc4/vc4_qpu_emit.c
index 8c58f18..8b3a001 100644
--- a/src/gallium/drivers/vc4/vc4_qpu_emit.c
+++ b/src/gallium/drivers/vc4/vc4_qpu_emit.c
@@ -471,26 +471,23 @@ vc4_generate_code(struct vc4_context *vc4, struct vc4_compile *c)
                 case QOP_UNPACK_8A_F:
                 case QOP_UNPACK_8B_F:
                 case QOP_UNPACK_8C_F:
-                case QOP_UNPACK_8D_F: {
+                case QOP_UNPACK_8D_F:
                         assert(src[0].mux == QPU_MUX_A);
 
-                        /* And, since we're setting the pack bits, if the
+                        /* Since we're setting the pack bits, if the
                          * destination is in A it would get re-packed.
                          */
-                        struct qpu_reg orig_dst = dst;
-                        if (orig_dst.mux == QPU_MUX_A)
-                                dst = qpu_rn(3);
-
-                        queue(c, qpu_a_FMAX(dst, src[0], src[0]));
+                        queue(c, qpu_a_FMAX((dst.mux == QPU_MUX_A ?
+                                             qpu_rb(31) : dst),
+                                            src[0], src[0]));
                         *last_inst(c) |= QPU_SET_FIELD(QPU_UNPACK_8A +
                                                        (qinst->op -
                                                         QOP_UNPACK_8A_F),
                                                        QPU_UNPACK);
 
-                        if (orig_dst.mux == QPU_MUX_A) {
-                                queue(c, qpu_a_MOV(orig_dst, dst));
+                        if (dst.mux == QPU_MUX_A) {
+                                queue(c, qpu_a_MOV(dst, qpu_rb(31)));
                         }
-                }
                         break;
 
                 default:




More information about the mesa-commit mailing list