summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-04-13 14:12:59 -0700
committerEric Anholt <[email protected]>2015-04-13 21:36:40 -0700
commit7fa2f2e36660afe9f50f652baa6d65903d3a9dea (patch)
treeba5ba8066ac3d34bb1d53f42ed84990ffd4f5696 /src/gallium/drivers
parent84ebaff1b7f78cb47cd8eed5476f03c5c3d0e14b (diff)
vc4: Use NIR-level lowering for idiv.
This fixes the idiv tests in piglit.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index ca2e81c3900..ec649c9c43b 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -311,14 +311,6 @@ ntq_umul(struct vc4_compile *c, struct qreg src0, struct qreg src1)
qir_uniform_ui(c, 24)));
}
-static struct qreg
-ntq_idiv(struct vc4_compile *c, struct qreg src0, struct qreg src1)
-{
- return qir_FTOI(c, qir_FMUL(c,
- qir_ITOF(c, src0),
- qir_RCP(c, qir_ITOF(c, src1))));
-}
-
static void
ntq_emit_tex(struct vc4_compile *c, nir_tex_instr *instr)
{
@@ -983,9 +975,6 @@ ntq_emit_alu(struct vc4_compile *c, nir_alu_instr *instr)
case nir_op_imul:
*dest = ntq_umul(c, src[0], src[1]);
break;
- case nir_op_idiv:
- *dest = ntq_idiv(c, src[0], src[1]);
- break;
case nir_op_seq:
qir_SF(c, qir_FSUB(c, src[0], src[1]));
@@ -2096,6 +2085,7 @@ vc4_shader_ntq(struct vc4_context *vc4, enum qstage stage,
c->s = tgsi_to_nir(tokens, &nir_options);
nir_opt_global_to_local(c->s);
nir_convert_to_ssa(c->s);
+ nir_lower_idiv(c->s);
vc4_optimize_nir(c->s);