Mesa (main): nir: swap fadd operands in nir_atan()
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 16 18:05:35 UTC 2021
Module: Mesa
Branch: main
Commit: 82d0600ba21f6bf308af019a9868d1a1ae51fb56
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=82d0600ba21f6bf308af019a9868d1a1ae51fb56
Author: Rhys Perry <pendingchaos02 at gmail.com>
Date: Wed Jun 17 11:53:13 2020 +0100
nir: swap fadd operands in nir_atan()
This shouldn't do anything but will make testing a later patch easier.
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8056>
---
src/compiler/nir/nir_builtin_builder.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/compiler/nir/nir_builtin_builder.c b/src/compiler/nir/nir_builtin_builder.c
index 7118e1102ba..602d752582c 100644
--- a/src/compiler/nir/nir_builtin_builder.c
+++ b/src/compiler/nir/nir_builtin_builder.c
@@ -226,9 +226,10 @@ nir_atan(nir_builder *b, nir_ssa_def *y_over_x)
build_fsum(b, polynomial_terms, ARRAY_SIZE(polynomial_terms));
/* range-reduction fixup */
- tmp = nir_fadd(b, tmp,
+ tmp = nir_fadd(b,
nir_fmul(b, nir_b2f(b, nir_flt(b, one, abs_y_over_x), bit_size),
- nir_fadd_imm(b, nir_fmul_imm(b, tmp, -2.0f), M_PI_2)));
+ nir_fadd_imm(b, nir_fmul_imm(b, tmp, -2.0f), M_PI_2)),
+ tmp);
/* sign fixup */
return nir_fmul(b, tmp, nir_fsign(b, y_over_x));
More information about the mesa-commit
mailing list