mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 06:00:10 +01:00
nir: simplify atan range reduction
just implement what the comment says, don't be clever. the clever thing is worse on all architectures i'm familiar with, because the fdiv will turn into fmul+frcp. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30934>
This commit is contained in:
parent
a32b1a975d
commit
8579375777
1 changed files with 2 additions and 2 deletions
|
|
@ -174,8 +174,8 @@ nir_atan(nir_builder *b, nir_def *y_over_x)
|
|||
* x = <
|
||||
* \ 1.0 / |y_over_x| otherwise
|
||||
*/
|
||||
nir_def *x = nir_fdiv(b, nir_fmin(b, abs_y_over_x, one),
|
||||
nir_fmax(b, abs_y_over_x, one));
|
||||
nir_def *x = nir_bcsel(b, nir_fle_imm(b, abs_y_over_x, 1.0),
|
||||
abs_y_over_x, nir_frcp(b, abs_y_over_x));
|
||||
|
||||
/*
|
||||
* approximate atan by evaluating polynomial using Horner's method:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue