From 63320c691ae2b1637b69d7aee0fe386d05bc013c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 25 Oct 2022 12:54:32 -0400 Subject: [PATCH] nir/lower_idiv: Inline convert_instr_precise Now that we only have one convert_instr path, this is simpler. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Emma Anholt Reviewed-by: Christian Gmeiner Part-of: --- src/compiler/nir/nir_lower_idiv.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/compiler/nir/nir_lower_idiv.c b/src/compiler/nir/nir_lower_idiv.c index 3b0b99a373f..50840e0d911 100644 --- a/src/compiler/nir/nir_lower_idiv.c +++ b/src/compiler/nir/nir_lower_idiv.c @@ -90,16 +90,6 @@ emit_idiv(nir_builder *bld, nir_ssa_def *numer, nir_ssa_def *denom, nir_op op) } } -static nir_ssa_def * -convert_instr_precise(nir_builder *bld, nir_op op, - nir_ssa_def *numer, nir_ssa_def *denom) -{ - if (op == nir_op_udiv || op == nir_op_umod) - return emit_udiv(bld, numer, denom, op == nir_op_umod); - else - return emit_idiv(bld, numer, denom, op); -} - static nir_ssa_def * convert_instr_small(nir_builder *b, nir_op op, nir_ssa_def *numer, nir_ssa_def *denom, @@ -153,8 +143,10 @@ lower_idiv(nir_builder *b, nir_instr *instr, void *_data) if (numer->bit_size < 32) return convert_instr_small(b, alu->op, numer, denom, options); + else if (alu->op == nir_op_udiv || alu->op == nir_op_umod) + return emit_udiv(b, numer, denom, alu->op == nir_op_umod); else - return convert_instr_precise(b, alu->op, numer, denom); + return emit_idiv(b, numer, denom, alu->op); } static bool