nir: negate an expression in atan

we're going to fix up the sign immediately anyway.

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:
Alyssa Rosenzweig 2024-08-29 19:23:32 -04:00 committed by Marge Bot
parent 5318b8868b
commit 47e7cd268c

View file

@ -203,7 +203,7 @@ nir_atan(nir_builder *b, nir_def *y_over_x)
/* range-reduction fixup */ /* range-reduction fixup */
tmp = nir_bcsel(b, nir_flt(b, one, abs_y_over_x), tmp = nir_bcsel(b, nir_flt(b, one, abs_y_over_x),
nir_fsub_imm(b, M_PI_2, tmp), tmp); nir_fadd_imm(b, tmp, -M_PI_2), tmp);
/* sign fixup */ /* sign fixup */
nir_def *result = nir_copysign(b, tmp, y_over_x); nir_def *result = nir_copysign(b, tmp, y_over_x);