From: Wilco Dijkstra Date: Wed, 1 Dec 2021 14:08:14 +0000 (-0300) Subject: math: Use fmin/fmax on hypot X-Git-Tag: glibc-2.35~253 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f44eef584a4c9650ce772258dedde902c00dae2;p=thirdparty%2Fglibc.git math: Use fmin/fmax on hypot It optimizes for architectures that provides fast builtins. Checked on aarch64-linux-gnu. --- diff --git a/sysdeps/ieee754/dbl-64/e_hypot.c b/sysdeps/ieee754/dbl-64/e_hypot.c index 6fedf0d61f8..0bdab989e47 100644 --- a/sysdeps/ieee754/dbl-64/e_hypot.c +++ b/sysdeps/ieee754/dbl-64/e_hypot.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #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))