about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--math/s_fmin_template.c5
-rw-r--r--sysdeps/generic/math-use-builtins-fmin.h4
-rw-r--r--sysdeps/generic/math-use-builtins.h1
3 files changed, 10 insertions, 0 deletions
diff --git a/math/s_fmin_template.c b/math/s_fmin_template.c
index 565a836266..5fc47193b7 100644
--- a/math/s_fmin_template.c
+++ b/math/s_fmin_template.c
@@ -17,11 +17,15 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math-use-builtins.h>
 
 
 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 0000000000..d2383ce00c
--- /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 e07bba242f..24fba47575 100644
--- a/sysdeps/generic/math-use-builtins.h
+++ b/sysdeps/generic/math-use-builtins.h
@@ -35,5 +35,6 @@
 #include <math-use-builtins-sqrt.h>
 #include <math-use-builtins-fma.h>
 #include <math-use-builtins-fmax.h>
+#include <math-use-builtins-fmin.h>
 
 #endif /* MATH_USE_BUILTINS_H  */