glsl: Drop the div-to-mul-rcp lowering for floats.

NIR has fdiv, and all the NIR backends have to have lower_fdiv set
appropriately already since various passes (format conversions,
tgsi_to_nir, nir_fast_normalize(), etc.) might generate one.

This causes softpipe and llvmpipe to now do actual divides, since
lower_fdiv is not set there.  Note that llvmpipe's rcp implementation is a
divide of 1.0 by x, so now we're going to be just doing div(x, y) instead
of mul(x, div(1.0, y)).

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823>
This commit is contained in:
Emma Anholt
2022-05-31 13:48:17 -07:00
committed by Marge Bot
parent 594d3982f7
commit 464b32c030
9 changed files with 37 additions and 76 deletions

View File

@@ -1897,7 +1897,7 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
break;
case nir_op_fdiv:
unreachable("not reached: should be lowered by DIV_TO_MUL_RCP in the compiler");
unreachable("not reached: should be lowered by lower_fdiv in the compiler");
case nir_op_fmod:
unreachable("not reached: should be lowered by lower_fmod in the compiler");