From af968f62f24c5c0ef4e7e5ab41acae946908c112 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 24 Oct 2011 20:19:17 -0400 Subject: Optimize accurate 64-bit routines for FMA4 on x86-64 --- sysdeps/x86_64/fpu/multiarch/Makefile | 32 ++++++++++++++++++++++++++++ sysdeps/x86_64/fpu/multiarch/brandred-fma4.c | 3 +++ sysdeps/x86_64/fpu/multiarch/doasin-fma4.c | 3 +++ sysdeps/x86_64/fpu/multiarch/dosincos-fma4.c | 5 +++++ sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c | 10 +++++++++ sysdeps/x86_64/fpu/multiarch/e_asin.c | 23 ++++++++++++++++++++ sysdeps/x86_64/fpu/multiarch/e_atan2-fma4.c | 9 ++++++++ sysdeps/x86_64/fpu/multiarch/e_atan2.c | 16 ++++++++++++++ sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c | 5 +++++ sysdeps/x86_64/fpu/multiarch/e_exp.c | 15 +++++++++++++ sysdeps/x86_64/fpu/multiarch/e_log-fma4.c | 7 ++++++ sysdeps/x86_64/fpu/multiarch/e_log.c | 15 +++++++++++++ sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c | 5 +++++ sysdeps/x86_64/fpu/multiarch/e_pow.c | 15 +++++++++++++ sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c | 3 +++ sysdeps/x86_64/fpu/multiarch/mpa-fma4.c | 10 +++++++++ sysdeps/x86_64/fpu/multiarch/mpatan-fma4.c | 8 +++++++ sysdeps/x86_64/fpu/multiarch/mpatan2-fma4.c | 8 +++++++ sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c | 7 ++++++ sysdeps/x86_64/fpu/multiarch/mplog-fma4.c | 7 ++++++ sysdeps/x86_64/fpu/multiarch/mpsqrt-fma4.c | 6 ++++++ sysdeps/x86_64/fpu/multiarch/mptan-fma4.c | 6 ++++++ sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c | 8 +++++++ sysdeps/x86_64/fpu/multiarch/s_atan.c | 14 ++++++++++++ sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c | 11 ++++++++++ sysdeps/x86_64/fpu/multiarch/s_sin.c | 22 +++++++++++++++++++ sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c | 9 ++++++++ sysdeps/x86_64/fpu/multiarch/s_tan.c | 14 ++++++++++++ sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c | 14 ++++++++++++ sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c | 8 +++++++ sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c | 10 +++++++++ 31 files changed, 328 insertions(+) create mode 100644 sysdeps/x86_64/fpu/multiarch/brandred-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/doasin-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/dosincos-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/e_asin.c create mode 100644 sysdeps/x86_64/fpu/multiarch/e_atan2-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/e_atan2.c create mode 100644 sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/e_exp.c create mode 100644 sysdeps/x86_64/fpu/multiarch/e_log-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/e_log.c create mode 100644 sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/e_pow.c create mode 100644 sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/mpa-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/mpatan-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/mpatan2-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/mplog-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/mpsqrt-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/mptan-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/s_atan.c create mode 100644 sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/s_sin.c create mode 100644 sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/s_tan.c create mode 100644 sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c create mode 100644 sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c (limited to 'sysdeps/x86_64') diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile index bd07e98..70cb740 100644 --- a/sysdeps/x86_64/fpu/multiarch/Makefile +++ b/sysdeps/x86_64/fpu/multiarch/Makefile @@ -1,4 +1,36 @@ ifeq ($(subdir),math) libm-sysdep_routines += s_floor-c s_ceil-c s_floorf-c s_ceilf-c \ s_rint-c s_rintf-c s_nearbyint-c s_nearbyintf-c + +ifeq ($(have-mfma4),yes) +libm-sysdep_routines += e_exp-fma4 e_log-fma4 e_pow-fma4 s_atan-fma4 \ + e_asin-fma4 e_atan2-fma4 s_sin-fma4 s_tan-fma4 \ + mplog-fma4 mpa-fma4 slowexp-fma4 slowpow-fma4 \ + sincos32-fma4 doasin-fma4 dosincos-fma4 \ + brandred-fma4 halfulp-fma4 mpexp-fma4 \ + mpatan2-fma4 mpatan-fma4 mpsqrt-fma4 mptan-fma4 + +CFLAGS-brandred-fma4.c = -mfma4 +CFLAGS-doasin-fma4.c = -mfma4 +CFLAGS-dosincos-fma4.c = -mfma4 +CFLAGS-e_asin-fma4.c = -mfma4 +CFLAGS-e_atan2-fma4.c = -mfma4 +CFLAGS-e_exp-fma4.c = -mfma4 +CFLAGS-e_log-fma4.c = -mfma4 +CFLAGS-e_pow-fma4.c = -mfma4 +CFLAGS-halfulp-fma4.c = -mfma4 +CFLAGS-mpa-fma4.c = -mfma4 +CFLAGS-mpatan-fma4.c = -mfma4 +CFLAGS-mpatan2-fma4.c = -mfma4 +CFLAGS-mpexp-fma4.c = -mfma4 +CFLAGS-mplog-fma4.c = -mfma4 +CFLAGS-mpsqrt-fma4.c = -mfma4 +CFLAGS-mptan-fma4.c = -mfma4 +CFLAGS-s_atan-fma4.c = -mfma4 +CFLAGS-sincos32-fma4.c = -mfma4 +CFLAGS-slowexp-fma4.c = -mfma4 +CFLAGS-slowpow-fma4.c = -mfma4 +CLFAGS-s_sin-fma4.c = -mfma4 +CLFAGS-s_tan-fma4.c = -mfma4 +endif endif diff --git a/sysdeps/x86_64/fpu/multiarch/brandred-fma4.c b/sysdeps/x86_64/fpu/multiarch/brandred-fma4.c new file mode 100644 index 0000000..93fb5a1 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/brandred-fma4.c @@ -0,0 +1,3 @@ +#define __branred __branred_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/doasin-fma4.c b/sysdeps/x86_64/fpu/multiarch/doasin-fma4.c new file mode 100644 index 0000000..d7ba67e --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/doasin-fma4.c @@ -0,0 +1,3 @@ +#define __doasin __doasin_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/dosincos-fma4.c b/sysdeps/x86_64/fpu/multiarch/dosincos-fma4.c new file mode 100644 index 0000000..02b420b --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/dosincos-fma4.c @@ -0,0 +1,5 @@ +#define __docos __docos_fma4 +#define __dubcos __dubcos_fma4 +#define __dubsin __dubsin_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c b/sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c new file mode 100644 index 0000000..938bc84 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/e_asin-fma4.c @@ -0,0 +1,10 @@ +#define __ieee754_acos __ieee754_acos_fma4 +#define __ieee754_asin __ieee754_asin_fma4 +#define __cos32 __cos32_fma4 +#define __doasin __doasin_fma4 +#define __docos __docos_fma4 +#define __dubcos __dubcos_fma4 +#define __dubsin __dubsin_fma4 +#define __sin32 __sin32_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/e_asin.c b/sysdeps/x86_64/fpu/multiarch/e_asin.c new file mode 100644 index 0000000..8882cea --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/e_asin.c @@ -0,0 +1,23 @@ +#ifdef HAVE_FMA4_SUPPORT +# include +# include + +extern double __ieee754_acos_sse2 (double); +extern double __ieee754_acos_fma4 (double); +extern double __ieee754_asin_sse2 (double); +extern double __ieee754_asin_fma4 (double); + +libm_ifunc (__ieee754_acos, + HAS_FMA4 ? __ieee754_acos_fma4 : __ieee754_acos_sse2); +strong_alias (__ieee754_acos, __acos_finite) + +libm_ifunc (__ieee754_asin, + HAS_FMA4 ? __ieee754_asin_fma4 : __ieee754_asin_sse2); +strong_alias (__ieee754_asin, __asin_finite) + +# define __ieee754_acos __ieee754_acos_sse2 +# define __ieee754_asin __ieee754_asin_sse2 +#endif + + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/e_atan2-fma4.c b/sysdeps/x86_64/fpu/multiarch/e_atan2-fma4.c new file mode 100644 index 0000000..84a6f86 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/e_atan2-fma4.c @@ -0,0 +1,9 @@ +#define __ieee754_atan2 __ieee754_atan2_fma4 +#define __add __add_fma4 +#define __dbl_mp __dbl_mp_fma4 +#define __dvd __dvd_fma4 +#define __mpatan2 __mpatan2_fma4 +#define __mul __mul_fma4 +#define __sub __sub_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/e_atan2.c b/sysdeps/x86_64/fpu/multiarch/e_atan2.c new file mode 100644 index 0000000..12fc929 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/e_atan2.c @@ -0,0 +1,16 @@ +#ifdef HAVE_FMA4_SUPPORT +# include +# include + +extern double __ieee754_atan2_sse2 (double, double); +extern double __ieee754_atan2_fma4 (double, double); + +libm_ifunc (__ieee754_atan2, + HAS_FMA4 ? __ieee754_atan2_fma4 : __ieee754_atan2_sse2); +strong_alias (__ieee754_atan2, __atan2_finite) + +# define __ieee754_atan2 __ieee754_atan2_sse2 +#endif + + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c b/sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c new file mode 100644 index 0000000..942dfff --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c @@ -0,0 +1,5 @@ +#define __ieee754_exp __ieee754_exp_fma4 +#define __exp1 __exp1_fma4 +#define __slowexp __slowexp_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp.c b/sysdeps/x86_64/fpu/multiarch/e_exp.c new file mode 100644 index 0000000..fc1096b --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/e_exp.c @@ -0,0 +1,15 @@ +#ifdef HAVE_FMA4_SUPPORT +# include +# include + +extern double __ieee754_exp_sse2 (double); +extern double __ieee754_exp_fma4 (double); + +libm_ifunc (__ieee754_exp, HAS_FMA4 ? __ieee754_exp_fma4 : __ieee754_exp_sse2); +strong_alias (__ieee754_exp, __exp_finite) + +# define __ieee754_exp __ieee754_exp_sse2 +#endif + + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/e_log-fma4.c b/sysdeps/x86_64/fpu/multiarch/e_log-fma4.c new file mode 100644 index 0000000..0be66d1 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/e_log-fma4.c @@ -0,0 +1,7 @@ +#define __ieee754_log __ieee754_log_fma4 +#define __mplog __mplog_fma4 +#define __add __add_fma4 +#define __dbl_mp __dbl_mp_fma4 +#define __sub __sub_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/e_log.c b/sysdeps/x86_64/fpu/multiarch/e_log.c new file mode 100644 index 0000000..c542646 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/e_log.c @@ -0,0 +1,15 @@ +#ifdef HAVE_FMA4_SUPPORT +# include +# include + +extern double __ieee754_log_sse2 (double); +extern double __ieee754_log_fma4 (double); + +libm_ifunc (__ieee754_log, HAS_FMA4 ? __ieee754_log_fma4 : __ieee754_log_sse2); +strong_alias (__ieee754_log, __log_finite) + +# define __ieee754_log __ieee754_log_sse2 +#endif + + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c b/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c new file mode 100644 index 0000000..20313be --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/e_pow-fma4.c @@ -0,0 +1,5 @@ +#define __ieee754_pow __ieee754_pow_fma4 +#define __exp1 __exp1_fma4 +#define __slowpow __slowpow_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/e_pow.c b/sysdeps/x86_64/fpu/multiarch/e_pow.c new file mode 100644 index 0000000..a740b6c --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/e_pow.c @@ -0,0 +1,15 @@ +#ifdef HAVE_FMA4_SUPPORT +# include +# include + +extern double __ieee754_pow_sse2 (double, double); +extern double __ieee754_pow_fma4 (double, double); + +libm_ifunc (__ieee754_pow, HAS_FMA4 ? __ieee754_pow_fma4 : __ieee754_pow_sse2); +strong_alias (__ieee754_pow, __pow_finite) + +# define __ieee754_pow __ieee754_pow_sse2 +#endif + + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c b/sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c new file mode 100644 index 0000000..3fc223e --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/halfulp-fma4.c @@ -0,0 +1,3 @@ +#define __halfulp __halfulp_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/mpa-fma4.c b/sysdeps/x86_64/fpu/multiarch/mpa-fma4.c new file mode 100644 index 0000000..7b9e2ef --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/mpa-fma4.c @@ -0,0 +1,10 @@ +#define __add __add_fma4 +#define __mul __mul_fma4 +#define __sub __sub_fma4 +#define __dbl_mp __dbl_mp_fma4 +#define __dvd __dvd_fma4 + +#define NO___CPY 1 +#define NO___MP_DBL 1 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/mpatan-fma4.c b/sysdeps/x86_64/fpu/multiarch/mpatan-fma4.c new file mode 100644 index 0000000..942974b --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/mpatan-fma4.c @@ -0,0 +1,8 @@ +#define __mpatan __mpatan_fma4 +#define __add __add_fma4 +#define __dvd __dvd_fma4 +#define __mpsqrt __mpsqrt_fma4 +#define __mul __mul_fma4 +#define __sub __sub_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/mpatan2-fma4.c b/sysdeps/x86_64/fpu/multiarch/mpatan2-fma4.c new file mode 100644 index 0000000..e7c469e --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/mpatan2-fma4.c @@ -0,0 +1,8 @@ +#define __mpatan2 __mpatan2_fma4 +#define __add __add_fma4 +#define __dvd __dvd_fma4 +#define __mpatan __mpatan_fma4 +#define __mpsqrt __mpsqrt_fma4 +#define __mul __mul_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c b/sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c new file mode 100644 index 0000000..021970c --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/mpexp-fma4.c @@ -0,0 +1,7 @@ +#define __mpexp __mpexp_fma4 +#define __add __add_fma4 +#define __dbl_mp __dbl_mp_fma4 +#define __dvd __dvd_fma4 +#define __mul __mul_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/mplog-fma4.c b/sysdeps/x86_64/fpu/multiarch/mplog-fma4.c new file mode 100644 index 0000000..9581eaf --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/mplog-fma4.c @@ -0,0 +1,7 @@ +#define __mplog __mplog_fma4 +#define __add __add_fma4 +#define __mpexp __mpexp_fma4 +#define __mul __mul_fma4 +#define __sub __sub_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/mpsqrt-fma4.c b/sysdeps/x86_64/fpu/multiarch/mpsqrt-fma4.c new file mode 100644 index 0000000..43b6493 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/mpsqrt-fma4.c @@ -0,0 +1,6 @@ +#define __mpsqrt __mpsqrt_fma4 +#define __dbl_mp __dbl_mp_fma4 +#define __mul __mul_fma4 +#define __sub __sub_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/mptan-fma4.c b/sysdeps/x86_64/fpu/multiarch/mptan-fma4.c new file mode 100644 index 0000000..767924e --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/mptan-fma4.c @@ -0,0 +1,6 @@ +#define __mptan __mptan_fma4 +#define __c32 __c32_fma4 +#define __dvd __dvd_fma4 +#define __mpranred __mpranred_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c b/sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c new file mode 100644 index 0000000..a8f0977 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/s_atan-fma4.c @@ -0,0 +1,8 @@ +#define atan __atan_fma4 +#define __add __add_fma4 +#define __dbl_mp __dbl_mp_fma4 +#define __mpatan __mpatan_fma4 +#define __mul __mul_fma4 +#define __sub __sub_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/s_atan.c b/sysdeps/x86_64/fpu/multiarch/s_atan.c new file mode 100644 index 0000000..ffc4a56 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/s_atan.c @@ -0,0 +1,14 @@ +#ifdef HAVE_FMA4_SUPPORT +# include +# include + +extern double __atan_sse2 (double); +extern double __atan_fma4 (double); + +libm_ifunc (atan, HAS_FMA4 ? __atan_fma4 : __atan_sse2); + +# define atan __atan_sse2 +#endif + + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c b/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c new file mode 100644 index 0000000..97cef8b --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c @@ -0,0 +1,11 @@ +#define __cos __cos_fma4 +#define __sin __sin_fma4 +#define __branred __branred_fma4 +#define __docos __docos_fma4 +#define __dubsin __dubsin_fma4 +#define __mpcos __mpcos_fma4 +#define __mpcos1 __mpcos1_fma4 +#define __mpsin __mpsin_fma4 +#define __mpsin1 __mpsin1_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/s_sin.c b/sysdeps/x86_64/fpu/multiarch/s_sin.c new file mode 100644 index 0000000..a7c35dc --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/s_sin.c @@ -0,0 +1,22 @@ +#ifdef HAVE_FMA4_SUPPORT +# include +# include +# undef NAN + +extern double __cos_sse2 (double); +extern double __cos_fma4 (double); +extern double __sin_sse2 (double); +extern double __sin_fma4 (double); + +libm_ifunc (__cos, HAS_FMA4 ? __cos_fma4 : __cos_sse2); +weak_alias (__cos, cos) + +libm_ifunc (__sin, HAS_FMA4 ? __sin_fma4 : __sin_sse2); +weak_alias (__sin, sin) + +# define __cos __cos_sse2 +# define __sin __sin_sse2 +#endif + + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c b/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c new file mode 100644 index 0000000..c3cefc2 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c @@ -0,0 +1,9 @@ +#define tan __tan_fma4 +#define __branred __branred_fma4 +#define __dbl_mp __dbl_mp_fma4 +#define __mpranred __mpranred_fma4 +#define __mptan __mptan_fma4 +#define __sub __sub_fma4 + + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan.c b/sysdeps/x86_64/fpu/multiarch/s_tan.c new file mode 100644 index 0000000..cca02b5 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/s_tan.c @@ -0,0 +1,14 @@ +#ifdef HAVE_FMA4_SUPPORT +# include +# include + +extern double __tan_sse2 (double); +extern double __tan_fma4 (double); + +libm_ifunc (tan, HAS_FMA4 ? __tan_fma4 : __tan_sse2); + +# define tan __tan_sse2 +#endif + + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c b/sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c new file mode 100644 index 0000000..f0d2d27 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/sincos32-fma4.c @@ -0,0 +1,14 @@ +#define __cos32 __cos32_fma4 +#define __sin32 __sin32_fma4 +#define __c32 __c32_fma4 +#define __mpsin __mpsin_fma4 +#define __mpsin1 __mpsin1_fma4 +#define __mpcos __mpcos_fma4 +#define __mpcos1 __mpcos1_fma4 +#define __mpranred __mpranred_fma4 +#define __add __add_fma4 +#define __dbl_mp __dbl_mp_fma4 +#define __mul __mul_fma4 +#define __sub __sub_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c b/sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c new file mode 100644 index 0000000..83cb359 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c @@ -0,0 +1,8 @@ +#define __slowexp __slowexp_fma4 +#define __add __add_fma4 +#define __dbl_mp __dbl_mp_fma4 +#define __mpexp __mpexp_fma4 +#define __mul __mul_fma4 +#define __sub __sub_fma4 + +#include diff --git a/sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c b/sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c new file mode 100644 index 0000000..744f3f6 --- /dev/null +++ b/sysdeps/x86_64/fpu/multiarch/slowpow-fma4.c @@ -0,0 +1,10 @@ +#define __slowpow __slowpow_fma4 +#define __add __add_fma4 +#define __dbl_mp __dbl_mp_fma4 +#define __mpexp __mpexp_fma4 +#define __mplog __mplog_fma4 +#define __mul __mul_fma4 +#define __sub __sub_fma4 +#define __halfulp __halfulp_fma4 + +#include -- cgit v1.1