2011-10-17 00:58:17 +00:00
|
|
|
ifeq ($(subdir),math)
|
|
|
|
libm-sysdep_routines += s_floor-c s_ceil-c s_floorf-c s_ceilf-c \
|
2017-09-20 16:54:05 +00:00
|
|
|
s_rint-c s_rintf-c s_nearbyint-c s_nearbyintf-c \
|
2021-05-24 01:43:11 +00:00
|
|
|
s_roundeven-c s_roundevenf-c s_trunc-c s_truncf-c
|
2011-10-25 00:19:17 +00:00
|
|
|
|
2017-08-04 20:01:59 +00:00
|
|
|
libm-sysdep_routines += s_ceil-sse4_1 s_ceilf-sse4_1 s_floor-sse4_1 \
|
|
|
|
s_floorf-sse4_1 s_nearbyint-sse4_1 \
|
2021-05-24 01:43:11 +00:00
|
|
|
s_nearbyintf-sse4_1 s_roundeven-sse4_1 \
|
|
|
|
s_roundevenf-sse4_1 s_rint-sse4_1 s_rintf-sse4_1 \
|
2017-09-20 16:54:05 +00:00
|
|
|
s_trunc-sse4_1 s_truncf-sse4_1
|
2017-08-04 20:01:59 +00:00
|
|
|
|
x86-64: Add FMA multiarch functions to libm
This patch adds multiarch functions optimized with -mfma -mavx2 to libm.
e_pow-fma.c is compiled with $(config-cflags-nofma) due to PR 19003.
* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_exp-fma, e_log-fma, e_pow-fma, s_atan-fma, e_asin-fma,
e_atan2-fma, s_sin-fma, s_tan-fma, mplog-fma, mpa-fma,
slowexp-fma, slowpow-fma, sincos32-fma, doasin-fma, dosincos-fma,
halfulp-fma, mpexp-fma, mpatan2-fma, mpatan-fma, mpsqrt-fma,
and mptan-fma.
(CFLAGS-doasin-fma.c): New.
(CFLAGS-dosincos-fma.c): Likewise.
(CFLAGS-e_asin-fma.c): Likewise.
(CFLAGS-e_atan2-fma.c): Likewise.
(CFLAGS-e_exp-fma.c): Likewise.
(CFLAGS-e_log-fma.c): Likewise.
(CFLAGS-e_pow-fma.c): Likewise.
(CFLAGS-halfulp-fma.c): Likewise.
(CFLAGS-mpa-fma.c): Likewise.
(CFLAGS-mpatan-fma.c): Likewise.
(CFLAGS-mpatan2-fma.c): Likewise.
(CFLAGS-mpexp-fma.c): Likewise.
(CFLAGS-mplog-fma.c): Likewise.
(CFLAGS-mpsqrt-fma.c): Likewise.
(CFLAGS-mptan-fma.c): Likewise.
(CFLAGS-s_atan-fma.c): Likewise.
(CFLAGS-sincos32-fma.c): Likewise.
(CFLAGS-slowexp-fma.c): Likewise.
(CFLAGS-slowpow-fma.c): Likewise.
(CFLAGS-s_sin-fma.c): Likewise.
(CFLAGS-s_tan-fma.c): Likewise.
* sysdeps/x86_64/fpu/multiarch/doasin-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/dosincos-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_asin-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_atan2-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_exp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_log-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_pow-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/halfulp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h: Likewise.
* sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpa-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpatan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpatan2-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpexp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mplog-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpsqrt-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mptan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_atan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_sin-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_tan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/sincos32-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/slowexp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/slowpow-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_asin.c: Rewrite.
* sysdeps/x86_64/fpu/multiarch/e_atan2.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_exp.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_log.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_pow.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_atan.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_sin.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_tan.c: Likewise.
2017-08-07 15:19:59 +00:00
|
|
|
libm-sysdep_routines += e_exp-fma e_log-fma e_pow-fma s_atan-fma \
|
2021-03-10 12:41:47 +00:00
|
|
|
e_asin-fma e_atan2-fma s_sin-fma s_tan-fma
|
x86-64: Add FMA multiarch functions to libm
This patch adds multiarch functions optimized with -mfma -mavx2 to libm.
e_pow-fma.c is compiled with $(config-cflags-nofma) due to PR 19003.
* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_exp-fma, e_log-fma, e_pow-fma, s_atan-fma, e_asin-fma,
e_atan2-fma, s_sin-fma, s_tan-fma, mplog-fma, mpa-fma,
slowexp-fma, slowpow-fma, sincos32-fma, doasin-fma, dosincos-fma,
halfulp-fma, mpexp-fma, mpatan2-fma, mpatan-fma, mpsqrt-fma,
and mptan-fma.
(CFLAGS-doasin-fma.c): New.
(CFLAGS-dosincos-fma.c): Likewise.
(CFLAGS-e_asin-fma.c): Likewise.
(CFLAGS-e_atan2-fma.c): Likewise.
(CFLAGS-e_exp-fma.c): Likewise.
(CFLAGS-e_log-fma.c): Likewise.
(CFLAGS-e_pow-fma.c): Likewise.
(CFLAGS-halfulp-fma.c): Likewise.
(CFLAGS-mpa-fma.c): Likewise.
(CFLAGS-mpatan-fma.c): Likewise.
(CFLAGS-mpatan2-fma.c): Likewise.
(CFLAGS-mpexp-fma.c): Likewise.
(CFLAGS-mplog-fma.c): Likewise.
(CFLAGS-mpsqrt-fma.c): Likewise.
(CFLAGS-mptan-fma.c): Likewise.
(CFLAGS-s_atan-fma.c): Likewise.
(CFLAGS-sincos32-fma.c): Likewise.
(CFLAGS-slowexp-fma.c): Likewise.
(CFLAGS-slowpow-fma.c): Likewise.
(CFLAGS-s_sin-fma.c): Likewise.
(CFLAGS-s_tan-fma.c): Likewise.
* sysdeps/x86_64/fpu/multiarch/doasin-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/dosincos-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_asin-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_atan2-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_exp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_log-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_pow-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/halfulp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h: Likewise.
* sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpa-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpatan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpatan2-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpexp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mplog-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpsqrt-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mptan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_atan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_sin-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_tan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/sincos32-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/slowexp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/slowpow-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_asin.c: Rewrite.
* sysdeps/x86_64/fpu/multiarch/e_atan2.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_exp.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_log.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_pow.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_atan.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_sin.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_tan.c: Likewise.
2017-08-07 15:19:59 +00:00
|
|
|
|
|
|
|
CFLAGS-e_asin-fma.c = -mfma -mavx2
|
|
|
|
CFLAGS-e_atan2-fma.c = -mfma -mavx2
|
|
|
|
CFLAGS-e_exp-fma.c = -mfma -mavx2
|
|
|
|
CFLAGS-e_log-fma.c = -mfma -mavx2
|
2018-06-13 16:57:20 +00:00
|
|
|
CFLAGS-e_pow-fma.c = -mfma -mavx2
|
x86-64: Add FMA multiarch functions to libm
This patch adds multiarch functions optimized with -mfma -mavx2 to libm.
e_pow-fma.c is compiled with $(config-cflags-nofma) due to PR 19003.
* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_exp-fma, e_log-fma, e_pow-fma, s_atan-fma, e_asin-fma,
e_atan2-fma, s_sin-fma, s_tan-fma, mplog-fma, mpa-fma,
slowexp-fma, slowpow-fma, sincos32-fma, doasin-fma, dosincos-fma,
halfulp-fma, mpexp-fma, mpatan2-fma, mpatan-fma, mpsqrt-fma,
and mptan-fma.
(CFLAGS-doasin-fma.c): New.
(CFLAGS-dosincos-fma.c): Likewise.
(CFLAGS-e_asin-fma.c): Likewise.
(CFLAGS-e_atan2-fma.c): Likewise.
(CFLAGS-e_exp-fma.c): Likewise.
(CFLAGS-e_log-fma.c): Likewise.
(CFLAGS-e_pow-fma.c): Likewise.
(CFLAGS-halfulp-fma.c): Likewise.
(CFLAGS-mpa-fma.c): Likewise.
(CFLAGS-mpatan-fma.c): Likewise.
(CFLAGS-mpatan2-fma.c): Likewise.
(CFLAGS-mpexp-fma.c): Likewise.
(CFLAGS-mplog-fma.c): Likewise.
(CFLAGS-mpsqrt-fma.c): Likewise.
(CFLAGS-mptan-fma.c): Likewise.
(CFLAGS-s_atan-fma.c): Likewise.
(CFLAGS-sincos32-fma.c): Likewise.
(CFLAGS-slowexp-fma.c): Likewise.
(CFLAGS-slowpow-fma.c): Likewise.
(CFLAGS-s_sin-fma.c): Likewise.
(CFLAGS-s_tan-fma.c): Likewise.
* sysdeps/x86_64/fpu/multiarch/doasin-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/dosincos-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_asin-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_atan2-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_exp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_log-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_pow-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/halfulp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/ifunc-avx-fma4.h: Likewise.
* sysdeps/x86_64/fpu/multiarch/ifunc-fma4.h: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpa-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpatan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpatan2-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpexp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mplog-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mpsqrt-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/mptan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_atan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_sin-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_tan-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/sincos32-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/slowexp-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/slowpow-fma.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_asin.c: Rewrite.
* sysdeps/x86_64/fpu/multiarch/e_atan2.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_exp.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_log.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_pow.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_atan.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_sin.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_tan.c: Likewise.
2017-08-07 15:19:59 +00:00
|
|
|
CFLAGS-s_atan-fma.c = -mfma -mavx2
|
|
|
|
CFLAGS-s_sin-fma.c = -mfma -mavx2
|
|
|
|
CFLAGS-s_tan-fma.c = -mfma -mavx2
|
|
|
|
|
2018-01-08 16:04:26 +00:00
|
|
|
libm-sysdep_routines += s_sinf-sse2 s_cosf-sse2 s_sincosf-sse2
|
2017-12-07 18:11:02 +00:00
|
|
|
|
2017-10-22 15:07:48 +00:00
|
|
|
libm-sysdep_routines += e_exp2f-fma e_expf-fma e_log2f-fma e_logf-fma \
|
2018-01-08 16:04:26 +00:00
|
|
|
e_powf-fma s_sinf-fma s_cosf-fma s_sincosf-fma
|
2017-08-16 15:43:35 +00:00
|
|
|
|
2017-10-22 14:55:49 +00:00
|
|
|
CFLAGS-e_exp2f-fma.c = -mfma -mavx2
|
2017-10-22 14:49:36 +00:00
|
|
|
CFLAGS-e_expf-fma.c = -mfma -mavx2
|
2017-10-22 15:06:46 +00:00
|
|
|
CFLAGS-e_log2f-fma.c = -mfma -mavx2
|
2017-10-22 15:03:46 +00:00
|
|
|
CFLAGS-e_logf-fma.c = -mfma -mavx2
|
2017-10-22 15:07:48 +00:00
|
|
|
CFLAGS-e_powf-fma.c = -mfma -mavx2
|
2017-12-07 18:11:02 +00:00
|
|
|
CFLAGS-s_sinf-fma.c = -mfma -mavx2
|
2017-12-12 23:32:58 +00:00
|
|
|
CFLAGS-s_cosf-fma.c = -mfma -mavx2
|
2018-01-08 16:04:26 +00:00
|
|
|
CFLAGS-s_sincosf-fma.c = -mfma -mavx2
|
2017-10-22 14:49:36 +00:00
|
|
|
|
2011-10-25 00:19:17 +00:00
|
|
|
libm-sysdep_routines += e_exp-fma4 e_log-fma4 e_pow-fma4 s_atan-fma4 \
|
2021-03-10 12:41:47 +00:00
|
|
|
e_asin-fma4 e_atan2-fma4 s_sin-fma4 s_tan-fma4
|
2011-10-25 00:19:17 +00:00
|
|
|
|
|
|
|
CFLAGS-e_asin-fma4.c = -mfma4
|
|
|
|
CFLAGS-e_atan2-fma4.c = -mfma4
|
|
|
|
CFLAGS-e_exp-fma4.c = -mfma4
|
|
|
|
CFLAGS-e_log-fma4.c = -mfma4
|
2018-06-13 16:57:20 +00:00
|
|
|
CFLAGS-e_pow-fma4.c = -mfma4
|
2011-10-25 00:19:17 +00:00
|
|
|
CFLAGS-s_atan-fma4.c = -mfma4
|
2011-10-26 01:34:55 +00:00
|
|
|
CFLAGS-s_sin-fma4.c = -mfma4
|
|
|
|
CFLAGS-s_tan-fma4.c = -mfma4
|
|
|
|
|
|
|
|
libm-sysdep_routines += e_exp-avx e_log-avx s_atan-avx \
|
2021-03-10 12:41:47 +00:00
|
|
|
e_atan2-avx s_sin-avx s_tan-avx
|
2011-10-26 01:34:55 +00:00
|
|
|
|
2012-01-28 19:48:46 +00:00
|
|
|
CFLAGS-e_atan2-avx.c = -msse2avx -DSSE2AVX
|
|
|
|
CFLAGS-e_exp-avx.c = -msse2avx -DSSE2AVX
|
|
|
|
CFLAGS-e_log-avx.c = -msse2avx -DSSE2AVX
|
|
|
|
CFLAGS-s_atan-avx.c = -msse2avx -DSSE2AVX
|
|
|
|
CFLAGS-s_sin-avx.c = -msse2avx -DSSE2AVX
|
|
|
|
CFLAGS-s_tan-avx.c = -msse2avx -DSSE2AVX
|
2011-10-25 00:19:17 +00:00
|
|
|
endif
|
2015-06-09 11:25:49 +00:00
|
|
|
|
|
|
|
ifeq ($(subdir),mathvec)
|
2021-10-12 01:07:09 +00:00
|
|
|
libmvec-multiarch-double-func-list = \
|
|
|
|
2_core-sse2 \
|
|
|
|
2_core_sse4 \
|
|
|
|
4_core-sse \
|
|
|
|
4_core_avx2 \
|
|
|
|
8_core-avx2 \
|
|
|
|
8_core_avx512
|
|
|
|
libmvec-multiarch-float-func-list = \
|
|
|
|
f4_core-sse2 \
|
|
|
|
f4_core_sse4 \
|
|
|
|
f8_core-sse \
|
|
|
|
f8_core_avx2 \
|
|
|
|
f16_core-avx2 \
|
|
|
|
f16_core_avx512
|
|
|
|
|
|
|
|
libmvec-sysdep_routines += \
|
|
|
|
$(foreach l,$(libmvec-multiarch-double-func-list), \
|
|
|
|
$(addprefix svml_d_,$(addsuffix $(l),$(libmvec-funcs)))) \
|
|
|
|
$(foreach l,$(libmvec-multiarch-float-func-list), \
|
|
|
|
$(addprefix svml_s_,$(addsuffix $(l),$(libmvec-funcs))))
|
2015-06-09 11:25:49 +00:00
|
|
|
endif
|