summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_program.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-08-05 20:31:21 -0700
committerEric Anholt <[email protected]>2015-08-20 23:42:17 -0700
commit69ef08d303cdf153fe2432a7e40faccae5d62aab (patch)
tree6db242c592c95c9e25c28dddefc19fc5e41fc3e6 /src/gallium/drivers/vc4/vc4_program.c
parent0bba4fa070583f5fd8a0f7208fbfa181dc25e71b (diff)
vc4: Make the pack-to-unorm instructions be non-SSA.
This helps ensure that the register allocator doesn't force the later pack operations to insert extra MOVs. total instructions in shared programs: 98170 -> 98159 (-0.01%) instructions in affected programs: 2134 -> 2123 (-0.52%)
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_program.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 13c472152d8..303132f3a3b 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -839,14 +839,13 @@ ntq_emit_alu(struct vc4_compile *c, nir_alu_instr *instr)
}
if (instr->op == nir_op_pack_unorm_4x8) {
- struct qreg result;
+ struct qreg result = qir_get_temp(c);
+
for (int i = 0; i < 4; i++) {
- struct qreg src = ntq_get_src(c, instr->src[0].src,
- instr->src[0].swizzle[i]);
- if (i == 0)
- result = qir_PACK_8888_F(c, src);
- else
- result = qir_PACK_8_F(c, result, src, i);
+ qir_PACK_8_F(c, result,
+ ntq_get_src(c, instr->src[0].src,
+ instr->src[0].swizzle[i]),
+ i);
}
struct qreg *dest = ntq_get_dest(c, &instr->dest.dest);
*dest = result;