summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_opt_algebraic.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-08-18 21:26:05 -0700
committerEric Anholt <[email protected]>2015-08-20 23:43:04 -0700
commit8b36d107fdd6f6b91556fcdc3498df16803d4181 (patch)
tree197465bb5fde7eb6081064552ce27d61785f6221 /src/gallium/drivers/vc4/vc4_opt_algebraic.c
parent572a48366d9dfac6a7f9ee8f4d29832c496125e2 (diff)
vc4: Pack the unorm-packing bits into a src MUL instruction when possible.
Now that we do non-SSA QIR instructions, we can take a NIR SSA src that's only used by the unorm packing and just stuff the pack bits into it. total instructions in shared programs: 98136 -> 97974 (-0.17%) instructions in affected programs: 4149 -> 3987 (-3.90%)
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_opt_algebraic.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_opt_algebraic.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/drivers/vc4/vc4_opt_algebraic.c b/src/gallium/drivers/vc4/vc4_opt_algebraic.c
index e8c93dedfd2..77028bc026f 100644
--- a/src/gallium/drivers/vc4/vc4_opt_algebraic.c
+++ b/src/gallium/drivers/vc4/vc4_opt_algebraic.c
@@ -229,18 +229,20 @@ qir_opt_algebraic(struct vc4_compile *c)
break;
case QOP_FMUL:
- if (replace_x_0_with_0(c, inst, 0) ||
- replace_x_0_with_0(c, inst, 1) ||
- fmul_replace_one(c, inst, 0) ||
- fmul_replace_one(c, inst, 1)) {
+ if (!inst->dst.pack &&
+ (replace_x_0_with_0(c, inst, 0) ||
+ replace_x_0_with_0(c, inst, 1) ||
+ fmul_replace_one(c, inst, 0) ||
+ fmul_replace_one(c, inst, 1))) {
progress = true;
break;
}
break;
case QOP_MUL24:
- if (replace_x_0_with_0(c, inst, 0) ||
- replace_x_0_with_0(c, inst, 1)) {
+ if (!inst->dst.pack &&
+ (replace_x_0_with_0(c, inst, 0) ||
+ replace_x_0_with_0(c, inst, 1))) {
progress = true;
break;
}