From: Adhemerval Zanella Date: Wed, 1 Dec 2021 13:44:58 +0000 (-0300) Subject: math: Add math-use-builtinds-fmin.h X-Git-Tag: glibc-2.35~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=583c4d424ec29f506c2c21fad99de3dd3caf53bb;p=thirdparty%2Fglibc.git math: Add math-use-builtinds-fmin.h It allows the architecture to use the builtin instead of generic implementation. --- diff --git a/math/s_fmin_template.c b/math/s_fmin_template.c index 565a8362663..5fc47193b75 100644 --- a/math/s_fmin_template.c +++ b/math/s_fmin_template.c @@ -17,11 +17,15 @@ . */ #include +#include FLOAT M_DECL_FUNC (__fmin) (FLOAT x, FLOAT y) { +#if M_USE_BUILTIN (FMIN) + return M_SUF (__builtin_fmin) (x, y); +#else if (islessequal (x, y)) return x; else if (isgreater (x, y)) @@ -30,5 +34,6 @@ M_DECL_FUNC (__fmin) (FLOAT x, FLOAT y) return x + y; else return isnan (y) ? x : y; +#endif } declare_mgen_alias (__fmin, fmin); diff --git a/sysdeps/generic/math-use-builtins-fmin.h b/sysdeps/generic/math-use-builtins-fmin.h new file mode 100644 index 00000000000..d2383ce00cc --- /dev/null +++ b/sysdeps/generic/math-use-builtins-fmin.h @@ -0,0 +1,4 @@ +#define USE_FMIN_BUILTIN 0 +#define USE_FMINF_BUILTIN 0 +#define USE_FMINL_BUILTIN 0 +#define USE_FMINF128_BUILTIN 0 diff --git a/sysdeps/generic/math-use-builtins.h b/sysdeps/generic/math-use-builtins.h index e07bba242f7..24fba475753 100644 --- a/sysdeps/generic/math-use-builtins.h +++ b/sysdeps/generic/math-use-builtins.h @@ -35,5 +35,6 @@ #include #include #include +#include #endif /* MATH_USE_BUILTINS_H */