From: Eric Anholt Date: Mon, 13 Apr 2015 21:12:59 +0000 (-0700) Subject: vc4: Use NIR-level lowering for idiv. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7fa2f2e36660afe9f50f652baa6d65903d3a9dea;p=mesa.git vc4: Use NIR-level lowering for idiv. This fixes the idiv tests in piglit. --- 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);