diff options
Diffstat (limited to 'sysdeps/x86_64/fpu')
-rw-r--r-- | sysdeps/x86_64/fpu/math_private.h | 35 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/multiarch/Makefile | 25 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/multiarch/brandred-fma4.c | 4 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/multiarch/e_atan2.c | 2 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/multiarch/e_exp.c | 2 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/multiarch/e_log.c | 3 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/multiarch/s_atan.c | 2 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c | 1 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/multiarch/s_sin.c | 4 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c | 1 | ||||
-rw-r--r-- | sysdeps/x86_64/fpu/multiarch/s_tan.c | 2 |
11 files changed, 25 insertions, 56 deletions
diff --git a/sysdeps/x86_64/fpu/math_private.h b/sysdeps/x86_64/fpu/math_private.h index ded64a812b..5662a5f9be 100644 --- a/sysdeps/x86_64/fpu/math_private.h +++ b/sysdeps/x86_64/fpu/math_private.h @@ -19,7 +19,7 @@ /* We can do a few things better on x86-64. */ -#ifdef __AVX__ +#if defined __AVX__ || defined SSE2AVX # define MOVD "vmovd" #else # define MOVD "movd" @@ -86,7 +86,7 @@ ({ int __di; GET_FLOAT_WORD (__di, (float) d); \ (__di & 0x7fffffff) < 0x7f800000; }) -#ifdef __AVX__ +#if defined __AVX__ || defined SSE2AVX # define __ieee754_sqrt(d) \ ({ double __res; \ asm ("vsqrtsd %1, %0, %0" : "=x" (__res) : "xm" ((double) (d))); \ @@ -112,7 +112,7 @@ #ifdef __SSE4_1__ # ifndef __rint -# ifdef __AVX__ +# if defined __AVX__ || defined SSE2AVX # define __rint(d) \ ({ double __res; \ asm ("vroundsd $4, %1, %0, %0" : "=x" (__res) : "xm" ((double) (d))); \ @@ -125,7 +125,7 @@ # endif # endif # ifndef __rintf -# ifdef __AVX__ +# if defined __AVX__ || defined SSE2AVX # define __rintf(d) \ ({ float __res; \ asm ("vroundss $4, %1, %0, %0" : "=x" (__res) : "xm" ((float) (d))); \ @@ -139,7 +139,7 @@ # endif # ifndef __floor -# ifdef __AVX__ +# if defined __AVX__ || defined SSE2AVX # define __floor(d) \ ({ double __res; \ asm ("vroundsd $1, %1, %0, %0" : "=x" (__res) : "xm" ((double) (d))); \ @@ -152,7 +152,7 @@ # endif # endif # ifndef __floorf -# ifdef __AVX__ +# if defined __AVX__ || defined SSE2AVX # define __floorf(d) \ ({ float __res; \ asm ("vroundss $1, %1, %0, %0" : "=x" (__res) : "xm" ((float) (d))); \ @@ -169,29 +169,6 @@ /* Specialized variants of the <fenv.h> interfaces which only handle either the FPU or the SSE unit. */ -#undef libc_fegetround -#define libc_fegetround() \ - ({ \ - unsigned int mxcsr; \ - asm volatile ("stmxcsr %0" : "=m" (*&mxcsr)); \ - (mxcsr & 0x6000) >> 3; \ - }) -#undef libc_fegetroundf -#define libc_fegetroundf() libc_fegetround () -// #define libc_fegetroundl() fegetround () - -#undef libc_fesetround -#define libc_fesetround(r) \ - do { \ - unsigned int mxcsr; \ - asm ("stmxcsr %0" : "=m" (*&mxcsr)); \ - mxcsr = (mxcsr & ~0x6000) | ((r) << 3); \ - asm volatile ("ldmxcsr %0" : : "m" (*&mxcsr)); \ - } while (0) -#undef libc_fesetroundf -#define libc_fesetroundf(r) libc_fesetround (r) -// #define libc_fesetroundl(r) (void) fesetround (r) - #undef libc_feholdexcept #ifdef __AVX__ # define libc_feholdexcept(e) \ diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile index be689036dc..12b0526e50 100644 --- a/sysdeps/x86_64/fpu/multiarch/Makefile +++ b/sysdeps/x86_64/fpu/multiarch/Makefile @@ -7,10 +7,9 @@ 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 \ + 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 @@ -34,21 +33,21 @@ CFLAGS-s_sin-fma4.c = -mfma4 CFLAGS-s_tan-fma4.c = -mfma4 endif -ifeq ($(config-cflags-avx),yes) +ifeq ($(config-cflags-sse2avx),yes) libm-sysdep_routines += e_exp-avx e_log-avx s_atan-avx \ e_atan2-avx s_sin-avx s_tan-avx \ mplog-avx mpa-avx slowexp-avx \ mpexp-avx -CFLAGS-e_atan2-avx.c = -mavx -CFLAGS-e_exp-avx.c = -mavx -CFLAGS-e_log-avx.c = -mavx -CFLAGS-mpa-avx.c = -mavx -CFLAGS-mpexp-avx.c = -mavx -CFLAGS-mplog-avx.c = -mavx -CFLAGS-s_atan-avx.c = -mavx -CFLAGS-s_sin-avx.c = -mavx -CFLAGS-slowexp-avx.c = -mavx -CFLAGS-s_tan-avx.c = -mavx +CFLAGS-e_atan2-avx.c = -msse2avx -DSSE2AVX +CFLAGS-e_exp-avx.c = -msse2avx -DSSE2AVX +CFLAGS-e_log-avx.c = -msse2avx -DSSE2AVX +CFLAGS-mpa-avx.c = -msse2avx -DSSE2AVX +CFLAGS-mpexp-avx.c = -msse2avx -DSSE2AVX +CFLAGS-mplog-avx.c = -msse2avx -DSSE2AVX +CFLAGS-s_atan-avx.c = -msse2avx -DSSE2AVX +CFLAGS-s_sin-avx.c = -msse2avx -DSSE2AVX +CFLAGS-slowexp-avx.c = -msse2avx -DSSE2AVX +CFLAGS-s_tan-avx.c = -msse2avx -DSSE2AVX endif endif diff --git a/sysdeps/x86_64/fpu/multiarch/brandred-fma4.c b/sysdeps/x86_64/fpu/multiarch/brandred-fma4.c deleted file mode 100644 index f4f68ac962..0000000000 --- a/sysdeps/x86_64/fpu/multiarch/brandred-fma4.c +++ /dev/null @@ -1,4 +0,0 @@ -#define __branred __branred_fma4 -#define SECTION __attribute__ ((section (".text.fma4"))) - -#include <sysdeps/ieee754/dbl-64/branred.c> diff --git a/sysdeps/x86_64/fpu/multiarch/e_atan2.c b/sysdeps/x86_64/fpu/multiarch/e_atan2.c index 3a615fc9d1..6867c6e64e 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_atan2.c +++ b/sysdeps/x86_64/fpu/multiarch/e_atan2.c @@ -14,7 +14,7 @@ extern double __ieee754_atan2_fma4 (double, double); libm_ifunc (__ieee754_atan2, HAS_FMA4 ? __ieee754_atan2_fma4 - : (HAS_YMM_USABLE ? __ieee754_atan2_avx : __ieee754_atan2_sse2)); + : (HAS_AVX ? __ieee754_atan2_avx : __ieee754_atan2_sse2)); strong_alias (__ieee754_atan2, __atan2_finite) # define __ieee754_atan2 __ieee754_atan2_sse2 diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp.c b/sysdeps/x86_64/fpu/multiarch/e_exp.c index 7b2320a223..3c650287c5 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_exp.c +++ b/sysdeps/x86_64/fpu/multiarch/e_exp.c @@ -14,7 +14,7 @@ extern double __ieee754_exp_fma4 (double); libm_ifunc (__ieee754_exp, HAS_FMA4 ? __ieee754_exp_fma4 - : (HAS_YMM_USABLE ? __ieee754_exp_avx : __ieee754_exp_sse2)); + : (HAS_AVX ? __ieee754_exp_avx : __ieee754_exp_sse2)); strong_alias (__ieee754_exp, __exp_finite) # define __ieee754_exp __ieee754_exp_sse2 diff --git a/sysdeps/x86_64/fpu/multiarch/e_log.c b/sysdeps/x86_64/fpu/multiarch/e_log.c index ab277d67fe..05f36680be 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_log.c +++ b/sysdeps/x86_64/fpu/multiarch/e_log.c @@ -14,8 +14,7 @@ extern double __ieee754_log_fma4 (double); libm_ifunc (__ieee754_log, HAS_FMA4 ? __ieee754_log_fma4 - : (HAS_YMM_USABLE ? __ieee754_log_avx - : __ieee754_log_sse2)); + : (HAS_AVX ? __ieee754_log_avx : __ieee754_log_sse2)); strong_alias (__ieee754_log, __log_finite) # define __ieee754_log __ieee754_log_sse2 diff --git a/sysdeps/x86_64/fpu/multiarch/s_atan.c b/sysdeps/x86_64/fpu/multiarch/s_atan.c index 78c7e099cb..ae16d7c9bb 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_atan.c +++ b/sysdeps/x86_64/fpu/multiarch/s_atan.c @@ -13,7 +13,7 @@ extern double __atan_fma4 (double); # endif libm_ifunc (atan, (HAS_FMA4 ? __atan_fma4 : - HAS_YMM_USABLE ? __atan_avx : __atan_sse2)); + HAS_AVX ? __atan_avx : __atan_sse2)); # define atan __atan_sse2 #endif diff --git a/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c b/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c index 2501af981a..4c35739dc9 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c +++ b/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c @@ -1,6 +1,5 @@ #define __cos __cos_fma4 #define __sin __sin_fma4 -#define __branred __branred_fma4 #define __docos __docos_fma4 #define __dubsin __dubsin_fma4 #define __mpcos __mpcos_fma4 diff --git a/sysdeps/x86_64/fpu/multiarch/s_sin.c b/sysdeps/x86_64/fpu/multiarch/s_sin.c index 417acd0683..a0c2521c98 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_sin.c +++ b/sysdeps/x86_64/fpu/multiarch/s_sin.c @@ -18,11 +18,11 @@ extern double __sin_fma4 (double); # endif libm_ifunc (__cos, (HAS_FMA4 ? __cos_fma4 : - HAS_YMM_USABLE ? __cos_avx : __cos_sse2)); + HAS_AVX ? __cos_avx : __cos_sse2)); weak_alias (__cos, cos) libm_ifunc (__sin, (HAS_FMA4 ? __sin_fma4 : - HAS_YMM_USABLE ? __sin_avx : __sin_sse2)); + HAS_AVX ? __sin_avx : __sin_sse2)); weak_alias (__sin, sin) # define __cos __cos_sse2 diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c b/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c index d7dab3ca9e..a805440b46 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c +++ b/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c @@ -1,5 +1,4 @@ #define tan __tan_fma4 -#define __branred __branred_fma4 #define __dbl_mp __dbl_mp_fma4 #define __mpranred __mpranred_fma4 #define __mptan __mptan_fma4 diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan.c b/sysdeps/x86_64/fpu/multiarch/s_tan.c index 3047155cec..904308fada 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_tan.c +++ b/sysdeps/x86_64/fpu/multiarch/s_tan.c @@ -13,7 +13,7 @@ extern double __tan_fma4 (double); # endif libm_ifunc (tan, (HAS_FMA4 ? __tan_fma4 : - HAS_YMM_USABLE ? __tan_avx : __tan_sse2)); + HAS_AVX ? __tan_avx : __tan_sse2)); # define tan __tan_sse2 #endif |