r600/sfn: Add algebraic lowering for fsin and fcos

* fsin and fcos require normalization of the input
* bitfield_insert requires an additional shift of the insert value

v2: drop bitfield_insert lowering code, it is already avaibable as
    compiler option (Rhys Perry)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9452>
This commit is contained in:
Gert Wollny
2021-03-06 16:10:55 +01:00
parent 318701b803
commit 195952786b
8 changed files with 81 additions and 118 deletions

View File

@@ -878,6 +878,7 @@ int r600_shader_from_nir(struct r600_context *rctx,
NIR_PASS_V(sel->nir, nir_lower_idiv,
sel->nir->info.stage == MESA_SHADER_COMPUTE ?
nir_lower_idiv_precise : nir_lower_idiv_fast);
NIR_PASS_V(sel->nir, r600_lower_alu);
NIR_PASS_V(sel->nir, nir_lower_phis_to_scalar);
if (lower_64bit)