public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/hypot-refactor] math: Use fmin/fmax on hypot
@ 2021-12-06 17:59 Adhemerval Zanella
  0 siblings, 0 replies; 3+ messages in thread
From: Adhemerval Zanella @ 2021-12-06 17:59 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0b4dc7144851848096abc893ee001048bc09853c

commit 0b4dc7144851848096abc893ee001048bc09853c
Author: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Date:   Wed Dec 1 11:08:14 2021 -0300

    math: Use fmin/fmax on hypot
    
    It optimizes for architectures that provides fast builtins.
    
    Checked on aarch64-linux-gnu.

Diff:
---
 sysdeps/ieee754/dbl-64/e_hypot.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sysdeps/ieee754/dbl-64/e_hypot.c b/sysdeps/ieee754/dbl-64/e_hypot.c
index 6fedf0d61f..0bdab989e4 100644
--- a/sysdeps/ieee754/dbl-64/e_hypot.c
+++ b/sysdeps/ieee754/dbl-64/e_hypot.c
@@ -38,6 +38,7 @@
 #include <math_private.h>
 #include <math-underflow.h>
 #include <math-narrow-eval.h>
+#include <math-use-builtins.h>
 #include <libm-alias-finite.h>
 #include "math_config.h"
 
@@ -95,8 +96,8 @@ __ieee754_hypot (double x, double y)
   x = fabs (x);
   y = fabs (y);
 
-  double ax = x < y ? y : x;
-  double ay = x < y ? x : y;
+  double ax = USE_FMAX_BUILTIN ? fmax (x, y) : (x < y ? y : x);
+  double ay = USE_FMIN_BUILTIN ? fmin (x, y) : (x < y ? x : y);
 
   /* If ax is huge, scale both inputs down.  */
   if (__glibc_unlikely (ax > LARGE_VAL))


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/azanella/hypot-refactor] math: Use fmin/fmax on hypot
@ 2021-12-01 17:10 Adhemerval Zanella
  0 siblings, 0 replies; 3+ messages in thread
From: Adhemerval Zanella @ 2021-12-01 17:10 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e6bca7374f00b3631d4ef7cee3d9b71e4b38b8c0

commit e6bca7374f00b3631d4ef7cee3d9b71e4b38b8c0
Author: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Date:   Wed Dec 1 11:08:14 2021 -0300

    math: Use fmin/fmax on hypot
    
    It optimizes for architectures that provides fast builtins.
    
    Checked on aarch64-linux-gnu.

Diff:
---
 sysdeps/ieee754/dbl-64/e_hypot.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sysdeps/ieee754/dbl-64/e_hypot.c b/sysdeps/ieee754/dbl-64/e_hypot.c
index 5f438e4348..244d9caccc 100644
--- a/sysdeps/ieee754/dbl-64/e_hypot.c
+++ b/sysdeps/ieee754/dbl-64/e_hypot.c
@@ -38,6 +38,7 @@
 #include <math_private.h>
 #include <math-underflow.h>
 #include <math-narrow-eval.h>
+#include <math-use-builtins.h>
 #include <libm-alias-finite.h>
 #include "math_config.h"
 
@@ -95,8 +96,8 @@ __ieee754_hypot (double x, double y)
   x = fabs (x);
   y = fabs (y);
 
-  double ax = x < y ? y : x;
-  double ay = x < y ? x : y;
+  double ax = USE_FMAX_BUILTIN ? fmax (x, y) : (x < y ? y : x);
+  double ay = USE_FMAX_BUILTIN ? fmin (x, y) : (x < y ? x : y);
 
   /* If ax is huge, scale both inputs down.  */
   if (__glibc_unlikely (ax > LARGE_VAL))


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/azanella/hypot-refactor] math: Use fmin/fmax on hypot
@ 2021-12-01 16:46 Adhemerval Zanella
  0 siblings, 0 replies; 3+ messages in thread
From: Adhemerval Zanella @ 2021-12-01 16:46 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a6dc44dd94de0403a3593470435598ae5149ade3

commit a6dc44dd94de0403a3593470435598ae5149ade3
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Dec 1 11:08:14 2021 -0300

    math: Use fmin/fmax on hypot
    
    It optimizes for architectures that provides fast builtins.
    
    Checked on aarch64-linux-gnu.

Diff:
---
 sysdeps/ieee754/dbl-64/e_hypot.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sysdeps/ieee754/dbl-64/e_hypot.c b/sysdeps/ieee754/dbl-64/e_hypot.c
index 5f438e4348..244d9caccc 100644
--- a/sysdeps/ieee754/dbl-64/e_hypot.c
+++ b/sysdeps/ieee754/dbl-64/e_hypot.c
@@ -38,6 +38,7 @@
 #include <math_private.h>
 #include <math-underflow.h>
 #include <math-narrow-eval.h>
+#include <math-use-builtins.h>
 #include <libm-alias-finite.h>
 #include "math_config.h"
 
@@ -95,8 +96,8 @@ __ieee754_hypot (double x, double y)
   x = fabs (x);
   y = fabs (y);
 
-  double ax = x < y ? y : x;
-  double ay = x < y ? x : y;
+  double ax = USE_FMAX_BUILTIN ? fmax (x, y) : (x < y ? y : x);
+  double ay = USE_FMAX_BUILTIN ? fmin (x, y) : (x < y ? x : y);
 
   /* If ax is huge, scale both inputs down.  */
   if (__glibc_unlikely (ax > LARGE_VAL))


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-06 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 17:59 [glibc/azanella/hypot-refactor] math: Use fmin/fmax on hypot Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2021-12-01 17:10 Adhemerval Zanella
2021-12-01 16:46 Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).