summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_opt_algebraic.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-12-10 15:37:07 -0800
committerEric Anholt <[email protected]>2014-12-17 19:05:52 -0800
commitff266483fb61fd69775daf5c931ca7a56a26f4ac (patch)
treeb09828e0ccc30076d21f0461af574becf1744f6d /src/gallium/drivers/vc4/vc4_opt_algebraic.c
parent8d22e8907fde509ad33c5699cd14cd1bebc3601d (diff)
vc4: Move follow_movs() to common QIR code.
I want this from other passes.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_opt_algebraic.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_opt_algebraic.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/gallium/drivers/vc4/vc4_opt_algebraic.c b/src/gallium/drivers/vc4/vc4_opt_algebraic.c
index ec526fb3d18..4376c7ba08f 100644
--- a/src/gallium/drivers/vc4/vc4_opt_algebraic.c
+++ b/src/gallium/drivers/vc4/vc4_opt_algebraic.c
@@ -59,19 +59,10 @@ dump_to(struct vc4_compile *c, struct qinst *inst)
fprintf(stderr, "\n");
}
-static struct qreg
-follow_movs(struct qinst **defs, struct qreg reg)
-{
- while (reg.file == QFILE_TEMP && defs[reg.index]->op == QOP_MOV)
- reg = defs[reg.index]->src[0];
-
- return reg;
-}
-
static bool
is_zero(struct vc4_compile *c, struct qinst **defs, struct qreg reg)
{
- reg = follow_movs(defs, reg);
+ reg = qir_follow_movs(defs, reg);
return (reg.file == QFILE_UNIF &&
c->uniform_contents[reg.index] == QUNIFORM_CONSTANT &&
@@ -81,7 +72,7 @@ is_zero(struct vc4_compile *c, struct qinst **defs, struct qreg reg)
static bool
is_1f(struct vc4_compile *c, struct qinst **defs, struct qreg reg)
{
- reg = follow_movs(defs, reg);
+ reg = qir_follow_movs(defs, reg);
return (reg.file == QFILE_UNIF &&
c->uniform_contents[reg.index] == QUNIFORM_CONSTANT &&