mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 13:50:09 +01:00
nir: use copysign for atan
this does two things: * ignores sign of negative numbers which let us play fast and loose later in th series * avoids an expensive fsign instruction in favour of a cheap bitwise op 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
95215a094a
commit
87b99d5797
1 changed files with 1 additions and 1 deletions
|
|
@ -208,7 +208,7 @@ nir_atan(nir_builder *b, nir_def *y_over_x)
|
|||
tmp);
|
||||
|
||||
/* sign fixup */
|
||||
nir_def *result = nir_fmul(b, tmp, nir_fsign(b, y_over_x));
|
||||
nir_def *result = nir_copysign(b, tmp, y_over_x);
|
||||
|
||||
/* The fmin and fmax above will filter out NaN values. This leads to
|
||||
* non-NaN results for NaN inputs. Work around this by doing
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue