mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
nir/lower_idiv: Inline convert_instr_precise
Now that we only have one convert_instr path, this is simpler. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19303>
This commit is contained in:
parent
941c37c085
commit
63320c691a
1 changed files with 3 additions and 11 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue