about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-12-01 10:37:44 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-12-13 09:08:07 -0300
commit72ab1eaec7e46cdb6c4f37fb687a7a593f93020a (patch)
treef00e454f281e8e40eee79f2ddb81437cb97ea0f6 /math
parent2eb1cd2f47fe6568c539fa105551bb73df8368ec (diff)
downloadglibc-72ab1eaec7e46cdb6c4f37fb687a7a593f93020a.tar.gz
glibc-72ab1eaec7e46cdb6c4f37fb687a7a593f93020a.tar.xz
glibc-72ab1eaec7e46cdb6c4f37fb687a7a593f93020a.zip
math: Add math-use-builtinds-fmax.h
It allows the architecture to use the builtin instead of generic
implementation.
Diffstat (limited to 'math')
-rw-r--r--math/s_fmax_template.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/math/s_fmax_template.c b/math/s_fmax_template.c
index d817406f04..4a88266e71 100644
--- a/math/s_fmax_template.c
+++ b/math/s_fmax_template.c
@@ -17,10 +17,14 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math-use-builtins.h>
 
 FLOAT
 M_DECL_FUNC (__fmax) (FLOAT x, FLOAT y)
 {
+#if M_USE_BUILTIN (FMAX)
+  return M_SUF (__builtin_fmax) (x, y);
+#else
   if (isgreaterequal (x, y))
     return x;
   else if (isless (x, y))
@@ -29,6 +33,7 @@ M_DECL_FUNC (__fmax) (FLOAT x, FLOAT y)
     return x + y;
   else
     return isnan (y) ? x : y;
+#endif
 }
 
 declare_mgen_alias (__fmax, fmax);