Mesa (master): vc4: Drop some confused code about pack/unpack handling.

Eric Anholt anholt at kemper.freedesktop.org
Mon Oct 26 23:52:25 UTC 2015


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Oct 26 13:22:18 2015 -0700

vc4: Drop some confused code about pack/unpack handling.

At one point I thought packs and unpacks were in the same field of the
instruction.  They aren't.  These instructions therefore never cause a
pack.

total instructions in shared programs: 89472 -> 89390 (-0.09%)
instructions in affected programs:     15261 -> 15179 (-0.54%)

---

 src/gallium/drivers/vc4/vc4_qpu_emit.c |   27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_qpu_emit.c b/src/gallium/drivers/vc4/vc4_qpu_emit.c
index 21db367..94fd187 100644
--- a/src/gallium/drivers/vc4/vc4_qpu_emit.c
+++ b/src/gallium/drivers/vc4/vc4_qpu_emit.c
@@ -431,7 +431,7 @@ vc4_generate_code(struct vc4_context *vc4, struct vc4_compile *c)
                 case QOP_UNPACK_8C_F:
                 case QOP_UNPACK_8D_F:
                 case QOP_UNPACK_16A_F:
-                case QOP_UNPACK_16B_F: {
+                case QOP_UNPACK_16B_F:
                         if (src[0].mux == QPU_MUX_R4) {
                                 queue(c, qpu_a_MOV(dst, src[0]));
                                 *last_inst(c) |= QPU_PM;
@@ -442,22 +442,12 @@ vc4_generate_code(struct vc4_context *vc4, struct vc4_compile *c)
                         } else {
                                 assert(src[0].mux == QPU_MUX_A);
 
-                                /* Since we're setting the pack bits, if the
-                                 * destination is in A it would get re-packed.
-                                 */
-                                queue(c, qpu_a_FMAX((dst.mux == QPU_MUX_A ?
-                                                     qpu_rb(31) : dst),
-                                                    src[0], src[0]));
+                                queue(c, qpu_a_FMAX(dst, src[0], src[0]));
                                 *last_inst(c) |=
                                         QPU_SET_FIELD(unpack_map[qinst->op -
                                                                  QOP_UNPACK_8A_F],
                                                       QPU_UNPACK);
-
-                                if (dst.mux == QPU_MUX_A) {
-                                        queue(c, qpu_a_MOV(dst, qpu_rb(31)));
-                                }
                         }
-                }
                         break;
 
                 case QOP_UNPACK_8A_I:
@@ -465,22 +455,13 @@ vc4_generate_code(struct vc4_context *vc4, struct vc4_compile *c)
                 case QOP_UNPACK_8C_I:
                 case QOP_UNPACK_8D_I:
                 case QOP_UNPACK_16A_I:
-                case QOP_UNPACK_16B_I: {
+                case QOP_UNPACK_16B_I:
                         assert(src[0].mux == QPU_MUX_A);
 
-                        /* Since we're setting the pack bits, if the
-                         * destination is in A it would get re-packed.
-                         */
-                        queue(c, qpu_a_MOV((dst.mux == QPU_MUX_A ?
-                                            qpu_rb(31) : dst), src[0]));
+                        queue(c, qpu_a_MOV(dst, src[0]));
                         *last_inst(c) |= QPU_SET_FIELD(unpack_map[qinst->op -
                                                                   QOP_UNPACK_8A_I],
                                                        QPU_UNPACK);
-
-                        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