summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-12-10 22:02:30 -0800
committerEric Anholt <eric@anholt.net>2015-12-11 17:04:11 -0800
commit1df00e17d35a00f2d9ebf66f988426034aabf8b6 (patch)
tree4230c7f460d464bdf3918c0d75978916b8db2654
parentad3df9d168a589052ec8d501d590ba521fb4ef98 (diff)
vc4: When doing algebraic optimization into a MOV, use the right MOV.
If there were src unpacks, changing to the integer MOV instead of float (for example) would change the unpack operation. (cherry picked from commit e3efc4b02334897e0103f8cf926f376159ca1293)
-rw-r--r--src/gallium/drivers/vc4/vc4_opt_algebraic.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_opt_algebraic.c b/src/gallium/drivers/vc4/vc4_opt_algebraic.c
index f2e1938f474..207686b4af7 100644
--- a/src/gallium/drivers/vc4/vc4_opt_algebraic.c
+++ b/src/gallium/drivers/vc4/vc4_opt_algebraic.c
@@ -94,7 +94,12 @@ static void
replace_with_mov(struct vc4_compile *c, struct qinst *inst, struct qreg arg)
{
dump_from(c, inst);
- inst->op = QOP_MOV;
+ if (qir_is_mul(inst))
+ inst->op = QOP_MMOV;
+ else if (qir_is_float_input(inst))
+ inst->op = QOP_FMOV;
+ else
+ inst->op = QOP_MOV;
inst->src[0] = arg;
inst->src[1] = c->undef;
dump_to(c, inst);