diff --git a/Makeconfig b/Makeconfig index 24a3b82..4672008 100644 --- a/Makeconfig +++ b/Makeconfig @@ -476,7 +476,7 @@ link-libc = $(link-libc-rpath-link) $(link-libc-before-gnulib) $(gnulib) link-libc-tests = $(link-libc-tests-rpath-link) \ $(link-libc-before-gnulib) $(gnulib-tests) # This is how to find at build-time things that will be installed there. -rpath-dirs = math elf dlfcn nss nis rt resolv crypt +rpath-dirs = math elf dlfcn nss nis rt resolv crypt mathvec rpath-link = \ $(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%))) else @@ -1018,7 +1018,7 @@ all-subdirs = csu assert ctype locale intl catgets math setjmp signal \ stdlib stdio-common libio malloc string wcsmbs time dirent \ grp pwd posix io termios resource misc socket sysvipc gmon \ gnulib iconv iconvdata wctype manual shadow gshadow po argp \ - crypt localedata timezone rt conform debug \ + crypt localedata timezone rt conform debug mathvec \ $(add-on-subdirs) dlfcn elf ifndef avoid-generated diff --git a/bits/math-vector.h b/bits/math-vector.h new file mode 100644 index 0000000..c8fe5cb --- /dev/null +++ b/bits/math-vector.h @@ -0,0 +1,22 @@ +/* Platform-specific SIMD declarations of math functions. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _MATH_H +# error "Never include directly; \ + include instead." +#endif diff --git a/configure b/configure index 89566c5..2c9787d 100755 --- a/configure +++ b/configure @@ -774,6 +774,7 @@ enable_systemtap enable_build_nscd enable_nscd enable_pt_chown +enable_mathvec with_cpu ' ac_precious_vars='build_alias @@ -1437,6 +1438,8 @@ Optional Features: --disable-build-nscd disable building and installing the nscd daemon --disable-nscd library functions will not contact the nscd daemon --enable-pt_chown Enable building and installing pt_chown + --enable-mathvec Enable building and installing mathvec [default=yes + on x86_64 build, else default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -3730,6 +3733,14 @@ if test "$build_pt_chown" = yes; then fi +# Check whether --enable-mathvec was given. +if test "${enable_mathvec+set}" = set; then : + enableval=$enable_mathvec; build_mathvec=$enableval +else + build_mathvec=notset +fi + + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. diff --git a/configure.ac b/configure.ac index 82d0896..b505201 100644 --- a/configure.ac +++ b/configure.ac @@ -353,6 +353,12 @@ if test "$build_pt_chown" = yes; then AC_DEFINE(HAVE_PT_CHOWN) fi +AC_ARG_ENABLE([mathvec], + [AS_HELP_STRING([--enable-mathvec], + [Enable building and installing mathvec @<:@default=yes on x86_64 build, else default=no@:>@])], + [build_mathvec=$enableval], + [build_mathvec=notset]) + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. diff --git a/math/Makefile b/math/Makefile index 866bc0f..c6659aa 100644 --- a/math/Makefile +++ b/math/Makefile @@ -26,7 +26,7 @@ headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \ bits/huge_valf.h bits/huge_vall.h bits/inf.h bits/nan.h \ fpu_control.h complex.h bits/cmathcalls.h fenv.h \ bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \ - bits/math-finite.h + bits/math-finite.h bits/math-vector.h # FPU support code. aux := setfpucw fpu_control @@ -85,6 +85,22 @@ generated += $(foreach s,.c .S l.c l.S f.c f.S,$(calls:s_%=m_%$s)) routines = $(calls) $(calls:=f) $(long-c-$(long-double-fcts)) long-c-yes = $(calls:=l) +ifeq ($(build-mathvect),yes) +# We need to install libm.so as linker script +# for more comfortable use of vector math library. +subdir_install: $(inst_libdir)/libm.so.tmp +$(inst_libdir)/libm.so.tmp: $(common-objpfx)format.lds \ + $(common-objpfx)math/libm.so$(libm.so-version) \ + $(common-objpfx)mathvec/libmvec.so$(libmvec.so-version) \ + $(+force) + (echo '/* GNU ld script */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libm.so$(libm.so-version) ' \ + 'AS_NEEDED ( $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \ + ) > $@ + mv -f $@ $(inst_libdir)/libm.so # TODO do it somehow after all other +endif + # Rules for the test suite. tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \ test-misc test-fpucw test-fpucw-ieee tst-definitions test-tgmath \ diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h index 8a94a7e..2d31a11 100644 --- a/math/bits/mathcalls.h +++ b/math/bits/mathcalls.h @@ -60,6 +60,15 @@ __MATHCALL (atan,, (_Mdouble_ __x)); __MATHCALL (atan2,, (_Mdouble_ __y, _Mdouble_ __x)); /* Cosine of X. */ +#if !defined _Mfloat_ && !defined _Mlong_double_ && defined __DECL_SIMD_cos +__DECL_SIMD_cos +#endif +#if defined _Mfloat_ && !defined _Mlong_double_ && defined __DECL_SIMD_cosf +__DECL_SIMD_cosf +#endif +#if defined _Mlong_double_ && defined __DECL_SIMD_cosl +__DECL_SIMD_cosl +#endif __MATHCALL (cos,, (_Mdouble_ __x)); /* Sine of X. */ __MATHCALL (sin,, (_Mdouble_ __x)); diff --git a/math/have_vector.h b/math/have_vector.h new file mode 100644 index 0000000..94aacf0 --- /dev/null +++ b/math/have_vector.h @@ -0,0 +1,2574 @@ +/* +Definitions below are generated with the following bash script: +for func in $(grep ALL_RM_TEST math/libm-test.inc | awk {'print $2'} | sed -e "s/(//" -e "s/,//"); do +echo "#ifdef __DECL_SIMD_${func}" +echo "# define HAVE_VECTOR_${func} 1" +echo "# define VEC_PREFIX_${func} VEC_PREFIX" +echo "#else" +echo "# define HAVE_VECTOR_${func} 0" +echo "# define VEC_PREFIX_${func}" +echo "#endif" +echo +echo "#ifdef __DECL_SIMD_${func}f" +echo "# define HAVE_VECTOR_${func}f 1" +echo "# define VEC_PREFIX_${func}f VEC_PREFIX" +echo "#else" +echo "# define HAVE_VECTOR_${func}f 0" +echo "# define VEC_PREFIX_${func}f" +echo "#endif" +echo +echo "#ifdef __DECL_SIMD_${func}l" +echo "# define HAVE_VECTOR_${func}l 1" +echo "# define VEC_PREFIX_${func}l VEC_PREFIX" +echo "#else" +echo "# define HAVE_VECTOR_${func}l 0" +echo "# define VEC_PREFIX_${func}l" +echo "#endif" +echo +done +*/ + +#ifdef __DECL_SIMD_finite +# define HAVE_VECTOR_finite 1 +# define VEC_PREFIX_finite VEC_PREFIX +#else +# define HAVE_VECTOR_finite 0 +# define VEC_PREFIX_finite +#endif + +#ifdef __DECL_SIMD_finitef +# define HAVE_VECTOR_finitef 1 +# define VEC_PREFIX_finitef VEC_PREFIX +#else +# define HAVE_VECTOR_finitef 0 +# define VEC_PREFIX_finitef +#endif + +#ifdef __DECL_SIMD_finitel +# define HAVE_VECTOR_finitel 1 +# define VEC_PREFIX_finitel VEC_PREFIX +#else +# define HAVE_VECTOR_finitel 0 +# define VEC_PREFIX_finitel +#endif + +#ifdef __DECL_SIMD_fpclassify +# define HAVE_VECTOR_fpclassify 1 +# define VEC_PREFIX_fpclassify VEC_PREFIX +#else +# define HAVE_VECTOR_fpclassify 0 +# define VEC_PREFIX_fpclassify +#endif + +#ifdef __DECL_SIMD_fpclassifyf +# define HAVE_VECTOR_fpclassifyf 1 +# define VEC_PREFIX_fpclassifyf VEC_PREFIX +#else +# define HAVE_VECTOR_fpclassifyf 0 +# define VEC_PREFIX_fpclassifyf +#endif + +#ifdef __DECL_SIMD_fpclassifyl +# define HAVE_VECTOR_fpclassifyl 1 +# define VEC_PREFIX_fpclassifyl VEC_PREFIX +#else +# define HAVE_VECTOR_fpclassifyl 0 +# define VEC_PREFIX_fpclassifyl +#endif + +#ifdef __DECL_SIMD_isfinite +# define HAVE_VECTOR_isfinite 1 +# define VEC_PREFIX_isfinite VEC_PREFIX +#else +# define HAVE_VECTOR_isfinite 0 +# define VEC_PREFIX_isfinite +#endif + +#ifdef __DECL_SIMD_isfinitef +# define HAVE_VECTOR_isfinitef 1 +# define VEC_PREFIX_isfinitef VEC_PREFIX +#else +# define HAVE_VECTOR_isfinitef 0 +# define VEC_PREFIX_isfinitef +#endif + +#ifdef __DECL_SIMD_isfinitel +# define HAVE_VECTOR_isfinitel 1 +# define VEC_PREFIX_isfinitel VEC_PREFIX +#else +# define HAVE_VECTOR_isfinitel 0 +# define VEC_PREFIX_isfinitel +#endif + +#ifdef __DECL_SIMD_isinf +# define HAVE_VECTOR_isinf 1 +# define VEC_PREFIX_isinf VEC_PREFIX +#else +# define HAVE_VECTOR_isinf 0 +# define VEC_PREFIX_isinf +#endif + +#ifdef __DECL_SIMD_isinff +# define HAVE_VECTOR_isinff 1 +# define VEC_PREFIX_isinff VEC_PREFIX +#else +# define HAVE_VECTOR_isinff 0 +# define VEC_PREFIX_isinff +#endif + +#ifdef __DECL_SIMD_isinfl +# define HAVE_VECTOR_isinfl 1 +# define VEC_PREFIX_isinfl VEC_PREFIX +#else +# define HAVE_VECTOR_isinfl 0 +# define VEC_PREFIX_isinfl +#endif + +#ifdef __DECL_SIMD_isnan +# define HAVE_VECTOR_isnan 1 +# define VEC_PREFIX_isnan VEC_PREFIX +#else +# define HAVE_VECTOR_isnan 0 +# define VEC_PREFIX_isnan +#endif + +#ifdef __DECL_SIMD_isnanf +# define HAVE_VECTOR_isnanf 1 +# define VEC_PREFIX_isnanf VEC_PREFIX +#else +# define HAVE_VECTOR_isnanf 0 +# define VEC_PREFIX_isnanf +#endif + +#ifdef __DECL_SIMD_isnanl +# define HAVE_VECTOR_isnanl 1 +# define VEC_PREFIX_isnanl VEC_PREFIX +#else +# define HAVE_VECTOR_isnanl 0 +# define VEC_PREFIX_isnanl +#endif + +#ifdef __DECL_SIMD_isnormal +# define HAVE_VECTOR_isnormal 1 +# define VEC_PREFIX_isnormal VEC_PREFIX +#else +# define HAVE_VECTOR_isnormal 0 +# define VEC_PREFIX_isnormal +#endif + +#ifdef __DECL_SIMD_isnormalf +# define HAVE_VECTOR_isnormalf 1 +# define VEC_PREFIX_isnormalf VEC_PREFIX +#else +# define HAVE_VECTOR_isnormalf 0 +# define VEC_PREFIX_isnormalf +#endif + +#ifdef __DECL_SIMD_isnormall +# define HAVE_VECTOR_isnormall 1 +# define VEC_PREFIX_isnormall VEC_PREFIX +#else +# define HAVE_VECTOR_isnormall 0 +# define VEC_PREFIX_isnormall +#endif + +#ifdef __DECL_SIMD_issignaling +# define HAVE_VECTOR_issignaling 1 +# define VEC_PREFIX_issignaling VEC_PREFIX +#else +# define HAVE_VECTOR_issignaling 0 +# define VEC_PREFIX_issignaling +#endif + +#ifdef __DECL_SIMD_issignalingf +# define HAVE_VECTOR_issignalingf 1 +# define VEC_PREFIX_issignalingf VEC_PREFIX +#else +# define HAVE_VECTOR_issignalingf 0 +# define VEC_PREFIX_issignalingf +#endif + +#ifdef __DECL_SIMD_issignalingl +# define HAVE_VECTOR_issignalingl 1 +# define VEC_PREFIX_issignalingl VEC_PREFIX +#else +# define HAVE_VECTOR_issignalingl 0 +# define VEC_PREFIX_issignalingl +#endif + +#ifdef __DECL_SIMD_signbit +# define HAVE_VECTOR_signbit 1 +# define VEC_PREFIX_signbit VEC_PREFIX +#else +# define HAVE_VECTOR_signbit 0 +# define VEC_PREFIX_signbit +#endif + +#ifdef __DECL_SIMD_signbitf +# define HAVE_VECTOR_signbitf 1 +# define VEC_PREFIX_signbitf VEC_PREFIX +#else +# define HAVE_VECTOR_signbitf 0 +# define VEC_PREFIX_signbitf +#endif + +#ifdef __DECL_SIMD_signbitl +# define HAVE_VECTOR_signbitl 1 +# define VEC_PREFIX_signbitl VEC_PREFIX +#else +# define HAVE_VECTOR_signbitl 0 +# define VEC_PREFIX_signbitl +#endif + +#ifdef __DECL_SIMD_acos +# define HAVE_VECTOR_acos 1 +# define VEC_PREFIX_acos VEC_PREFIX +#else +# define HAVE_VECTOR_acos 0 +# define VEC_PREFIX_acos +#endif + +#ifdef __DECL_SIMD_acosf +# define HAVE_VECTOR_acosf 1 +# define VEC_PREFIX_acosf VEC_PREFIX +#else +# define HAVE_VECTOR_acosf 0 +# define VEC_PREFIX_acosf +#endif + +#ifdef __DECL_SIMD_acosl +# define HAVE_VECTOR_acosl 1 +# define VEC_PREFIX_acosl VEC_PREFIX +#else +# define HAVE_VECTOR_acosl 0 +# define VEC_PREFIX_acosl +#endif + +#ifdef __DECL_SIMD_asin +# define HAVE_VECTOR_asin 1 +# define VEC_PREFIX_asin VEC_PREFIX +#else +# define HAVE_VECTOR_asin 0 +# define VEC_PREFIX_asin +#endif + +#ifdef __DECL_SIMD_asinf +# define HAVE_VECTOR_asinf 1 +# define VEC_PREFIX_asinf VEC_PREFIX +#else +# define HAVE_VECTOR_asinf 0 +# define VEC_PREFIX_asinf +#endif + +#ifdef __DECL_SIMD_asinl +# define HAVE_VECTOR_asinl 1 +# define VEC_PREFIX_asinl VEC_PREFIX +#else +# define HAVE_VECTOR_asinl 0 +# define VEC_PREFIX_asinl +#endif + +#ifdef __DECL_SIMD_atan +# define HAVE_VECTOR_atan 1 +# define VEC_PREFIX_atan VEC_PREFIX +#else +# define HAVE_VECTOR_atan 0 +# define VEC_PREFIX_atan +#endif + +#ifdef __DECL_SIMD_atanf +# define HAVE_VECTOR_atanf 1 +# define VEC_PREFIX_atanf VEC_PREFIX +#else +# define HAVE_VECTOR_atanf 0 +# define VEC_PREFIX_atanf +#endif + +#ifdef __DECL_SIMD_atanl +# define HAVE_VECTOR_atanl 1 +# define VEC_PREFIX_atanl VEC_PREFIX +#else +# define HAVE_VECTOR_atanl 0 +# define VEC_PREFIX_atanl +#endif + +#ifdef __DECL_SIMD_atan2 +# define HAVE_VECTOR_atan2 1 +# define VEC_PREFIX_atan2 VEC_PREFIX +#else +# define HAVE_VECTOR_atan2 0 +# define VEC_PREFIX_atan2 +#endif + +#ifdef __DECL_SIMD_atan2f +# define HAVE_VECTOR_atan2f 1 +# define VEC_PREFIX_atan2f VEC_PREFIX +#else +# define HAVE_VECTOR_atan2f 0 +# define VEC_PREFIX_atan2f +#endif + +#ifdef __DECL_SIMD_atan2l +# define HAVE_VECTOR_atan2l 1 +# define VEC_PREFIX_atan2l VEC_PREFIX +#else +# define HAVE_VECTOR_atan2l 0 +# define VEC_PREFIX_atan2l +#endif + +#ifdef __DECL_SIMD_cos +# define HAVE_VECTOR_cos 1 +# define VEC_PREFIX_cos VEC_PREFIX +#else +# define HAVE_VECTOR_cos 0 +# define VEC_PREFIX_cos +#endif + +#ifdef __DECL_SIMD_cosf +# define HAVE_VECTOR_cosf 1 +# define VEC_PREFIX_cosf VEC_PREFIX +#else +# define HAVE_VECTOR_cosf 0 +# define VEC_PREFIX_cosf +#endif + +#ifdef __DECL_SIMD_cosl +# define HAVE_VECTOR_cosl 1 +# define VEC_PREFIX_cosl VEC_PREFIX +#else +# define HAVE_VECTOR_cosl 0 +# define VEC_PREFIX_cosl +#endif + +#ifdef __DECL_SIMD_sin +# define HAVE_VECTOR_sin 1 +# define VEC_PREFIX_sin VEC_PREFIX +#else +# define HAVE_VECTOR_sin 0 +# define VEC_PREFIX_sin +#endif + +#ifdef __DECL_SIMD_sinf +# define HAVE_VECTOR_sinf 1 +# define VEC_PREFIX_sinf VEC_PREFIX +#else +# define HAVE_VECTOR_sinf 0 +# define VEC_PREFIX_sinf +#endif + +#ifdef __DECL_SIMD_sinl +# define HAVE_VECTOR_sinl 1 +# define VEC_PREFIX_sinl VEC_PREFIX +#else +# define HAVE_VECTOR_sinl 0 +# define VEC_PREFIX_sinl +#endif + +#ifdef __DECL_SIMD_sincos +# define HAVE_VECTOR_sincos 1 +# define VEC_PREFIX_sincos VEC_PREFIX +#else +# define HAVE_VECTOR_sincos 0 +# define VEC_PREFIX_sincos +#endif + +#ifdef __DECL_SIMD_sincosf +# define HAVE_VECTOR_sincosf 1 +# define VEC_PREFIX_sincosf VEC_PREFIX +#else +# define HAVE_VECTOR_sincosf 0 +# define VEC_PREFIX_sincosf +#endif + +#ifdef __DECL_SIMD_sincosl +# define HAVE_VECTOR_sincosl 1 +# define VEC_PREFIX_sincosl VEC_PREFIX +#else +# define HAVE_VECTOR_sincosl 0 +# define VEC_PREFIX_sincosl +#endif + +#ifdef __DECL_SIMD_tan +# define HAVE_VECTOR_tan 1 +# define VEC_PREFIX_tan VEC_PREFIX +#else +# define HAVE_VECTOR_tan 0 +# define VEC_PREFIX_tan +#endif + +#ifdef __DECL_SIMD_tanf +# define HAVE_VECTOR_tanf 1 +# define VEC_PREFIX_tanf VEC_PREFIX +#else +# define HAVE_VECTOR_tanf 0 +# define VEC_PREFIX_tanf +#endif + +#ifdef __DECL_SIMD_tanl +# define HAVE_VECTOR_tanl 1 +# define VEC_PREFIX_tanl VEC_PREFIX +#else +# define HAVE_VECTOR_tanl 0 +# define VEC_PREFIX_tanl +#endif + +#ifdef __DECL_SIMD_acosh +# define HAVE_VECTOR_acosh 1 +# define VEC_PREFIX_acosh VEC_PREFIX +#else +# define HAVE_VECTOR_acosh 0 +# define VEC_PREFIX_acosh +#endif + +#ifdef __DECL_SIMD_acoshf +# define HAVE_VECTOR_acoshf 1 +# define VEC_PREFIX_acoshf VEC_PREFIX +#else +# define HAVE_VECTOR_acoshf 0 +# define VEC_PREFIX_acoshf +#endif + +#ifdef __DECL_SIMD_acoshl +# define HAVE_VECTOR_acoshl 1 +# define VEC_PREFIX_acoshl VEC_PREFIX +#else +# define HAVE_VECTOR_acoshl 0 +# define VEC_PREFIX_acoshl +#endif + +#ifdef __DECL_SIMD_asinh +# define HAVE_VECTOR_asinh 1 +# define VEC_PREFIX_asinh VEC_PREFIX +#else +# define HAVE_VECTOR_asinh 0 +# define VEC_PREFIX_asinh +#endif + +#ifdef __DECL_SIMD_asinhf +# define HAVE_VECTOR_asinhf 1 +# define VEC_PREFIX_asinhf VEC_PREFIX +#else +# define HAVE_VECTOR_asinhf 0 +# define VEC_PREFIX_asinhf +#endif + +#ifdef __DECL_SIMD_asinhl +# define HAVE_VECTOR_asinhl 1 +# define VEC_PREFIX_asinhl VEC_PREFIX +#else +# define HAVE_VECTOR_asinhl 0 +# define VEC_PREFIX_asinhl +#endif + +#ifdef __DECL_SIMD_atanh +# define HAVE_VECTOR_atanh 1 +# define VEC_PREFIX_atanh VEC_PREFIX +#else +# define HAVE_VECTOR_atanh 0 +# define VEC_PREFIX_atanh +#endif + +#ifdef __DECL_SIMD_atanhf +# define HAVE_VECTOR_atanhf 1 +# define VEC_PREFIX_atanhf VEC_PREFIX +#else +# define HAVE_VECTOR_atanhf 0 +# define VEC_PREFIX_atanhf +#endif + +#ifdef __DECL_SIMD_atanhl +# define HAVE_VECTOR_atanhl 1 +# define VEC_PREFIX_atanhl VEC_PREFIX +#else +# define HAVE_VECTOR_atanhl 0 +# define VEC_PREFIX_atanhl +#endif + +#ifdef __DECL_SIMD_cosh +# define HAVE_VECTOR_cosh 1 +# define VEC_PREFIX_cosh VEC_PREFIX +#else +# define HAVE_VECTOR_cosh 0 +# define VEC_PREFIX_cosh +#endif + +#ifdef __DECL_SIMD_coshf +# define HAVE_VECTOR_coshf 1 +# define VEC_PREFIX_coshf VEC_PREFIX +#else +# define HAVE_VECTOR_coshf 0 +# define VEC_PREFIX_coshf +#endif + +#ifdef __DECL_SIMD_coshl +# define HAVE_VECTOR_coshl 1 +# define VEC_PREFIX_coshl VEC_PREFIX +#else +# define HAVE_VECTOR_coshl 0 +# define VEC_PREFIX_coshl +#endif + +#ifdef __DECL_SIMD_sinh +# define HAVE_VECTOR_sinh 1 +# define VEC_PREFIX_sinh VEC_PREFIX +#else +# define HAVE_VECTOR_sinh 0 +# define VEC_PREFIX_sinh +#endif + +#ifdef __DECL_SIMD_sinhf +# define HAVE_VECTOR_sinhf 1 +# define VEC_PREFIX_sinhf VEC_PREFIX +#else +# define HAVE_VECTOR_sinhf 0 +# define VEC_PREFIX_sinhf +#endif + +#ifdef __DECL_SIMD_sinhl +# define HAVE_VECTOR_sinhl 1 +# define VEC_PREFIX_sinhl VEC_PREFIX +#else +# define HAVE_VECTOR_sinhl 0 +# define VEC_PREFIX_sinhl +#endif + +#ifdef __DECL_SIMD_tanh +# define HAVE_VECTOR_tanh 1 +# define VEC_PREFIX_tanh VEC_PREFIX +#else +# define HAVE_VECTOR_tanh 0 +# define VEC_PREFIX_tanh +#endif + +#ifdef __DECL_SIMD_tanhf +# define HAVE_VECTOR_tanhf 1 +# define VEC_PREFIX_tanhf VEC_PREFIX +#else +# define HAVE_VECTOR_tanhf 0 +# define VEC_PREFIX_tanhf +#endif + +#ifdef __DECL_SIMD_tanhl +# define HAVE_VECTOR_tanhl 1 +# define VEC_PREFIX_tanhl VEC_PREFIX +#else +# define HAVE_VECTOR_tanhl 0 +# define VEC_PREFIX_tanhl +#endif + +#ifdef __DECL_SIMD_exp +# define HAVE_VECTOR_exp 1 +# define VEC_PREFIX_exp VEC_PREFIX +#else +# define HAVE_VECTOR_exp 0 +# define VEC_PREFIX_exp +#endif + +#ifdef __DECL_SIMD_expf +# define HAVE_VECTOR_expf 1 +# define VEC_PREFIX_expf VEC_PREFIX +#else +# define HAVE_VECTOR_expf 0 +# define VEC_PREFIX_expf +#endif + +#ifdef __DECL_SIMD_expl +# define HAVE_VECTOR_expl 1 +# define VEC_PREFIX_expl VEC_PREFIX +#else +# define HAVE_VECTOR_expl 0 +# define VEC_PREFIX_expl +#endif + +#ifdef __DECL_SIMD_exp10 +# define HAVE_VECTOR_exp10 1 +# define VEC_PREFIX_exp10 VEC_PREFIX +#else +# define HAVE_VECTOR_exp10 0 +# define VEC_PREFIX_exp10 +#endif + +#ifdef __DECL_SIMD_exp10f +# define HAVE_VECTOR_exp10f 1 +# define VEC_PREFIX_exp10f VEC_PREFIX +#else +# define HAVE_VECTOR_exp10f 0 +# define VEC_PREFIX_exp10f +#endif + +#ifdef __DECL_SIMD_exp10l +# define HAVE_VECTOR_exp10l 1 +# define VEC_PREFIX_exp10l VEC_PREFIX +#else +# define HAVE_VECTOR_exp10l 0 +# define VEC_PREFIX_exp10l +#endif + +#ifdef __DECL_SIMD_exp2 +# define HAVE_VECTOR_exp2 1 +# define VEC_PREFIX_exp2 VEC_PREFIX +#else +# define HAVE_VECTOR_exp2 0 +# define VEC_PREFIX_exp2 +#endif + +#ifdef __DECL_SIMD_exp2f +# define HAVE_VECTOR_exp2f 1 +# define VEC_PREFIX_exp2f VEC_PREFIX +#else +# define HAVE_VECTOR_exp2f 0 +# define VEC_PREFIX_exp2f +#endif + +#ifdef __DECL_SIMD_exp2l +# define HAVE_VECTOR_exp2l 1 +# define VEC_PREFIX_exp2l VEC_PREFIX +#else +# define HAVE_VECTOR_exp2l 0 +# define VEC_PREFIX_exp2l +#endif + +#ifdef __DECL_SIMD_expm1 +# define HAVE_VECTOR_expm1 1 +# define VEC_PREFIX_expm1 VEC_PREFIX +#else +# define HAVE_VECTOR_expm1 0 +# define VEC_PREFIX_expm1 +#endif + +#ifdef __DECL_SIMD_expm1f +# define HAVE_VECTOR_expm1f 1 +# define VEC_PREFIX_expm1f VEC_PREFIX +#else +# define HAVE_VECTOR_expm1f 0 +# define VEC_PREFIX_expm1f +#endif + +#ifdef __DECL_SIMD_expm1l +# define HAVE_VECTOR_expm1l 1 +# define VEC_PREFIX_expm1l VEC_PREFIX +#else +# define HAVE_VECTOR_expm1l 0 +# define VEC_PREFIX_expm1l +#endif + +#ifdef __DECL_SIMD_frexp +# define HAVE_VECTOR_frexp 1 +# define VEC_PREFIX_frexp VEC_PREFIX +#else +# define HAVE_VECTOR_frexp 0 +# define VEC_PREFIX_frexp +#endif + +#ifdef __DECL_SIMD_frexpf +# define HAVE_VECTOR_frexpf 1 +# define VEC_PREFIX_frexpf VEC_PREFIX +#else +# define HAVE_VECTOR_frexpf 0 +# define VEC_PREFIX_frexpf +#endif + +#ifdef __DECL_SIMD_frexpl +# define HAVE_VECTOR_frexpl 1 +# define VEC_PREFIX_frexpl VEC_PREFIX +#else +# define HAVE_VECTOR_frexpl 0 +# define VEC_PREFIX_frexpl +#endif + +#ifdef __DECL_SIMD_ldexp +# define HAVE_VECTOR_ldexp 1 +# define VEC_PREFIX_ldexp VEC_PREFIX +#else +# define HAVE_VECTOR_ldexp 0 +# define VEC_PREFIX_ldexp +#endif + +#ifdef __DECL_SIMD_ldexpf +# define HAVE_VECTOR_ldexpf 1 +# define VEC_PREFIX_ldexpf VEC_PREFIX +#else +# define HAVE_VECTOR_ldexpf 0 +# define VEC_PREFIX_ldexpf +#endif + +#ifdef __DECL_SIMD_ldexpl +# define HAVE_VECTOR_ldexpl 1 +# define VEC_PREFIX_ldexpl VEC_PREFIX +#else +# define HAVE_VECTOR_ldexpl 0 +# define VEC_PREFIX_ldexpl +#endif + +#ifdef __DECL_SIMD_log +# define HAVE_VECTOR_log 1 +# define VEC_PREFIX_log VEC_PREFIX +#else +# define HAVE_VECTOR_log 0 +# define VEC_PREFIX_log +#endif + +#ifdef __DECL_SIMD_logf +# define HAVE_VECTOR_logf 1 +# define VEC_PREFIX_logf VEC_PREFIX +#else +# define HAVE_VECTOR_logf 0 +# define VEC_PREFIX_logf +#endif + +#ifdef __DECL_SIMD_logl +# define HAVE_VECTOR_logl 1 +# define VEC_PREFIX_logl VEC_PREFIX +#else +# define HAVE_VECTOR_logl 0 +# define VEC_PREFIX_logl +#endif + +#ifdef __DECL_SIMD_log10 +# define HAVE_VECTOR_log10 1 +# define VEC_PREFIX_log10 VEC_PREFIX +#else +# define HAVE_VECTOR_log10 0 +# define VEC_PREFIX_log10 +#endif + +#ifdef __DECL_SIMD_log10f +# define HAVE_VECTOR_log10f 1 +# define VEC_PREFIX_log10f VEC_PREFIX +#else +# define HAVE_VECTOR_log10f 0 +# define VEC_PREFIX_log10f +#endif + +#ifdef __DECL_SIMD_log10l +# define HAVE_VECTOR_log10l 1 +# define VEC_PREFIX_log10l VEC_PREFIX +#else +# define HAVE_VECTOR_log10l 0 +# define VEC_PREFIX_log10l +#endif + +#ifdef __DECL_SIMD_log1p +# define HAVE_VECTOR_log1p 1 +# define VEC_PREFIX_log1p VEC_PREFIX +#else +# define HAVE_VECTOR_log1p 0 +# define VEC_PREFIX_log1p +#endif + +#ifdef __DECL_SIMD_log1pf +# define HAVE_VECTOR_log1pf 1 +# define VEC_PREFIX_log1pf VEC_PREFIX +#else +# define HAVE_VECTOR_log1pf 0 +# define VEC_PREFIX_log1pf +#endif + +#ifdef __DECL_SIMD_log1pl +# define HAVE_VECTOR_log1pl 1 +# define VEC_PREFIX_log1pl VEC_PREFIX +#else +# define HAVE_VECTOR_log1pl 0 +# define VEC_PREFIX_log1pl +#endif + +#ifdef __DECL_SIMD_log2 +# define HAVE_VECTOR_log2 1 +# define VEC_PREFIX_log2 VEC_PREFIX +#else +# define HAVE_VECTOR_log2 0 +# define VEC_PREFIX_log2 +#endif + +#ifdef __DECL_SIMD_log2f +# define HAVE_VECTOR_log2f 1 +# define VEC_PREFIX_log2f VEC_PREFIX +#else +# define HAVE_VECTOR_log2f 0 +# define VEC_PREFIX_log2f +#endif + +#ifdef __DECL_SIMD_log2l +# define HAVE_VECTOR_log2l 1 +# define VEC_PREFIX_log2l VEC_PREFIX +#else +# define HAVE_VECTOR_log2l 0 +# define VEC_PREFIX_log2l +#endif + +#ifdef __DECL_SIMD_logb +# define HAVE_VECTOR_logb 1 +# define VEC_PREFIX_logb VEC_PREFIX +#else +# define HAVE_VECTOR_logb 0 +# define VEC_PREFIX_logb +#endif + +#ifdef __DECL_SIMD_logbf +# define HAVE_VECTOR_logbf 1 +# define VEC_PREFIX_logbf VEC_PREFIX +#else +# define HAVE_VECTOR_logbf 0 +# define VEC_PREFIX_logbf +#endif + +#ifdef __DECL_SIMD_logbl +# define HAVE_VECTOR_logbl 1 +# define VEC_PREFIX_logbl VEC_PREFIX +#else +# define HAVE_VECTOR_logbl 0 +# define VEC_PREFIX_logbl +#endif + +#ifdef __DECL_SIMD_modf +# define HAVE_VECTOR_modf 1 +# define VEC_PREFIX_modf VEC_PREFIX +#else +# define HAVE_VECTOR_modf 0 +# define VEC_PREFIX_modf +#endif + +#ifdef __DECL_SIMD_modff +# define HAVE_VECTOR_modff 1 +# define VEC_PREFIX_modff VEC_PREFIX +#else +# define HAVE_VECTOR_modff 0 +# define VEC_PREFIX_modff +#endif + +#ifdef __DECL_SIMD_modfl +# define HAVE_VECTOR_modfl 1 +# define VEC_PREFIX_modfl VEC_PREFIX +#else +# define HAVE_VECTOR_modfl 0 +# define VEC_PREFIX_modfl +#endif + +#ifdef __DECL_SIMD_pow10 +# define HAVE_VECTOR_pow10 1 +# define VEC_PREFIX_pow10 VEC_PREFIX +#else +# define HAVE_VECTOR_pow10 0 +# define VEC_PREFIX_pow10 +#endif + +#ifdef __DECL_SIMD_pow10f +# define HAVE_VECTOR_pow10f 1 +# define VEC_PREFIX_pow10f VEC_PREFIX +#else +# define HAVE_VECTOR_pow10f 0 +# define VEC_PREFIX_pow10f +#endif + +#ifdef __DECL_SIMD_pow10l +# define HAVE_VECTOR_pow10l 1 +# define VEC_PREFIX_pow10l VEC_PREFIX +#else +# define HAVE_VECTOR_pow10l 0 +# define VEC_PREFIX_pow10l +#endif + +#ifdef __DECL_SIMD_ilogb +# define HAVE_VECTOR_ilogb 1 +# define VEC_PREFIX_ilogb VEC_PREFIX +#else +# define HAVE_VECTOR_ilogb 0 +# define VEC_PREFIX_ilogb +#endif + +#ifdef __DECL_SIMD_ilogbf +# define HAVE_VECTOR_ilogbf 1 +# define VEC_PREFIX_ilogbf VEC_PREFIX +#else +# define HAVE_VECTOR_ilogbf 0 +# define VEC_PREFIX_ilogbf +#endif + +#ifdef __DECL_SIMD_ilogbl +# define HAVE_VECTOR_ilogbl 1 +# define VEC_PREFIX_ilogbl VEC_PREFIX +#else +# define HAVE_VECTOR_ilogbl 0 +# define VEC_PREFIX_ilogbl +#endif + +#ifdef __DECL_SIMD_scalb +# define HAVE_VECTOR_scalb 1 +# define VEC_PREFIX_scalb VEC_PREFIX +#else +# define HAVE_VECTOR_scalb 0 +# define VEC_PREFIX_scalb +#endif + +#ifdef __DECL_SIMD_scalbf +# define HAVE_VECTOR_scalbf 1 +# define VEC_PREFIX_scalbf VEC_PREFIX +#else +# define HAVE_VECTOR_scalbf 0 +# define VEC_PREFIX_scalbf +#endif + +#ifdef __DECL_SIMD_scalbl +# define HAVE_VECTOR_scalbl 1 +# define VEC_PREFIX_scalbl VEC_PREFIX +#else +# define HAVE_VECTOR_scalbl 0 +# define VEC_PREFIX_scalbl +#endif + +#ifdef __DECL_SIMD_scalbn +# define HAVE_VECTOR_scalbn 1 +# define VEC_PREFIX_scalbn VEC_PREFIX +#else +# define HAVE_VECTOR_scalbn 0 +# define VEC_PREFIX_scalbn +#endif + +#ifdef __DECL_SIMD_scalbnf +# define HAVE_VECTOR_scalbnf 1 +# define VEC_PREFIX_scalbnf VEC_PREFIX +#else +# define HAVE_VECTOR_scalbnf 0 +# define VEC_PREFIX_scalbnf +#endif + +#ifdef __DECL_SIMD_scalbnl +# define HAVE_VECTOR_scalbnl 1 +# define VEC_PREFIX_scalbnl VEC_PREFIX +#else +# define HAVE_VECTOR_scalbnl 0 +# define VEC_PREFIX_scalbnl +#endif + +#ifdef __DECL_SIMD_scalbln +# define HAVE_VECTOR_scalbln 1 +# define VEC_PREFIX_scalbln VEC_PREFIX +#else +# define HAVE_VECTOR_scalbln 0 +# define VEC_PREFIX_scalbln +#endif + +#ifdef __DECL_SIMD_scalblnf +# define HAVE_VECTOR_scalblnf 1 +# define VEC_PREFIX_scalblnf VEC_PREFIX +#else +# define HAVE_VECTOR_scalblnf 0 +# define VEC_PREFIX_scalblnf +#endif + +#ifdef __DECL_SIMD_scalblnl +# define HAVE_VECTOR_scalblnl 1 +# define VEC_PREFIX_scalblnl VEC_PREFIX +#else +# define HAVE_VECTOR_scalblnl 0 +# define VEC_PREFIX_scalblnl +#endif + +#ifdef __DECL_SIMD_significand +# define HAVE_VECTOR_significand 1 +# define VEC_PREFIX_significand VEC_PREFIX +#else +# define HAVE_VECTOR_significand 0 +# define VEC_PREFIX_significand +#endif + +#ifdef __DECL_SIMD_significandf +# define HAVE_VECTOR_significandf 1 +# define VEC_PREFIX_significandf VEC_PREFIX +#else +# define HAVE_VECTOR_significandf 0 +# define VEC_PREFIX_significandf +#endif + +#ifdef __DECL_SIMD_significandl +# define HAVE_VECTOR_significandl 1 +# define VEC_PREFIX_significandl VEC_PREFIX +#else +# define HAVE_VECTOR_significandl 0 +# define VEC_PREFIX_significandl +#endif + +#ifdef __DECL_SIMD_cbrt +# define HAVE_VECTOR_cbrt 1 +# define VEC_PREFIX_cbrt VEC_PREFIX +#else +# define HAVE_VECTOR_cbrt 0 +# define VEC_PREFIX_cbrt +#endif + +#ifdef __DECL_SIMD_cbrtf +# define HAVE_VECTOR_cbrtf 1 +# define VEC_PREFIX_cbrtf VEC_PREFIX +#else +# define HAVE_VECTOR_cbrtf 0 +# define VEC_PREFIX_cbrtf +#endif + +#ifdef __DECL_SIMD_cbrtl +# define HAVE_VECTOR_cbrtl 1 +# define VEC_PREFIX_cbrtl VEC_PREFIX +#else +# define HAVE_VECTOR_cbrtl 0 +# define VEC_PREFIX_cbrtl +#endif + +#ifdef __DECL_SIMD_fabs +# define HAVE_VECTOR_fabs 1 +# define VEC_PREFIX_fabs VEC_PREFIX +#else +# define HAVE_VECTOR_fabs 0 +# define VEC_PREFIX_fabs +#endif + +#ifdef __DECL_SIMD_fabsf +# define HAVE_VECTOR_fabsf 1 +# define VEC_PREFIX_fabsf VEC_PREFIX +#else +# define HAVE_VECTOR_fabsf 0 +# define VEC_PREFIX_fabsf +#endif + +#ifdef __DECL_SIMD_fabsl +# define HAVE_VECTOR_fabsl 1 +# define VEC_PREFIX_fabsl VEC_PREFIX +#else +# define HAVE_VECTOR_fabsl 0 +# define VEC_PREFIX_fabsl +#endif + +#ifdef __DECL_SIMD_hypot +# define HAVE_VECTOR_hypot 1 +# define VEC_PREFIX_hypot VEC_PREFIX +#else +# define HAVE_VECTOR_hypot 0 +# define VEC_PREFIX_hypot +#endif + +#ifdef __DECL_SIMD_hypotf +# define HAVE_VECTOR_hypotf 1 +# define VEC_PREFIX_hypotf VEC_PREFIX +#else +# define HAVE_VECTOR_hypotf 0 +# define VEC_PREFIX_hypotf +#endif + +#ifdef __DECL_SIMD_hypotl +# define HAVE_VECTOR_hypotl 1 +# define VEC_PREFIX_hypotl VEC_PREFIX +#else +# define HAVE_VECTOR_hypotl 0 +# define VEC_PREFIX_hypotl +#endif + +#ifdef __DECL_SIMD_pow +# define HAVE_VECTOR_pow 1 +# define VEC_PREFIX_pow VEC_PREFIX +#else +# define HAVE_VECTOR_pow 0 +# define VEC_PREFIX_pow +#endif + +#ifdef __DECL_SIMD_powf +# define HAVE_VECTOR_powf 1 +# define VEC_PREFIX_powf VEC_PREFIX +#else +# define HAVE_VECTOR_powf 0 +# define VEC_PREFIX_powf +#endif + +#ifdef __DECL_SIMD_powl +# define HAVE_VECTOR_powl 1 +# define VEC_PREFIX_powl VEC_PREFIX +#else +# define HAVE_VECTOR_powl 0 +# define VEC_PREFIX_powl +#endif + +#ifdef __DECL_SIMD_sqrt +# define HAVE_VECTOR_sqrt 1 +# define VEC_PREFIX_sqrt VEC_PREFIX +#else +# define HAVE_VECTOR_sqrt 0 +# define VEC_PREFIX_sqrt +#endif + +#ifdef __DECL_SIMD_sqrtf +# define HAVE_VECTOR_sqrtf 1 +# define VEC_PREFIX_sqrtf VEC_PREFIX +#else +# define HAVE_VECTOR_sqrtf 0 +# define VEC_PREFIX_sqrtf +#endif + +#ifdef __DECL_SIMD_sqrtl +# define HAVE_VECTOR_sqrtl 1 +# define VEC_PREFIX_sqrtl VEC_PREFIX +#else +# define HAVE_VECTOR_sqrtl 0 +# define VEC_PREFIX_sqrtl +#endif + +#ifdef __DECL_SIMD_erf +# define HAVE_VECTOR_erf 1 +# define VEC_PREFIX_erf VEC_PREFIX +#else +# define HAVE_VECTOR_erf 0 +# define VEC_PREFIX_erf +#endif + +#ifdef __DECL_SIMD_erff +# define HAVE_VECTOR_erff 1 +# define VEC_PREFIX_erff VEC_PREFIX +#else +# define HAVE_VECTOR_erff 0 +# define VEC_PREFIX_erff +#endif + +#ifdef __DECL_SIMD_erfl +# define HAVE_VECTOR_erfl 1 +# define VEC_PREFIX_erfl VEC_PREFIX +#else +# define HAVE_VECTOR_erfl 0 +# define VEC_PREFIX_erfl +#endif + +#ifdef __DECL_SIMD_erfc +# define HAVE_VECTOR_erfc 1 +# define VEC_PREFIX_erfc VEC_PREFIX +#else +# define HAVE_VECTOR_erfc 0 +# define VEC_PREFIX_erfc +#endif + +#ifdef __DECL_SIMD_erfcf +# define HAVE_VECTOR_erfcf 1 +# define VEC_PREFIX_erfcf VEC_PREFIX +#else +# define HAVE_VECTOR_erfcf 0 +# define VEC_PREFIX_erfcf +#endif + +#ifdef __DECL_SIMD_erfcl +# define HAVE_VECTOR_erfcl 1 +# define VEC_PREFIX_erfcl VEC_PREFIX +#else +# define HAVE_VECTOR_erfcl 0 +# define VEC_PREFIX_erfcl +#endif + +#ifdef __DECL_SIMD_gamma +# define HAVE_VECTOR_gamma 1 +# define VEC_PREFIX_gamma VEC_PREFIX +#else +# define HAVE_VECTOR_gamma 0 +# define VEC_PREFIX_gamma +#endif + +#ifdef __DECL_SIMD_gammaf +# define HAVE_VECTOR_gammaf 1 +# define VEC_PREFIX_gammaf VEC_PREFIX +#else +# define HAVE_VECTOR_gammaf 0 +# define VEC_PREFIX_gammaf +#endif + +#ifdef __DECL_SIMD_gammal +# define HAVE_VECTOR_gammal 1 +# define VEC_PREFIX_gammal VEC_PREFIX +#else +# define HAVE_VECTOR_gammal 0 +# define VEC_PREFIX_gammal +#endif + +#ifdef __DECL_SIMD_lgamma +# define HAVE_VECTOR_lgamma 1 +# define VEC_PREFIX_lgamma VEC_PREFIX +#else +# define HAVE_VECTOR_lgamma 0 +# define VEC_PREFIX_lgamma +#endif + +#ifdef __DECL_SIMD_lgammaf +# define HAVE_VECTOR_lgammaf 1 +# define VEC_PREFIX_lgammaf VEC_PREFIX +#else +# define HAVE_VECTOR_lgammaf 0 +# define VEC_PREFIX_lgammaf +#endif + +#ifdef __DECL_SIMD_lgammal +# define HAVE_VECTOR_lgammal 1 +# define VEC_PREFIX_lgammal VEC_PREFIX +#else +# define HAVE_VECTOR_lgammal 0 +# define VEC_PREFIX_lgammal +#endif + +#ifdef __DECL_SIMD_tgamma +# define HAVE_VECTOR_tgamma 1 +# define VEC_PREFIX_tgamma VEC_PREFIX +#else +# define HAVE_VECTOR_tgamma 0 +# define VEC_PREFIX_tgamma +#endif + +#ifdef __DECL_SIMD_tgammaf +# define HAVE_VECTOR_tgammaf 1 +# define VEC_PREFIX_tgammaf VEC_PREFIX +#else +# define HAVE_VECTOR_tgammaf 0 +# define VEC_PREFIX_tgammaf +#endif + +#ifdef __DECL_SIMD_tgammal +# define HAVE_VECTOR_tgammal 1 +# define VEC_PREFIX_tgammal VEC_PREFIX +#else +# define HAVE_VECTOR_tgammal 0 +# define VEC_PREFIX_tgammal +#endif + +#ifdef __DECL_SIMD_ceil +# define HAVE_VECTOR_ceil 1 +# define VEC_PREFIX_ceil VEC_PREFIX +#else +# define HAVE_VECTOR_ceil 0 +# define VEC_PREFIX_ceil +#endif + +#ifdef __DECL_SIMD_ceilf +# define HAVE_VECTOR_ceilf 1 +# define VEC_PREFIX_ceilf VEC_PREFIX +#else +# define HAVE_VECTOR_ceilf 0 +# define VEC_PREFIX_ceilf +#endif + +#ifdef __DECL_SIMD_ceill +# define HAVE_VECTOR_ceill 1 +# define VEC_PREFIX_ceill VEC_PREFIX +#else +# define HAVE_VECTOR_ceill 0 +# define VEC_PREFIX_ceill +#endif + +#ifdef __DECL_SIMD_floor +# define HAVE_VECTOR_floor 1 +# define VEC_PREFIX_floor VEC_PREFIX +#else +# define HAVE_VECTOR_floor 0 +# define VEC_PREFIX_floor +#endif + +#ifdef __DECL_SIMD_floorf +# define HAVE_VECTOR_floorf 1 +# define VEC_PREFIX_floorf VEC_PREFIX +#else +# define HAVE_VECTOR_floorf 0 +# define VEC_PREFIX_floorf +#endif + +#ifdef __DECL_SIMD_floorl +# define HAVE_VECTOR_floorl 1 +# define VEC_PREFIX_floorl VEC_PREFIX +#else +# define HAVE_VECTOR_floorl 0 +# define VEC_PREFIX_floorl +#endif + +#ifdef __DECL_SIMD_nearbyint +# define HAVE_VECTOR_nearbyint 1 +# define VEC_PREFIX_nearbyint VEC_PREFIX +#else +# define HAVE_VECTOR_nearbyint 0 +# define VEC_PREFIX_nearbyint +#endif + +#ifdef __DECL_SIMD_nearbyintf +# define HAVE_VECTOR_nearbyintf 1 +# define VEC_PREFIX_nearbyintf VEC_PREFIX +#else +# define HAVE_VECTOR_nearbyintf 0 +# define VEC_PREFIX_nearbyintf +#endif + +#ifdef __DECL_SIMD_nearbyintl +# define HAVE_VECTOR_nearbyintl 1 +# define VEC_PREFIX_nearbyintl VEC_PREFIX +#else +# define HAVE_VECTOR_nearbyintl 0 +# define VEC_PREFIX_nearbyintl +#endif + +#ifdef __DECL_SIMD_rint +# define HAVE_VECTOR_rint 1 +# define VEC_PREFIX_rint VEC_PREFIX +#else +# define HAVE_VECTOR_rint 0 +# define VEC_PREFIX_rint +#endif + +#ifdef __DECL_SIMD_rintf +# define HAVE_VECTOR_rintf 1 +# define VEC_PREFIX_rintf VEC_PREFIX +#else +# define HAVE_VECTOR_rintf 0 +# define VEC_PREFIX_rintf +#endif + +#ifdef __DECL_SIMD_rintl +# define HAVE_VECTOR_rintl 1 +# define VEC_PREFIX_rintl VEC_PREFIX +#else +# define HAVE_VECTOR_rintl 0 +# define VEC_PREFIX_rintl +#endif + +#ifdef __DECL_SIMD_lrint +# define HAVE_VECTOR_lrint 1 +# define VEC_PREFIX_lrint VEC_PREFIX +#else +# define HAVE_VECTOR_lrint 0 +# define VEC_PREFIX_lrint +#endif + +#ifdef __DECL_SIMD_lrintf +# define HAVE_VECTOR_lrintf 1 +# define VEC_PREFIX_lrintf VEC_PREFIX +#else +# define HAVE_VECTOR_lrintf 0 +# define VEC_PREFIX_lrintf +#endif + +#ifdef __DECL_SIMD_lrintl +# define HAVE_VECTOR_lrintl 1 +# define VEC_PREFIX_lrintl VEC_PREFIX +#else +# define HAVE_VECTOR_lrintl 0 +# define VEC_PREFIX_lrintl +#endif + +#ifdef __DECL_SIMD_llrint +# define HAVE_VECTOR_llrint 1 +# define VEC_PREFIX_llrint VEC_PREFIX +#else +# define HAVE_VECTOR_llrint 0 +# define VEC_PREFIX_llrint +#endif + +#ifdef __DECL_SIMD_llrintf +# define HAVE_VECTOR_llrintf 1 +# define VEC_PREFIX_llrintf VEC_PREFIX +#else +# define HAVE_VECTOR_llrintf 0 +# define VEC_PREFIX_llrintf +#endif + +#ifdef __DECL_SIMD_llrintl +# define HAVE_VECTOR_llrintl 1 +# define VEC_PREFIX_llrintl VEC_PREFIX +#else +# define HAVE_VECTOR_llrintl 0 +# define VEC_PREFIX_llrintl +#endif + +#ifdef __DECL_SIMD_round +# define HAVE_VECTOR_round 1 +# define VEC_PREFIX_round VEC_PREFIX +#else +# define HAVE_VECTOR_round 0 +# define VEC_PREFIX_round +#endif + +#ifdef __DECL_SIMD_roundf +# define HAVE_VECTOR_roundf 1 +# define VEC_PREFIX_roundf VEC_PREFIX +#else +# define HAVE_VECTOR_roundf 0 +# define VEC_PREFIX_roundf +#endif + +#ifdef __DECL_SIMD_roundl +# define HAVE_VECTOR_roundl 1 +# define VEC_PREFIX_roundl VEC_PREFIX +#else +# define HAVE_VECTOR_roundl 0 +# define VEC_PREFIX_roundl +#endif + +#ifdef __DECL_SIMD_lround +# define HAVE_VECTOR_lround 1 +# define VEC_PREFIX_lround VEC_PREFIX +#else +# define HAVE_VECTOR_lround 0 +# define VEC_PREFIX_lround +#endif + +#ifdef __DECL_SIMD_lroundf +# define HAVE_VECTOR_lroundf 1 +# define VEC_PREFIX_lroundf VEC_PREFIX +#else +# define HAVE_VECTOR_lroundf 0 +# define VEC_PREFIX_lroundf +#endif + +#ifdef __DECL_SIMD_lroundl +# define HAVE_VECTOR_lroundl 1 +# define VEC_PREFIX_lroundl VEC_PREFIX +#else +# define HAVE_VECTOR_lroundl 0 +# define VEC_PREFIX_lroundl +#endif + +#ifdef __DECL_SIMD_llround +# define HAVE_VECTOR_llround 1 +# define VEC_PREFIX_llround VEC_PREFIX +#else +# define HAVE_VECTOR_llround 0 +# define VEC_PREFIX_llround +#endif + +#ifdef __DECL_SIMD_llroundf +# define HAVE_VECTOR_llroundf 1 +# define VEC_PREFIX_llroundf VEC_PREFIX +#else +# define HAVE_VECTOR_llroundf 0 +# define VEC_PREFIX_llroundf +#endif + +#ifdef __DECL_SIMD_llroundl +# define HAVE_VECTOR_llroundl 1 +# define VEC_PREFIX_llroundl VEC_PREFIX +#else +# define HAVE_VECTOR_llroundl 0 +# define VEC_PREFIX_llroundl +#endif + +#ifdef __DECL_SIMD_trunc +# define HAVE_VECTOR_trunc 1 +# define VEC_PREFIX_trunc VEC_PREFIX +#else +# define HAVE_VECTOR_trunc 0 +# define VEC_PREFIX_trunc +#endif + +#ifdef __DECL_SIMD_truncf +# define HAVE_VECTOR_truncf 1 +# define VEC_PREFIX_truncf VEC_PREFIX +#else +# define HAVE_VECTOR_truncf 0 +# define VEC_PREFIX_truncf +#endif + +#ifdef __DECL_SIMD_truncl +# define HAVE_VECTOR_truncl 1 +# define VEC_PREFIX_truncl VEC_PREFIX +#else +# define HAVE_VECTOR_truncl 0 +# define VEC_PREFIX_truncl +#endif + +#ifdef __DECL_SIMD_drem +# define HAVE_VECTOR_drem 1 +# define VEC_PREFIX_drem VEC_PREFIX +#else +# define HAVE_VECTOR_drem 0 +# define VEC_PREFIX_drem +#endif + +#ifdef __DECL_SIMD_dremf +# define HAVE_VECTOR_dremf 1 +# define VEC_PREFIX_dremf VEC_PREFIX +#else +# define HAVE_VECTOR_dremf 0 +# define VEC_PREFIX_dremf +#endif + +#ifdef __DECL_SIMD_dreml +# define HAVE_VECTOR_dreml 1 +# define VEC_PREFIX_dreml VEC_PREFIX +#else +# define HAVE_VECTOR_dreml 0 +# define VEC_PREFIX_dreml +#endif + +#ifdef __DECL_SIMD_fmod +# define HAVE_VECTOR_fmod 1 +# define VEC_PREFIX_fmod VEC_PREFIX +#else +# define HAVE_VECTOR_fmod 0 +# define VEC_PREFIX_fmod +#endif + +#ifdef __DECL_SIMD_fmodf +# define HAVE_VECTOR_fmodf 1 +# define VEC_PREFIX_fmodf VEC_PREFIX +#else +# define HAVE_VECTOR_fmodf 0 +# define VEC_PREFIX_fmodf +#endif + +#ifdef __DECL_SIMD_fmodl +# define HAVE_VECTOR_fmodl 1 +# define VEC_PREFIX_fmodl VEC_PREFIX +#else +# define HAVE_VECTOR_fmodl 0 +# define VEC_PREFIX_fmodl +#endif + +#ifdef __DECL_SIMD_remainder +# define HAVE_VECTOR_remainder 1 +# define VEC_PREFIX_remainder VEC_PREFIX +#else +# define HAVE_VECTOR_remainder 0 +# define VEC_PREFIX_remainder +#endif + +#ifdef __DECL_SIMD_remainderf +# define HAVE_VECTOR_remainderf 1 +# define VEC_PREFIX_remainderf VEC_PREFIX +#else +# define HAVE_VECTOR_remainderf 0 +# define VEC_PREFIX_remainderf +#endif + +#ifdef __DECL_SIMD_remainderl +# define HAVE_VECTOR_remainderl 1 +# define VEC_PREFIX_remainderl VEC_PREFIX +#else +# define HAVE_VECTOR_remainderl 0 +# define VEC_PREFIX_remainderl +#endif + +#ifdef __DECL_SIMD_remquo +# define HAVE_VECTOR_remquo 1 +# define VEC_PREFIX_remquo VEC_PREFIX +#else +# define HAVE_VECTOR_remquo 0 +# define VEC_PREFIX_remquo +#endif + +#ifdef __DECL_SIMD_remquof +# define HAVE_VECTOR_remquof 1 +# define VEC_PREFIX_remquof VEC_PREFIX +#else +# define HAVE_VECTOR_remquof 0 +# define VEC_PREFIX_remquof +#endif + +#ifdef __DECL_SIMD_remquol +# define HAVE_VECTOR_remquol 1 +# define VEC_PREFIX_remquol VEC_PREFIX +#else +# define HAVE_VECTOR_remquol 0 +# define VEC_PREFIX_remquol +#endif + +#ifdef __DECL_SIMD_copysign +# define HAVE_VECTOR_copysign 1 +# define VEC_PREFIX_copysign VEC_PREFIX +#else +# define HAVE_VECTOR_copysign 0 +# define VEC_PREFIX_copysign +#endif + +#ifdef __DECL_SIMD_copysignf +# define HAVE_VECTOR_copysignf 1 +# define VEC_PREFIX_copysignf VEC_PREFIX +#else +# define HAVE_VECTOR_copysignf 0 +# define VEC_PREFIX_copysignf +#endif + +#ifdef __DECL_SIMD_copysignl +# define HAVE_VECTOR_copysignl 1 +# define VEC_PREFIX_copysignl VEC_PREFIX +#else +# define HAVE_VECTOR_copysignl 0 +# define VEC_PREFIX_copysignl +#endif + +#ifdef __DECL_SIMD_nextafter +# define HAVE_VECTOR_nextafter 1 +# define VEC_PREFIX_nextafter VEC_PREFIX +#else +# define HAVE_VECTOR_nextafter 0 +# define VEC_PREFIX_nextafter +#endif + +#ifdef __DECL_SIMD_nextafterf +# define HAVE_VECTOR_nextafterf 1 +# define VEC_PREFIX_nextafterf VEC_PREFIX +#else +# define HAVE_VECTOR_nextafterf 0 +# define VEC_PREFIX_nextafterf +#endif + +#ifdef __DECL_SIMD_nextafterl +# define HAVE_VECTOR_nextafterl 1 +# define VEC_PREFIX_nextafterl VEC_PREFIX +#else +# define HAVE_VECTOR_nextafterl 0 +# define VEC_PREFIX_nextafterl +#endif + +#ifdef __DECL_SIMD_nexttoward +# define HAVE_VECTOR_nexttoward 1 +# define VEC_PREFIX_nexttoward VEC_PREFIX +#else +# define HAVE_VECTOR_nexttoward 0 +# define VEC_PREFIX_nexttoward +#endif + +#ifdef __DECL_SIMD_nexttowardf +# define HAVE_VECTOR_nexttowardf 1 +# define VEC_PREFIX_nexttowardf VEC_PREFIX +#else +# define HAVE_VECTOR_nexttowardf 0 +# define VEC_PREFIX_nexttowardf +#endif + +#ifdef __DECL_SIMD_nexttowardl +# define HAVE_VECTOR_nexttowardl 1 +# define VEC_PREFIX_nexttowardl VEC_PREFIX +#else +# define HAVE_VECTOR_nexttowardl 0 +# define VEC_PREFIX_nexttowardl +#endif + +#ifdef __DECL_SIMD_fdim +# define HAVE_VECTOR_fdim 1 +# define VEC_PREFIX_fdim VEC_PREFIX +#else +# define HAVE_VECTOR_fdim 0 +# define VEC_PREFIX_fdim +#endif + +#ifdef __DECL_SIMD_fdimf +# define HAVE_VECTOR_fdimf 1 +# define VEC_PREFIX_fdimf VEC_PREFIX +#else +# define HAVE_VECTOR_fdimf 0 +# define VEC_PREFIX_fdimf +#endif + +#ifdef __DECL_SIMD_fdiml +# define HAVE_VECTOR_fdiml 1 +# define VEC_PREFIX_fdiml VEC_PREFIX +#else +# define HAVE_VECTOR_fdiml 0 +# define VEC_PREFIX_fdiml +#endif + +#ifdef __DECL_SIMD_fmax +# define HAVE_VECTOR_fmax 1 +# define VEC_PREFIX_fmax VEC_PREFIX +#else +# define HAVE_VECTOR_fmax 0 +# define VEC_PREFIX_fmax +#endif + +#ifdef __DECL_SIMD_fmaxf +# define HAVE_VECTOR_fmaxf 1 +# define VEC_PREFIX_fmaxf VEC_PREFIX +#else +# define HAVE_VECTOR_fmaxf 0 +# define VEC_PREFIX_fmaxf +#endif + +#ifdef __DECL_SIMD_fmaxl +# define HAVE_VECTOR_fmaxl 1 +# define VEC_PREFIX_fmaxl VEC_PREFIX +#else +# define HAVE_VECTOR_fmaxl 0 +# define VEC_PREFIX_fmaxl +#endif + +#ifdef __DECL_SIMD_fmin +# define HAVE_VECTOR_fmin 1 +# define VEC_PREFIX_fmin VEC_PREFIX +#else +# define HAVE_VECTOR_fmin 0 +# define VEC_PREFIX_fmin +#endif + +#ifdef __DECL_SIMD_fminf +# define HAVE_VECTOR_fminf 1 +# define VEC_PREFIX_fminf VEC_PREFIX +#else +# define HAVE_VECTOR_fminf 0 +# define VEC_PREFIX_fminf +#endif + +#ifdef __DECL_SIMD_fminl +# define HAVE_VECTOR_fminl 1 +# define VEC_PREFIX_fminl VEC_PREFIX +#else +# define HAVE_VECTOR_fminl 0 +# define VEC_PREFIX_fminl +#endif + +#ifdef __DECL_SIMD_fma +# define HAVE_VECTOR_fma 1 +# define VEC_PREFIX_fma VEC_PREFIX +#else +# define HAVE_VECTOR_fma 0 +# define VEC_PREFIX_fma +#endif + +#ifdef __DECL_SIMD_fmaf +# define HAVE_VECTOR_fmaf 1 +# define VEC_PREFIX_fmaf VEC_PREFIX +#else +# define HAVE_VECTOR_fmaf 0 +# define VEC_PREFIX_fmaf +#endif + +#ifdef __DECL_SIMD_fmal +# define HAVE_VECTOR_fmal 1 +# define VEC_PREFIX_fmal VEC_PREFIX +#else +# define HAVE_VECTOR_fmal 0 +# define VEC_PREFIX_fmal +#endif + +#ifdef __DECL_SIMD_isgreater +# define HAVE_VECTOR_isgreater 1 +# define VEC_PREFIX_isgreater VEC_PREFIX +#else +# define HAVE_VECTOR_isgreater 0 +# define VEC_PREFIX_isgreater +#endif + +#ifdef __DECL_SIMD_isgreaterf +# define HAVE_VECTOR_isgreaterf 1 +# define VEC_PREFIX_isgreaterf VEC_PREFIX +#else +# define HAVE_VECTOR_isgreaterf 0 +# define VEC_PREFIX_isgreaterf +#endif + +#ifdef __DECL_SIMD_isgreaterl +# define HAVE_VECTOR_isgreaterl 1 +# define VEC_PREFIX_isgreaterl VEC_PREFIX +#else +# define HAVE_VECTOR_isgreaterl 0 +# define VEC_PREFIX_isgreaterl +#endif + +#ifdef __DECL_SIMD_isgreaterequal +# define HAVE_VECTOR_isgreaterequal 1 +# define VEC_PREFIX_isgreaterequal VEC_PREFIX +#else +# define HAVE_VECTOR_isgreaterequal 0 +# define VEC_PREFIX_isgreaterequal +#endif + +#ifdef __DECL_SIMD_isgreaterequalf +# define HAVE_VECTOR_isgreaterequalf 1 +# define VEC_PREFIX_isgreaterequalf VEC_PREFIX +#else +# define HAVE_VECTOR_isgreaterequalf 0 +# define VEC_PREFIX_isgreaterequalf +#endif + +#ifdef __DECL_SIMD_isgreaterequall +# define HAVE_VECTOR_isgreaterequall 1 +# define VEC_PREFIX_isgreaterequall VEC_PREFIX +#else +# define HAVE_VECTOR_isgreaterequall 0 +# define VEC_PREFIX_isgreaterequall +#endif + +#ifdef __DECL_SIMD_isless +# define HAVE_VECTOR_isless 1 +# define VEC_PREFIX_isless VEC_PREFIX +#else +# define HAVE_VECTOR_isless 0 +# define VEC_PREFIX_isless +#endif + +#ifdef __DECL_SIMD_islessf +# define HAVE_VECTOR_islessf 1 +# define VEC_PREFIX_islessf VEC_PREFIX +#else +# define HAVE_VECTOR_islessf 0 +# define VEC_PREFIX_islessf +#endif + +#ifdef __DECL_SIMD_islessl +# define HAVE_VECTOR_islessl 1 +# define VEC_PREFIX_islessl VEC_PREFIX +#else +# define HAVE_VECTOR_islessl 0 +# define VEC_PREFIX_islessl +#endif + +#ifdef __DECL_SIMD_islessequal +# define HAVE_VECTOR_islessequal 1 +# define VEC_PREFIX_islessequal VEC_PREFIX +#else +# define HAVE_VECTOR_islessequal 0 +# define VEC_PREFIX_islessequal +#endif + +#ifdef __DECL_SIMD_islessequalf +# define HAVE_VECTOR_islessequalf 1 +# define VEC_PREFIX_islessequalf VEC_PREFIX +#else +# define HAVE_VECTOR_islessequalf 0 +# define VEC_PREFIX_islessequalf +#endif + +#ifdef __DECL_SIMD_islessequall +# define HAVE_VECTOR_islessequall 1 +# define VEC_PREFIX_islessequall VEC_PREFIX +#else +# define HAVE_VECTOR_islessequall 0 +# define VEC_PREFIX_islessequall +#endif + +#ifdef __DECL_SIMD_islessgreater +# define HAVE_VECTOR_islessgreater 1 +# define VEC_PREFIX_islessgreater VEC_PREFIX +#else +# define HAVE_VECTOR_islessgreater 0 +# define VEC_PREFIX_islessgreater +#endif + +#ifdef __DECL_SIMD_islessgreaterf +# define HAVE_VECTOR_islessgreaterf 1 +# define VEC_PREFIX_islessgreaterf VEC_PREFIX +#else +# define HAVE_VECTOR_islessgreaterf 0 +# define VEC_PREFIX_islessgreaterf +#endif + +#ifdef __DECL_SIMD_islessgreaterl +# define HAVE_VECTOR_islessgreaterl 1 +# define VEC_PREFIX_islessgreaterl VEC_PREFIX +#else +# define HAVE_VECTOR_islessgreaterl 0 +# define VEC_PREFIX_islessgreaterl +#endif + +#ifdef __DECL_SIMD_isunordered +# define HAVE_VECTOR_isunordered 1 +# define VEC_PREFIX_isunordered VEC_PREFIX +#else +# define HAVE_VECTOR_isunordered 0 +# define VEC_PREFIX_isunordered +#endif + +#ifdef __DECL_SIMD_isunorderedf +# define HAVE_VECTOR_isunorderedf 1 +# define VEC_PREFIX_isunorderedf VEC_PREFIX +#else +# define HAVE_VECTOR_isunorderedf 0 +# define VEC_PREFIX_isunorderedf +#endif + +#ifdef __DECL_SIMD_isunorderedl +# define HAVE_VECTOR_isunorderedl 1 +# define VEC_PREFIX_isunorderedl VEC_PREFIX +#else +# define HAVE_VECTOR_isunorderedl 0 +# define VEC_PREFIX_isunorderedl +#endif + +#ifdef __DECL_SIMD_cabs +# define HAVE_VECTOR_cabs 1 +# define VEC_PREFIX_cabs VEC_PREFIX +#else +# define HAVE_VECTOR_cabs 0 +# define VEC_PREFIX_cabs +#endif + +#ifdef __DECL_SIMD_cabsf +# define HAVE_VECTOR_cabsf 1 +# define VEC_PREFIX_cabsf VEC_PREFIX +#else +# define HAVE_VECTOR_cabsf 0 +# define VEC_PREFIX_cabsf +#endif + +#ifdef __DECL_SIMD_cabsl +# define HAVE_VECTOR_cabsl 1 +# define VEC_PREFIX_cabsl VEC_PREFIX +#else +# define HAVE_VECTOR_cabsl 0 +# define VEC_PREFIX_cabsl +#endif + +#ifdef __DECL_SIMD_cacos +# define HAVE_VECTOR_cacos 1 +# define VEC_PREFIX_cacos VEC_PREFIX +#else +# define HAVE_VECTOR_cacos 0 +# define VEC_PREFIX_cacos +#endif + +#ifdef __DECL_SIMD_cacosf +# define HAVE_VECTOR_cacosf 1 +# define VEC_PREFIX_cacosf VEC_PREFIX +#else +# define HAVE_VECTOR_cacosf 0 +# define VEC_PREFIX_cacosf +#endif + +#ifdef __DECL_SIMD_cacosl +# define HAVE_VECTOR_cacosl 1 +# define VEC_PREFIX_cacosl VEC_PREFIX +#else +# define HAVE_VECTOR_cacosl 0 +# define VEC_PREFIX_cacosl +#endif + +#ifdef __DECL_SIMD_cacosh +# define HAVE_VECTOR_cacosh 1 +# define VEC_PREFIX_cacosh VEC_PREFIX +#else +# define HAVE_VECTOR_cacosh 0 +# define VEC_PREFIX_cacosh +#endif + +#ifdef __DECL_SIMD_cacoshf +# define HAVE_VECTOR_cacoshf 1 +# define VEC_PREFIX_cacoshf VEC_PREFIX +#else +# define HAVE_VECTOR_cacoshf 0 +# define VEC_PREFIX_cacoshf +#endif + +#ifdef __DECL_SIMD_cacoshl +# define HAVE_VECTOR_cacoshl 1 +# define VEC_PREFIX_cacoshl VEC_PREFIX +#else +# define HAVE_VECTOR_cacoshl 0 +# define VEC_PREFIX_cacoshl +#endif + +#ifdef __DECL_SIMD_carg +# define HAVE_VECTOR_carg 1 +# define VEC_PREFIX_carg VEC_PREFIX +#else +# define HAVE_VECTOR_carg 0 +# define VEC_PREFIX_carg +#endif + +#ifdef __DECL_SIMD_cargf +# define HAVE_VECTOR_cargf 1 +# define VEC_PREFIX_cargf VEC_PREFIX +#else +# define HAVE_VECTOR_cargf 0 +# define VEC_PREFIX_cargf +#endif + +#ifdef __DECL_SIMD_cargl +# define HAVE_VECTOR_cargl 1 +# define VEC_PREFIX_cargl VEC_PREFIX +#else +# define HAVE_VECTOR_cargl 0 +# define VEC_PREFIX_cargl +#endif + +#ifdef __DECL_SIMD_casin +# define HAVE_VECTOR_casin 1 +# define VEC_PREFIX_casin VEC_PREFIX +#else +# define HAVE_VECTOR_casin 0 +# define VEC_PREFIX_casin +#endif + +#ifdef __DECL_SIMD_casinf +# define HAVE_VECTOR_casinf 1 +# define VEC_PREFIX_casinf VEC_PREFIX +#else +# define HAVE_VECTOR_casinf 0 +# define VEC_PREFIX_casinf +#endif + +#ifdef __DECL_SIMD_casinl +# define HAVE_VECTOR_casinl 1 +# define VEC_PREFIX_casinl VEC_PREFIX +#else +# define HAVE_VECTOR_casinl 0 +# define VEC_PREFIX_casinl +#endif + +#ifdef __DECL_SIMD_casinh +# define HAVE_VECTOR_casinh 1 +# define VEC_PREFIX_casinh VEC_PREFIX +#else +# define HAVE_VECTOR_casinh 0 +# define VEC_PREFIX_casinh +#endif + +#ifdef __DECL_SIMD_casinhf +# define HAVE_VECTOR_casinhf 1 +# define VEC_PREFIX_casinhf VEC_PREFIX +#else +# define HAVE_VECTOR_casinhf 0 +# define VEC_PREFIX_casinhf +#endif + +#ifdef __DECL_SIMD_casinhl +# define HAVE_VECTOR_casinhl 1 +# define VEC_PREFIX_casinhl VEC_PREFIX +#else +# define HAVE_VECTOR_casinhl 0 +# define VEC_PREFIX_casinhl +#endif + +#ifdef __DECL_SIMD_catan +# define HAVE_VECTOR_catan 1 +# define VEC_PREFIX_catan VEC_PREFIX +#else +# define HAVE_VECTOR_catan 0 +# define VEC_PREFIX_catan +#endif + +#ifdef __DECL_SIMD_catanf +# define HAVE_VECTOR_catanf 1 +# define VEC_PREFIX_catanf VEC_PREFIX +#else +# define HAVE_VECTOR_catanf 0 +# define VEC_PREFIX_catanf +#endif + +#ifdef __DECL_SIMD_catanl +# define HAVE_VECTOR_catanl 1 +# define VEC_PREFIX_catanl VEC_PREFIX +#else +# define HAVE_VECTOR_catanl 0 +# define VEC_PREFIX_catanl +#endif + +#ifdef __DECL_SIMD_catanh +# define HAVE_VECTOR_catanh 1 +# define VEC_PREFIX_catanh VEC_PREFIX +#else +# define HAVE_VECTOR_catanh 0 +# define VEC_PREFIX_catanh +#endif + +#ifdef __DECL_SIMD_catanhf +# define HAVE_VECTOR_catanhf 1 +# define VEC_PREFIX_catanhf VEC_PREFIX +#else +# define HAVE_VECTOR_catanhf 0 +# define VEC_PREFIX_catanhf +#endif + +#ifdef __DECL_SIMD_catanhl +# define HAVE_VECTOR_catanhl 1 +# define VEC_PREFIX_catanhl VEC_PREFIX +#else +# define HAVE_VECTOR_catanhl 0 +# define VEC_PREFIX_catanhl +#endif + +#ifdef __DECL_SIMD_ccos +# define HAVE_VECTOR_ccos 1 +# define VEC_PREFIX_ccos VEC_PREFIX +#else +# define HAVE_VECTOR_ccos 0 +# define VEC_PREFIX_ccos +#endif + +#ifdef __DECL_SIMD_ccosf +# define HAVE_VECTOR_ccosf 1 +# define VEC_PREFIX_ccosf VEC_PREFIX +#else +# define HAVE_VECTOR_ccosf 0 +# define VEC_PREFIX_ccosf +#endif + +#ifdef __DECL_SIMD_ccosl +# define HAVE_VECTOR_ccosl 1 +# define VEC_PREFIX_ccosl VEC_PREFIX +#else +# define HAVE_VECTOR_ccosl 0 +# define VEC_PREFIX_ccosl +#endif + +#ifdef __DECL_SIMD_ccosh +# define HAVE_VECTOR_ccosh 1 +# define VEC_PREFIX_ccosh VEC_PREFIX +#else +# define HAVE_VECTOR_ccosh 0 +# define VEC_PREFIX_ccosh +#endif + +#ifdef __DECL_SIMD_ccoshf +# define HAVE_VECTOR_ccoshf 1 +# define VEC_PREFIX_ccoshf VEC_PREFIX +#else +# define HAVE_VECTOR_ccoshf 0 +# define VEC_PREFIX_ccoshf +#endif + +#ifdef __DECL_SIMD_ccoshl +# define HAVE_VECTOR_ccoshl 1 +# define VEC_PREFIX_ccoshl VEC_PREFIX +#else +# define HAVE_VECTOR_ccoshl 0 +# define VEC_PREFIX_ccoshl +#endif + +#ifdef __DECL_SIMD_cexp +# define HAVE_VECTOR_cexp 1 +# define VEC_PREFIX_cexp VEC_PREFIX +#else +# define HAVE_VECTOR_cexp 0 +# define VEC_PREFIX_cexp +#endif + +#ifdef __DECL_SIMD_cexpf +# define HAVE_VECTOR_cexpf 1 +# define VEC_PREFIX_cexpf VEC_PREFIX +#else +# define HAVE_VECTOR_cexpf 0 +# define VEC_PREFIX_cexpf +#endif + +#ifdef __DECL_SIMD_cexpl +# define HAVE_VECTOR_cexpl 1 +# define VEC_PREFIX_cexpl VEC_PREFIX +#else +# define HAVE_VECTOR_cexpl 0 +# define VEC_PREFIX_cexpl +#endif + +#ifdef __DECL_SIMD_cimag +# define HAVE_VECTOR_cimag 1 +# define VEC_PREFIX_cimag VEC_PREFIX +#else +# define HAVE_VECTOR_cimag 0 +# define VEC_PREFIX_cimag +#endif + +#ifdef __DECL_SIMD_cimagf +# define HAVE_VECTOR_cimagf 1 +# define VEC_PREFIX_cimagf VEC_PREFIX +#else +# define HAVE_VECTOR_cimagf 0 +# define VEC_PREFIX_cimagf +#endif + +#ifdef __DECL_SIMD_cimagl +# define HAVE_VECTOR_cimagl 1 +# define VEC_PREFIX_cimagl VEC_PREFIX +#else +# define HAVE_VECTOR_cimagl 0 +# define VEC_PREFIX_cimagl +#endif + +#ifdef __DECL_SIMD_clog10 +# define HAVE_VECTOR_clog10 1 +# define VEC_PREFIX_clog10 VEC_PREFIX +#else +# define HAVE_VECTOR_clog10 0 +# define VEC_PREFIX_clog10 +#endif + +#ifdef __DECL_SIMD_clog10f +# define HAVE_VECTOR_clog10f 1 +# define VEC_PREFIX_clog10f VEC_PREFIX +#else +# define HAVE_VECTOR_clog10f 0 +# define VEC_PREFIX_clog10f +#endif + +#ifdef __DECL_SIMD_clog10l +# define HAVE_VECTOR_clog10l 1 +# define VEC_PREFIX_clog10l VEC_PREFIX +#else +# define HAVE_VECTOR_clog10l 0 +# define VEC_PREFIX_clog10l +#endif + +#ifdef __DECL_SIMD_clog +# define HAVE_VECTOR_clog 1 +# define VEC_PREFIX_clog VEC_PREFIX +#else +# define HAVE_VECTOR_clog 0 +# define VEC_PREFIX_clog +#endif + +#ifdef __DECL_SIMD_clogf +# define HAVE_VECTOR_clogf 1 +# define VEC_PREFIX_clogf VEC_PREFIX +#else +# define HAVE_VECTOR_clogf 0 +# define VEC_PREFIX_clogf +#endif + +#ifdef __DECL_SIMD_clogl +# define HAVE_VECTOR_clogl 1 +# define VEC_PREFIX_clogl VEC_PREFIX +#else +# define HAVE_VECTOR_clogl 0 +# define VEC_PREFIX_clogl +#endif + +#ifdef __DECL_SIMD_conj +# define HAVE_VECTOR_conj 1 +# define VEC_PREFIX_conj VEC_PREFIX +#else +# define HAVE_VECTOR_conj 0 +# define VEC_PREFIX_conj +#endif + +#ifdef __DECL_SIMD_conjf +# define HAVE_VECTOR_conjf 1 +# define VEC_PREFIX_conjf VEC_PREFIX +#else +# define HAVE_VECTOR_conjf 0 +# define VEC_PREFIX_conjf +#endif + +#ifdef __DECL_SIMD_conjl +# define HAVE_VECTOR_conjl 1 +# define VEC_PREFIX_conjl VEC_PREFIX +#else +# define HAVE_VECTOR_conjl 0 +# define VEC_PREFIX_conjl +#endif + +#ifdef __DECL_SIMD_cpow +# define HAVE_VECTOR_cpow 1 +# define VEC_PREFIX_cpow VEC_PREFIX +#else +# define HAVE_VECTOR_cpow 0 +# define VEC_PREFIX_cpow +#endif + +#ifdef __DECL_SIMD_cpowf +# define HAVE_VECTOR_cpowf 1 +# define VEC_PREFIX_cpowf VEC_PREFIX +#else +# define HAVE_VECTOR_cpowf 0 +# define VEC_PREFIX_cpowf +#endif + +#ifdef __DECL_SIMD_cpowl +# define HAVE_VECTOR_cpowl 1 +# define VEC_PREFIX_cpowl VEC_PREFIX +#else +# define HAVE_VECTOR_cpowl 0 +# define VEC_PREFIX_cpowl +#endif + +#ifdef __DECL_SIMD_cproj +# define HAVE_VECTOR_cproj 1 +# define VEC_PREFIX_cproj VEC_PREFIX +#else +# define HAVE_VECTOR_cproj 0 +# define VEC_PREFIX_cproj +#endif + +#ifdef __DECL_SIMD_cprojf +# define HAVE_VECTOR_cprojf 1 +# define VEC_PREFIX_cprojf VEC_PREFIX +#else +# define HAVE_VECTOR_cprojf 0 +# define VEC_PREFIX_cprojf +#endif + +#ifdef __DECL_SIMD_cprojl +# define HAVE_VECTOR_cprojl 1 +# define VEC_PREFIX_cprojl VEC_PREFIX +#else +# define HAVE_VECTOR_cprojl 0 +# define VEC_PREFIX_cprojl +#endif + +#ifdef __DECL_SIMD_creal +# define HAVE_VECTOR_creal 1 +# define VEC_PREFIX_creal VEC_PREFIX +#else +# define HAVE_VECTOR_creal 0 +# define VEC_PREFIX_creal +#endif + +#ifdef __DECL_SIMD_crealf +# define HAVE_VECTOR_crealf 1 +# define VEC_PREFIX_crealf VEC_PREFIX +#else +# define HAVE_VECTOR_crealf 0 +# define VEC_PREFIX_crealf +#endif + +#ifdef __DECL_SIMD_creall +# define HAVE_VECTOR_creall 1 +# define VEC_PREFIX_creall VEC_PREFIX +#else +# define HAVE_VECTOR_creall 0 +# define VEC_PREFIX_creall +#endif + +#ifdef __DECL_SIMD_csin +# define HAVE_VECTOR_csin 1 +# define VEC_PREFIX_csin VEC_PREFIX +#else +# define HAVE_VECTOR_csin 0 +# define VEC_PREFIX_csin +#endif + +#ifdef __DECL_SIMD_csinf +# define HAVE_VECTOR_csinf 1 +# define VEC_PREFIX_csinf VEC_PREFIX +#else +# define HAVE_VECTOR_csinf 0 +# define VEC_PREFIX_csinf +#endif + +#ifdef __DECL_SIMD_csinl +# define HAVE_VECTOR_csinl 1 +# define VEC_PREFIX_csinl VEC_PREFIX +#else +# define HAVE_VECTOR_csinl 0 +# define VEC_PREFIX_csinl +#endif + +#ifdef __DECL_SIMD_csinh +# define HAVE_VECTOR_csinh 1 +# define VEC_PREFIX_csinh VEC_PREFIX +#else +# define HAVE_VECTOR_csinh 0 +# define VEC_PREFIX_csinh +#endif + +#ifdef __DECL_SIMD_csinhf +# define HAVE_VECTOR_csinhf 1 +# define VEC_PREFIX_csinhf VEC_PREFIX +#else +# define HAVE_VECTOR_csinhf 0 +# define VEC_PREFIX_csinhf +#endif + +#ifdef __DECL_SIMD_csinhl +# define HAVE_VECTOR_csinhl 1 +# define VEC_PREFIX_csinhl VEC_PREFIX +#else +# define HAVE_VECTOR_csinhl 0 +# define VEC_PREFIX_csinhl +#endif + +#ifdef __DECL_SIMD_csqrt +# define HAVE_VECTOR_csqrt 1 +# define VEC_PREFIX_csqrt VEC_PREFIX +#else +# define HAVE_VECTOR_csqrt 0 +# define VEC_PREFIX_csqrt +#endif + +#ifdef __DECL_SIMD_csqrtf +# define HAVE_VECTOR_csqrtf 1 +# define VEC_PREFIX_csqrtf VEC_PREFIX +#else +# define HAVE_VECTOR_csqrtf 0 +# define VEC_PREFIX_csqrtf +#endif + +#ifdef __DECL_SIMD_csqrtl +# define HAVE_VECTOR_csqrtl 1 +# define VEC_PREFIX_csqrtl VEC_PREFIX +#else +# define HAVE_VECTOR_csqrtl 0 +# define VEC_PREFIX_csqrtl +#endif + +#ifdef __DECL_SIMD_ctan +# define HAVE_VECTOR_ctan 1 +# define VEC_PREFIX_ctan VEC_PREFIX +#else +# define HAVE_VECTOR_ctan 0 +# define VEC_PREFIX_ctan +#endif + +#ifdef __DECL_SIMD_ctanf +# define HAVE_VECTOR_ctanf 1 +# define VEC_PREFIX_ctanf VEC_PREFIX +#else +# define HAVE_VECTOR_ctanf 0 +# define VEC_PREFIX_ctanf +#endif + +#ifdef __DECL_SIMD_ctanl +# define HAVE_VECTOR_ctanl 1 +# define VEC_PREFIX_ctanl VEC_PREFIX +#else +# define HAVE_VECTOR_ctanl 0 +# define VEC_PREFIX_ctanl +#endif + +#ifdef __DECL_SIMD_ctanh +# define HAVE_VECTOR_ctanh 1 +# define VEC_PREFIX_ctanh VEC_PREFIX +#else +# define HAVE_VECTOR_ctanh 0 +# define VEC_PREFIX_ctanh +#endif + +#ifdef __DECL_SIMD_ctanhf +# define HAVE_VECTOR_ctanhf 1 +# define VEC_PREFIX_ctanhf VEC_PREFIX +#else +# define HAVE_VECTOR_ctanhf 0 +# define VEC_PREFIX_ctanhf +#endif + +#ifdef __DECL_SIMD_ctanhl +# define HAVE_VECTOR_ctanhl 1 +# define VEC_PREFIX_ctanhl VEC_PREFIX +#else +# define HAVE_VECTOR_ctanhl 0 +# define VEC_PREFIX_ctanhl +#endif + +#ifdef __DECL_SIMD_j0 +# define HAVE_VECTOR_j0 1 +# define VEC_PREFIX_j0 VEC_PREFIX +#else +# define HAVE_VECTOR_j0 0 +# define VEC_PREFIX_j0 +#endif + +#ifdef __DECL_SIMD_j0f +# define HAVE_VECTOR_j0f 1 +# define VEC_PREFIX_j0f VEC_PREFIX +#else +# define HAVE_VECTOR_j0f 0 +# define VEC_PREFIX_j0f +#endif + +#ifdef __DECL_SIMD_j0l +# define HAVE_VECTOR_j0l 1 +# define VEC_PREFIX_j0l VEC_PREFIX +#else +# define HAVE_VECTOR_j0l 0 +# define VEC_PREFIX_j0l +#endif + +#ifdef __DECL_SIMD_j1 +# define HAVE_VECTOR_j1 1 +# define VEC_PREFIX_j1 VEC_PREFIX +#else +# define HAVE_VECTOR_j1 0 +# define VEC_PREFIX_j1 +#endif + +#ifdef __DECL_SIMD_j1f +# define HAVE_VECTOR_j1f 1 +# define VEC_PREFIX_j1f VEC_PREFIX +#else +# define HAVE_VECTOR_j1f 0 +# define VEC_PREFIX_j1f +#endif + +#ifdef __DECL_SIMD_j1l +# define HAVE_VECTOR_j1l 1 +# define VEC_PREFIX_j1l VEC_PREFIX +#else +# define HAVE_VECTOR_j1l 0 +# define VEC_PREFIX_j1l +#endif + +#ifdef __DECL_SIMD_jn +# define HAVE_VECTOR_jn 1 +# define VEC_PREFIX_jn VEC_PREFIX +#else +# define HAVE_VECTOR_jn 0 +# define VEC_PREFIX_jn +#endif + +#ifdef __DECL_SIMD_jnf +# define HAVE_VECTOR_jnf 1 +# define VEC_PREFIX_jnf VEC_PREFIX +#else +# define HAVE_VECTOR_jnf 0 +# define VEC_PREFIX_jnf +#endif + +#ifdef __DECL_SIMD_jnl +# define HAVE_VECTOR_jnl 1 +# define VEC_PREFIX_jnl VEC_PREFIX +#else +# define HAVE_VECTOR_jnl 0 +# define VEC_PREFIX_jnl +#endif + +#ifdef __DECL_SIMD_y0 +# define HAVE_VECTOR_y0 1 +# define VEC_PREFIX_y0 VEC_PREFIX +#else +# define HAVE_VECTOR_y0 0 +# define VEC_PREFIX_y0 +#endif + +#ifdef __DECL_SIMD_y0f +# define HAVE_VECTOR_y0f 1 +# define VEC_PREFIX_y0f VEC_PREFIX +#else +# define HAVE_VECTOR_y0f 0 +# define VEC_PREFIX_y0f +#endif + +#ifdef __DECL_SIMD_y0l +# define HAVE_VECTOR_y0l 1 +# define VEC_PREFIX_y0l VEC_PREFIX +#else +# define HAVE_VECTOR_y0l 0 +# define VEC_PREFIX_y0l +#endif + +#ifdef __DECL_SIMD_y1 +# define HAVE_VECTOR_y1 1 +# define VEC_PREFIX_y1 VEC_PREFIX +#else +# define HAVE_VECTOR_y1 0 +# define VEC_PREFIX_y1 +#endif + +#ifdef __DECL_SIMD_y1f +# define HAVE_VECTOR_y1f 1 +# define VEC_PREFIX_y1f VEC_PREFIX +#else +# define HAVE_VECTOR_y1f 0 +# define VEC_PREFIX_y1f +#endif + +#ifdef __DECL_SIMD_y1l +# define HAVE_VECTOR_y1l 1 +# define VEC_PREFIX_y1l VEC_PREFIX +#else +# define HAVE_VECTOR_y1l 0 +# define VEC_PREFIX_y1l +#endif + +#ifdef __DECL_SIMD_yn +# define HAVE_VECTOR_yn 1 +# define VEC_PREFIX_yn VEC_PREFIX +#else +# define HAVE_VECTOR_yn 0 +# define VEC_PREFIX_yn +#endif + +#ifdef __DECL_SIMD_ynf +# define HAVE_VECTOR_ynf 1 +# define VEC_PREFIX_ynf VEC_PREFIX +#else +# define HAVE_VECTOR_ynf 0 +# define VEC_PREFIX_ynf +#endif + +#ifdef __DECL_SIMD_ynl +# define HAVE_VECTOR_ynl 1 +# define VEC_PREFIX_ynl VEC_PREFIX +#else +# define HAVE_VECTOR_ynl 0 +# define VEC_PREFIX_ynl +#endif + diff --git a/math/libm-test.inc b/math/libm-test.inc index f86a4fa..f8a10e2 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -126,6 +126,7 @@ #include #include #include +#include /* Structure for ulp data for a function, or the real or imaginary part of a function. */ @@ -302,6 +303,8 @@ static int output_max_error; /* Should the maximal errors printed? */ static int output_points; /* Should the single function results printed? */ static int ignore_max_ulp; /* Should we ignore max_ulp? */ +static int avx2_usable; /* Set to 1 if AVX2 supported */ + #define plus_zero CHOOSE (0.0L, 0.0, 0.0f, \ 0.0L, 0.0, 0.0f) #define minus_zero CHOOSE (-0.0L, -0.0, -0.0f, \ @@ -678,13 +681,17 @@ test_exceptions (const char *test_name, int exception) feclearexcept (FE_ALL_EXCEPT); } +#ifndef TEST_MATHVEC +# define TEST_MATHVEC 0 +#endif + /* Test whether errno for TEST_NAME, set to ERRNO_VALUE, has value EXPECTED_VALUE (description EXPECTED_NAME). */ static void test_single_errno (const char *test_name, int errno_value, int expected_value, const char *expected_name) { -#ifndef TEST_INLINE +#if !defined TEST_INLINE && !TEST_MATHVEC if (errno_value == expected_value) { if (print_screen (1)) @@ -1295,16 +1302,19 @@ struct test_fFF_11_data /* Run an individual test, including any required setup and checking of results, or loop over all tests in an array. */ -#define RUN_TEST_f_f(ARG_STR, FUNC_NAME, ARG, EXPECTED, \ - EXCEPTIONS) \ - do \ - if (enable_test (EXCEPTIONS)) \ - { \ - COMMON_TEST_SETUP (ARG_STR); \ - check_float (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \ - EXCEPTIONS); \ - COMMON_TEST_CLEANUP; \ - } \ +#define RUN_TEST_f_f(ARG_STR, FUNC_NAME, ARG, EXPECTED, \ + EXCEPTIONS) \ + do \ + if (enable_test (EXCEPTIONS)) \ + { \ + COMMON_TEST_SETUP (ARG_STR); \ + check_float (test_name, \ + CONCAT (CONCAT3_1 (VEC_PREFIX_, FUNC_NAME, FUNC ( )), \ + FUNC (FUNC_NAME)) (ARG), \ + EXPECTED, \ + EXCEPTIONS); \ + COMMON_TEST_CLEANUP; \ + } \ while (0) #define RUN_TEST_LOOP_f_f(FUNC_NAME, ARRAY, ROUNDING_MODE) \ IF_ROUND_INIT_ ## ROUNDING_MODE \ @@ -1690,10 +1700,34 @@ struct test_fFF_11_data (ARRAY)[i].RM_##ROUNDING_MODE.extra2_expected); \ ROUND_RESTORE_ ## ROUNDING_MODE +#ifndef CHECK_ARCH_EXT +# define CHECK_ARCH_EXT +#endif + +#ifndef VEC_PREFIX +# define VEC_PREFIX +#endif + +#include "have_vector.h" + +#define CONCAT(prefix,func) __CONCAT(prefix,func) + +#define CONCAT3(a,b,c) a ## b ## c +#define CONCAT3_1(a,b,c) CONCAT3(a,b,c) + +#define HAVE_VECTOR_INNER(func,sfx) HAVE_VECTOR_ ## func ## sfx +#define HAVE_VECTOR_(func,sfx) HAVE_VECTOR_INNER(func,sfx) + +#define STR(a,b,c) __STRING(a##b##c) +#define CONCAT3_1_STR(a,b,c) STR(a,b,c) + /* Start and end the tests for a given function. */ -#define START(FUNC, EXACT) \ - const char *this_func = #FUNC; \ +#define START(FUN, SUFF, EXACT) \ + CHECK_ARCH_EXT \ + if (TEST_MATHVEC && !HAVE_VECTOR_(FUN, FUNC( ))) return; \ + const char *this_func = CONCAT3_1_STR(VEC_PREFIX, FUN, SUFF); \ init_max_error (this_func, EXACT) + #define END \ print_max_error (this_func) #define END_COMPLEX \ @@ -1705,28 +1739,28 @@ struct test_fFF_11_data { \ do \ { \ - START (FUNC, EXACT); \ + START (FUNC, , EXACT); \ LOOP_MACRO (FUNC, ARRAY, , ## __VA_ARGS__); \ END_MACRO; \ } \ while (0); \ do \ { \ - START (FUNC ## _downward, EXACT); \ + START (FUNC, _downward, EXACT); \ LOOP_MACRO (FUNC, ARRAY, FE_DOWNWARD, ## __VA_ARGS__); \ END_MACRO; \ } \ while (0); \ do \ { \ - START (FUNC ## _towardzero, EXACT); \ + START (FUNC, _towardzero, EXACT); \ LOOP_MACRO (FUNC, ARRAY, FE_TOWARDZERO, ## __VA_ARGS__); \ END_MACRO; \ } \ while (0); \ do \ { \ - START (FUNC ## _upward, EXACT); \ + START (FUNC, _upward, EXACT); \ LOOP_MACRO (FUNC, ARRAY, FE_UPWARD, ## __VA_ARGS__); \ END_MACRO; \ } \ @@ -1746,7 +1780,6 @@ matherr (struct exception *x __attribute__ ((unused))) Tests for single functions of libm. Please keep them alphabetically sorted! ****************************************************************************/ - static const struct test_f_f_data acos_test_data[] = { TEST_f_f (acos, plus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), @@ -6034,7 +6067,7 @@ static const struct test_c_c_data cexp_test_data[] = static void cexp_test (void) { - START (cexp, 0); + START (cexp, , 0); RUN_TEST_LOOP_c_c (cexp, cexp_test_data, ); END_COMPLEX; } @@ -6245,7 +6278,6 @@ copysign_test (void) ALL_RM_TEST (copysign, 1, copysign_test_data, RUN_TEST_LOOP_ff_f, END); } - static const struct test_f_f_data cos_test_data[] = { TEST_f_f (cos, plus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM), @@ -6261,7 +6293,6 @@ cos_test (void) ALL_RM_TEST (cos, 0, cos_test_data, RUN_TEST_LOOP_f_f, END); } - static const struct test_f_f_data cosh_test_data[] = { TEST_f_f (cosh, plus_infty, plus_infty, NO_TEST_INLINE), @@ -7548,7 +7579,7 @@ static const struct test_if_f_data jn_test_data[] = static void jn_test (void) { - START (jn, 0); + START (jn, , 0); RUN_TEST_LOOP_if_f (jn, jn_test_data, ); END; } @@ -9374,7 +9405,7 @@ static const struct test_f_f_data tgamma_test_data[] = static void tgamma_test (void) { - START (tgamma, 0); + START (tgamma, , 0); RUN_TEST_LOOP_f_f (tgamma, tgamma_test_data, ); END; } @@ -9628,7 +9659,6 @@ significand_test (void) ALL_RM_TEST (significand, 1, significand_test_data, RUN_TEST_LOOP_f_f, END); } - static void initialize (void) { @@ -9790,6 +9820,7 @@ main (int argc, char **argv) output_dir = NULL; /* XXX set to 0 for releases. */ ignore_max_ulp = 0; + avx2_usable = 0; /* Parse and process arguments. */ argp_parse (&argp, argc, argv, 0, &remaining, NULL); @@ -9820,10 +9851,14 @@ main (int argc, char **argv) } } - initialize (); printf (TEST_MSG); +#if TEST_MATHVEC + __init_cpu_features(); + avx2_usable = __cpu_features.feature[index_AVX2_Usable] & bit_AVX2_Usable; +#endif + check_ulp (); /* Keep the tests a wee bit ordered (according to ISO C99). */ diff --git a/math/math.h b/math/math.h index dc532b7..94ec05b 100644 --- a/math/math.h +++ b/math/math.h @@ -27,6 +27,9 @@ __BEGIN_DECLS +/* Get machine-dependent vector math functions declarations */ +#include + /* Get machine-dependent HUGE_VAL value (returned on overflow). On all IEEE754 machines, this is +Infinity. */ #include diff --git a/mathvec/Depend b/mathvec/Depend new file mode 100644 index 0000000..ede10ab --- /dev/null +++ b/mathvec/Depend @@ -0,0 +1 @@ +math diff --git a/mathvec/Makefile b/mathvec/Makefile new file mode 100644 index 0000000..16b918e --- /dev/null +++ b/mathvec/Makefile @@ -0,0 +1,35 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# . + +# Makefile for the vector math library. + +subdir := mathvec + +include ../Makeconfig + +ifeq ($(build-mathvec),yes) +extra-libs := libmvec +extra-libs-others = $(extra-libs) + +libmvec-routines = $(strip $(libmvec-support)) + +$(objpfx)libmvec.so: $(common-objpfx)math/libm.so +endif + +# Rules for the test suite are in math directory + +include ../Rules diff --git a/shlib-versions b/shlib-versions index e05b248..fa3cf1d 100644 --- a/shlib-versions +++ b/shlib-versions @@ -71,3 +71,6 @@ libanl=1 # This defines the libgcc soname version this glibc is to load for # asynchronous cancellation to work correctly. libgcc_s=1 + +# The vector math library +libmvec=1 diff --git a/sysdeps/unix/sysv/linux/x86_64/libmvec.abilist b/sysdeps/unix/sysv/linux/x86_64/libmvec.abilist new file mode 100644 index 0000000..8272ddd --- /dev/null +++ b/sysdeps/unix/sysv/linux/x86_64/libmvec.abilist @@ -0,0 +1,3 @@ +GLIBC_2.21 + GLIBC_2.21 A + _ZGVdN4v_cos F diff --git a/sysdeps/x86/fpu/bits/math-vector.h b/sysdeps/x86/fpu/bits/math-vector.h new file mode 100644 index 0000000..fdd967f --- /dev/null +++ b/sysdeps/x86/fpu/bits/math-vector.h @@ -0,0 +1,44 @@ +/* Platform-specific SIMD declarations of math functions. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _MATH_H +# error "Never include directly; \ + include instead." +#endif + +#if defined __x86_64__ && defined __FAST_MATH__ +# if defined _OPENMP && _OPENMP >= 201307 +/* OpenMP case. */ +# define __DECL_SIMD_AVX2 _Pragma("omp declare simd notinbranch") +# define __DECL_SIMD_SSE4 _Pragma("omp declare simd notinbranch") +# define __DECL_SIMD_cos __DECL_SIMD_AVX2 +# define __DECL_SIMD_cosf __DECL_SIMD_SSE4 +# elif defined _CILKPLUS && _CILKPLUS >= 0 +/* CilkPlus case. TODO _CILKPLUS currently nowhere defined */ +# define __DECL_SIMD_AVX2 __attribute__((__vector__(nomask))) +# define __DECL_SIMD_SSE4 __attribute__((__vector__(processor(core_i7_sse4_2),\ + nomask))) +# define __DECL_SIMD_cos __DECL_SIMD_AVX2 +# define __DECL_SIMD_cosf __DECL_SIMD_SSE4 +# endif +#endif + +#if defined TEST_MATHVEC +# define __DECL_SIMD_cos +# define __DECL_SIMD_cosf +#endif diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure index 7d4dadd..b087e65 100644 --- a/sysdeps/x86_64/configure +++ b/sysdeps/x86_64/configure @@ -43,6 +43,36 @@ fi +if test $build_mathvec == notset; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler target is x86_64" >&5 +$as_echo_n "checking for compiler target is x86_64... " >&6; } +if ${libc_cv_cc_target_x86_64+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <<\EOF + #if !defined (__x86_64__) + # error "target is not x86_64" + #endif +EOF + if { ac_try='${CC-cc} -c $ASFLAGS conftest.c 1>&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + libc_cv_cc_target_x86_64=yes + else + libc_cv_cc_target_x86_64=no + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_target_x86_64" >&5 +$as_echo "$libc_cv_cc_target_x86_64" >&6; } + build_mathvec=$libc_cv_cc_target_x86_64 +fi +config_vars="$config_vars +build-mathvec = $build_mathvec" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSE4 support" >&5 $as_echo_n "checking for SSE4 support... " >&6; } if ${libc_cv_cc_sse4+:} false; then : diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac index c9f9a51..91c4cdf 100644 --- a/sysdeps/x86_64/configure.ac +++ b/sysdeps/x86_64/configure.ac @@ -5,6 +5,24 @@ AC_CHECK_HEADER([cpuid.h], , [AC_MSG_ERROR([gcc must provide the header])], [/* No default includes. */]) +dnl Check if compiler target is x86_64. +if test $build_mathvec == notset; then + AC_CACHE_CHECK(for compiler target is x86_64, libc_cv_cc_target_x86_64, [dnl + cat > conftest.c <<\EOF + #if !defined (__x86_64__) + # error "target is not x86_64" + #endif +EOF + if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.c 1>&AS_MESSAGE_LOG_FD); then + libc_cv_cc_target_x86_64=yes + else + libc_cv_cc_target_x86_64=no + fi + rm -f conftest*]) + build_mathvec=$libc_cv_cc_target_x86_64 +fi +LIBC_CONFIG_VAR([build-mathvec], [$build_mathvec]) + dnl Check if -msse4 works. AC_CACHE_CHECK(for SSE4 support, libc_cv_cc_sse4, [dnl LIBC_TRY_CC_OPTION([-msse4], [libc_cv_cc_sse4=yes], [libc_cv_cc_sse4=no]) diff --git a/sysdeps/x86_64/fpu/Makefile b/sysdeps/x86_64/fpu/Makefile new file mode 100644 index 0000000..d585fa0 --- /dev/null +++ b/sysdeps/x86_64/fpu/Makefile @@ -0,0 +1,33 @@ +ifeq ($(subdir),mathvec) +libmvec-support += svml_d_cos4_core svml_d_cos_data +endif + +# Rules for libmvec tests +ifeq ($(subdir),math) +ifneq ($(PERL),no) +ifeq ($(build-mathvec),yes) +libm-tests += test-double-vlen4 test-float-vlen8 + +CFLAGS-test-double-vlen4-wrapper.c = -fno-inline -ffloat-store -fno-builtin \ + -frounding-math -mavx2 +CFLAGS-test-float-vlen8-wrapper.c = -fno-inline -ffloat-store -fno-builtin \ + -frounding-math -mavx2 + +CFLAGS-test-double-vlen4.c = -fno-inline -ffloat-store -fno-builtin \ + -frounding-math +CFLAGS-test-float-vlen8.c = -fno-inline -ffloat-store -fno-builtin \ + -frounding-math + +$(objpfx)test-double-vlen4.o: $(objpfx)libm-test.stmp +$(objpfx)test-float-vlen8.o: $(objpfx)libm-test.stmp + +$(objpfx)test-double-vlen4: $(common-objpfx)mathvec/libmvec.so \ + $(objpfx)test-double-vlen4-wrapper.o \ + $(objpfx)init-arch.o +$(objpfx)test-float-vlen8: $(common-objpfx)mathvec/libmvec.so \ + $(objpfx)test-float-vlen8-wrapper.o \ + $(objpfx)init-arch.o + +endif +endif +endif diff --git a/sysdeps/x86_64/fpu/Versions b/sysdeps/x86_64/fpu/Versions new file mode 100644 index 0000000..3d433d2 --- /dev/null +++ b/sysdeps/x86_64/fpu/Versions @@ -0,0 +1,5 @@ +libmvec { + GLIBC_2.21 { + _ZGVdN4v_cos; + } +} diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps index 36e1b76..9e4f8cd 100644 --- a/sysdeps/x86_64/fpu/libm-test-ulps +++ b/sysdeps/x86_64/fpu/libm-test-ulps @@ -1961,6 +1961,12 @@ ifloat: 3 ildouble: 4 ldouble: 4 +Function: "vlen4_cos": +double: 1 + +Function: "vlen8_cos": +float: 1 + Function: "y0": double: 2 float: 1 diff --git a/sysdeps/x86_64/fpu/svml_d_cos4_core.S b/sysdeps/x86_64/fpu/svml_d_cos4_core.S new file mode 100644 index 0000000..7c9f62e --- /dev/null +++ b/sysdeps/x86_64/fpu/svml_d_cos4_core.S @@ -0,0 +1,186 @@ +/* Function cos vectorized with AVX2. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + + .text +ENTRY(_ZGVdN4v_cos) + +/* ALGORITHM DESCRIPTION: + * + * ( low accuracy ( < 4ulp ) or enhanced performance + * ( half of correct mantissa ) implementation ) + * + * Argument representation: + * arg + Pi/2 = (N*Pi + R) + * + * Result calculation: + * cos(arg) = sin(arg+Pi/2) = sin(N*Pi + R) = (-1)^N * sin(R) + * sin(R) is approximated by corresponding polynomial + */ + pushq %rbp + movq %rsp, %rbp + andq $-64, %rsp + subq $448, %rsp + movq __gnu_svml_dcos_data@GOTPCREL(%rip), %rax + vmovapd %ymm0, %ymm1 + vmovupd 192(%rax), %ymm4 + vmovupd 256(%rax), %ymm5 + +/* ARGUMENT RANGE REDUCTION: + * Add Pi/2 to argument: X' = X+Pi/2 + */ + vaddpd 128(%rax), %ymm1, %ymm7 + +/* Get absolute argument value: X' = |X'| */ + vandpd (%rax), %ymm7, %ymm2 + +/* Y = X'*InvPi + RS : right shifter add */ + vfmadd213pd %ymm5, %ymm4, %ymm7 + vmovupd 1216(%rax), %ymm4 + +/* Check for large arguments path */ + vcmpnle_uqpd 64(%rax), %ymm2, %ymm3 + +/* N = Y - RS : right shifter sub */ + vsubpd %ymm5, %ymm7, %ymm6 + vmovupd 640(%rax), %ymm2 + +/* SignRes = Y<<63 : shift LSB to MSB place for result sign */ + vpsllq $63, %ymm7, %ymm7 + +/* N = N - 0.5 */ + vsubpd 320(%rax), %ymm6, %ymm0 + vmovmskpd %ymm3, %ecx + +/* R = X - N*Pi1 */ + vmovapd %ymm1, %ymm3 + vfnmadd231pd %ymm0, %ymm2, %ymm3 + +/* R = R - N*Pi2 */ + vfnmadd231pd 704(%rax), %ymm0, %ymm3 + +/* R = R - N*Pi3 */ + vfnmadd132pd 768(%rax), %ymm3, %ymm0 + +/* POLYNOMIAL APPROXIMATION: + * R2 = R*R + */ + vmulpd %ymm0, %ymm0, %ymm5 + vfmadd213pd 1152(%rax), %ymm5, %ymm4 + vfmadd213pd 1088(%rax), %ymm5, %ymm4 + vfmadd213pd 1024(%rax), %ymm5, %ymm4 + +/* Poly = C3+R2*(C4+R2*(C5+R2*(C6+R2*C7))) */ + vfmadd213pd 960(%rax), %ymm5, %ymm4 + vfmadd213pd 896(%rax), %ymm5, %ymm4 + vfmadd213pd 832(%rax), %ymm5, %ymm4 + vmulpd %ymm5, %ymm4, %ymm6 + vfmadd213pd %ymm0, %ymm0, %ymm6 + +/* RECONSTRUCTION: + * Final sign setting: Res = Poly^SignRes + */ + vxorpd %ymm7, %ymm6, %ymm0 + testl %ecx, %ecx + jne _LBL_1_3 + +_LBL_1_2: + movq %rbp, %rsp + popq %rbp + ret + +_LBL_1_3: + vmovupd %ymm1, 320(%rsp) + vmovupd %ymm0, 384(%rsp) + je _LBL_1_2 + + xorb %dl, %dl + xorl %eax, %eax + vmovups %ymm8, 224(%rsp) + vmovups %ymm9, 192(%rsp) + vmovups %ymm10, 160(%rsp) + vmovups %ymm11, 128(%rsp) + vmovups %ymm12, 96(%rsp) + vmovups %ymm13, 64(%rsp) + vmovups %ymm14, 32(%rsp) + vmovups %ymm15, (%rsp) + movq %rsi, 264(%rsp) + movq %rdi, 256(%rsp) + movq %r12, 296(%rsp) + movb %dl, %r12b + movq %r13, 288(%rsp) + movl %ecx, %r13d + movq %r14, 280(%rsp) + movl %eax, %r14d + movq %r15, 272(%rsp) + +_LBL_1_6: + btl %r14d, %r13d + jc _LBL_1_12 + +_LBL_1_7: + lea 1(%r14), %esi + btl %esi, %r13d + jc _LBL_1_10 + +_LBL_1_8: + incb %r12b + addl $2, %r14d + cmpb $16, %r12b + jb _LBL_1_6 + + vmovups 224(%rsp), %ymm8 + vmovups 192(%rsp), %ymm9 + vmovups 160(%rsp), %ymm10 + vmovups 128(%rsp), %ymm11 + vmovups 96(%rsp), %ymm12 + vmovups 64(%rsp), %ymm13 + vmovups 32(%rsp), %ymm14 + vmovups (%rsp), %ymm15 + vmovupd 384(%rsp), %ymm0 + movq 264(%rsp), %rsi + movq 256(%rsp), %rdi + movq 296(%rsp), %r12 + movq 288(%rsp), %r13 + movq 280(%rsp), %r14 + movq 272(%rsp), %r15 + jmp _LBL_1_2 + +_LBL_1_10: + movzbl %r12b, %r15d + shlq $4, %r15 + vmovsd 328(%rsp,%r15), %xmm0 + vzeroupper + + call cos@PLT + + vmovsd %xmm0, 392(%rsp,%r15) + jmp _LBL_1_8 + +_LBL_1_12: + movzbl %r12b, %r15d + shlq $4, %r15 + vmovsd 320(%rsp,%r15), %xmm0 + vzeroupper + + call cos@PLT + + vmovsd %xmm0, 384(%rsp,%r15) + jmp _LBL_1_7 +END(_ZGVdN4v_cos) diff --git a/sysdeps/x86_64/fpu/svml_d_cos_data.S b/sysdeps/x86_64/fpu/svml_d_cos_data.S new file mode 100644 index 0000000..0f2ff1f --- /dev/null +++ b/sysdeps/x86_64/fpu/svml_d_cos_data.S @@ -0,0 +1,492 @@ +/* Data for vectorized cos. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + + + .section .rodata, "a" + + .align 64 + .globl __gnu_svml_dcos_data + +/* Data table for vector implementations of function cos. + * The table may contain polynomial, reduction, lookup + * coefficients and other constants obtained through different + * methods of research and experimental work. + */ +__gnu_svml_dcos_data: + +/* General constants: + * lAbsMask + */ + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + +/* lRangeVal */ + .long 0x00000000 + .long 0x41600000 + .long 0x00000000 + .long 0x41600000 + .long 0x00000000 + .long 0x41600000 + .long 0x00000000 + .long 0x41600000 + .long 0x00000000 + .long 0x41600000 + .long 0x00000000 + .long 0x41600000 + .long 0x00000000 + .long 0x41600000 + .long 0x00000000 + .long 0x41600000 + +/* HalfPI */ + .long 0x54442d18 + .long 0x3ff921fb + .long 0x54442d18 + .long 0x3ff921fb + .long 0x54442d18 + .long 0x3ff921fb + .long 0x54442d18 + .long 0x3ff921fb + .long 0x54442d18 + .long 0x3ff921fb + .long 0x54442d18 + .long 0x3ff921fb + .long 0x54442d18 + .long 0x3ff921fb + .long 0x54442d18 + .long 0x3ff921fb + +/* InvPI */ + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + +/* RShifter */ + .long 0x00000000 + .long 0x43380000 + .long 0x00000000 + .long 0x43380000 + .long 0x00000000 + .long 0x43380000 + .long 0x00000000 + .long 0x43380000 + .long 0x00000000 + .long 0x43380000 + .long 0x00000000 + .long 0x43380000 + .long 0x00000000 + .long 0x43380000 + .long 0x00000000 + .long 0x43380000 + +/* OneHalf */ + .long 0x00000000 + .long 0x3fe00000 + .long 0x00000000 + .long 0x3fe00000 + .long 0x00000000 + .long 0x3fe00000 + .long 0x00000000 + .long 0x3fe00000 + .long 0x00000000 + .long 0x3fe00000 + .long 0x00000000 + .long 0x3fe00000 + .long 0x00000000 + .long 0x3fe00000 + .long 0x00000000 + .long 0x3fe00000 + +/* Range reduction PI-based constants: + * PI1 + */ + .long 0x40000000 + .long 0x400921fb + .long 0x40000000 + .long 0x400921fb + .long 0x40000000 + .long 0x400921fb + .long 0x40000000 + .long 0x400921fb + .long 0x40000000 + .long 0x400921fb + .long 0x40000000 + .long 0x400921fb + .long 0x40000000 + .long 0x400921fb + .long 0x40000000 + .long 0x400921fb + +/* PI2 */ + .long 0x00000000 + .long 0x3e84442d + .long 0x00000000 + .long 0x3e84442d + .long 0x00000000 + .long 0x3e84442d + .long 0x00000000 + .long 0x3e84442d + .long 0x00000000 + .long 0x3e84442d + .long 0x00000000 + .long 0x3e84442d + .long 0x00000000 + .long 0x3e84442d + .long 0x00000000 + .long 0x3e84442d + +/* PI3 */ + .long 0x80000000 + .long 0x3d084698 + .long 0x80000000 + .long 0x3d084698 + .long 0x80000000 + .long 0x3d084698 + .long 0x80000000 + .long 0x3d084698 + .long 0x80000000 + .long 0x3d084698 + .long 0x80000000 + .long 0x3d084698 + .long 0x80000000 + .long 0x3d084698 + .long 0x80000000 + .long 0x3d084698 + +/* PI4 */ + .long 0x701b839a + .long 0x3b88cc51 + .long 0x701b839a + .long 0x3b88cc51 + .long 0x701b839a + .long 0x3b88cc51 + .long 0x701b839a + .long 0x3b88cc51 + .long 0x701b839a + .long 0x3b88cc51 + .long 0x701b839a + .long 0x3b88cc51 + .long 0x701b839a + .long 0x3b88cc51 + .long 0x701b839a + .long 0x3b88cc51 + +/* Range reduction PI-based constants if FMA available: + * PI1_FMA + */ + .long 0x54442d18 + .long 0x400921fb + .long 0x54442d18 + .long 0x400921fb + .long 0x54442d18 + .long 0x400921fb + .long 0x54442d18 + .long 0x400921fb + .long 0x54442d18 + .long 0x400921fb + .long 0x54442d18 + .long 0x400921fb + .long 0x54442d18 + .long 0x400921fb + .long 0x54442d18 + .long 0x400921fb + +/* PI2_FMA */ + .long 0x33145c06 + .long 0x3ca1a626 + .long 0x33145c06 + .long 0x3ca1a626 + .long 0x33145c06 + .long 0x3ca1a626 + .long 0x33145c06 + .long 0x3ca1a626 + .long 0x33145c06 + .long 0x3ca1a626 + .long 0x33145c06 + .long 0x3ca1a626 + .long 0x33145c06 + .long 0x3ca1a626 + .long 0x33145c06 + .long 0x3ca1a626 + +/* PI3_FMA */ + .long 0x29024e09 + .long 0x395c1cd1 + .long 0x29024e09 + .long 0x395c1cd1 + .long 0x29024e09 + .long 0x395c1cd1 + .long 0x29024e09 + .long 0x395c1cd1 + .long 0x29024e09 + .long 0x395c1cd1 + .long 0x29024e09 + .long 0x395c1cd1 + .long 0x29024e09 + .long 0x395c1cd1 + .long 0x29024e09 + .long 0x395c1cd1 + +/* Polynomial coeffifients (relative error 2^(-52.115)): + * C1 + */ + .long 0x555554a7 + .long 0xbfc55555 + .long 0x555554a7 + .long 0xbfc55555 + .long 0x555554a7 + .long 0xbfc55555 + .long 0x555554a7 + .long 0xbfc55555 + .long 0x555554a7 + .long 0xbfc55555 + .long 0x555554a7 + .long 0xbfc55555 + .long 0x555554a7 + .long 0xbfc55555 + .long 0x555554a7 + .long 0xbfc55555 + +/* C2 */ + .long 0x1110a4a8 + .long 0x3f811111 + .long 0x1110a4a8 + .long 0x3f811111 + .long 0x1110a4a8 + .long 0x3f811111 + .long 0x1110a4a8 + .long 0x3f811111 + .long 0x1110a4a8 + .long 0x3f811111 + .long 0x1110a4a8 + .long 0x3f811111 + .long 0x1110a4a8 + .long 0x3f811111 + .long 0x1110a4a8 + .long 0x3f811111 + +/* C3 */ + .long 0x19a5b86d + .long 0xbf2a01a0 + .long 0x19a5b86d + .long 0xbf2a01a0 + .long 0x19a5b86d + .long 0xbf2a01a0 + .long 0x19a5b86d + .long 0xbf2a01a0 + .long 0x19a5b86d + .long 0xbf2a01a0 + .long 0x19a5b86d + .long 0xbf2a01a0 + .long 0x19a5b86d + .long 0xbf2a01a0 + .long 0x19a5b86d + .long 0xbf2a01a0 + +/* C4 */ + .long 0x8030fea0 + .long 0x3ec71de3 + .long 0x8030fea0 + .long 0x3ec71de3 + .long 0x8030fea0 + .long 0x3ec71de3 + .long 0x8030fea0 + .long 0x3ec71de3 + .long 0x8030fea0 + .long 0x3ec71de3 + .long 0x8030fea0 + .long 0x3ec71de3 + .long 0x8030fea0 + .long 0x3ec71de3 + .long 0x8030fea0 + .long 0x3ec71de3 + +/* C5 */ + .long 0x46002231 + .long 0xbe5ae635 + .long 0x46002231 + .long 0xbe5ae635 + .long 0x46002231 + .long 0xbe5ae635 + .long 0x46002231 + .long 0xbe5ae635 + .long 0x46002231 + .long 0xbe5ae635 + .long 0x46002231 + .long 0xbe5ae635 + .long 0x46002231 + .long 0xbe5ae635 + .long 0x46002231 + .long 0xbe5ae635 + +/* C6 */ + .long 0x57a2f220 + .long 0x3de60e68 + .long 0x57a2f220 + .long 0x3de60e68 + .long 0x57a2f220 + .long 0x3de60e68 + .long 0x57a2f220 + .long 0x3de60e68 + .long 0x57a2f220 + .long 0x3de60e68 + .long 0x57a2f220 + .long 0x3de60e68 + .long 0x57a2f220 + .long 0x3de60e68 + .long 0x57a2f220 + .long 0x3de60e68 + +/* C7 */ + .long 0x0811aac8 + .long 0xbd69f0d6 + .long 0x0811aac8 + .long 0xbd69f0d6 + .long 0x0811aac8 + .long 0xbd69f0d6 + .long 0x0811aac8 + .long 0xbd69f0d6 + .long 0x0811aac8 + .long 0xbd69f0d6 + .long 0x0811aac8 + .long 0xbd69f0d6 + .long 0x0811aac8 + .long 0xbd69f0d6 + .long 0x0811aac8 + .long 0xbd69f0d6 + +/* Additional constants: + * AbsMask + */ + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + .long 0xffffffff + .long 0x7fffffff + +/* InvPI */ + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + .long 0x6dc9c883 + .long 0x3fd45f30 + +/* RShifter_la */ + .long 0x00000000 + .long 0x43300000 + .long 0x00000000 + .long 0x43300000 + .long 0x00000000 + .long 0x43300000 + .long 0x00000000 + .long 0x43300000 + .long 0x00000000 + .long 0x43300000 + .long 0x00000000 + .long 0x43300000 + .long 0x00000000 + .long 0x43300000 + .long 0x00000000 + .long 0x43300000 + +/* RShifter_la */ + .long 0xffffffff + .long 0x432fffff + .long 0xffffffff + .long 0x432fffff + .long 0xffffffff + .long 0x432fffff + .long 0xffffffff + .long 0x432fffff + .long 0xffffffff + .long 0x432fffff + .long 0xffffffff + .long 0x432fffff + .long 0xffffffff + .long 0x432fffff + .long 0xffffffff + .long 0x432fffff + +/* RSXmax_la */ + .long 0x007ffffe + .long 0x43300000 + .long 0x007ffffe + .long 0x43300000 + .long 0x007ffffe + .long 0x43300000 + .long 0x007ffffe + .long 0x43300000 + .long 0x007ffffe + .long 0x43300000 + .long 0x007ffffe + .long 0x43300000 + .long 0x007ffffe + .long 0x43300000 + .long 0x007ffffe + .long 0x43300000 + .type __gnu_svml_dcos_data,@object + .size __gnu_svml_dcos_data,.-__gnu_svml_dcos_data diff --git a/sysdeps/x86_64/fpu/test-double-vlen4-wrapper.c b/sysdeps/x86_64/fpu/test-double-vlen4-wrapper.c new file mode 100644 index 0000000..0778e23 --- /dev/null +++ b/sysdeps/x86_64/fpu/test-double-vlen4-wrapper.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include "test-double-vlen4.h" + +// Wrapper from scalar to vector function implemented in AVX2. +#define VECTOR_WRAPPER(scalar_func, vector_func) \ +extern __m256d vector_func(__m256d); \ +FLOAT scalar_func(FLOAT x)\ +{\ + int i;\ + __m256d mx = _mm256_set1_pd(x);\ + __m256d mr = vector_func(mx);\ + for(i=1;i<4;i++)\ + {\ + if (((FLOAT*)&mr)[0]!=((FLOAT*)&mr)[i])\ + {\ + return ((FLOAT*)&mr)[0]+0.1;\ + }\ + }\ + return ((FLOAT*)&mr)[0];\ +} + +#include + +VECTOR_WRAPPER (WRAPPER_NAME (cos), _ZGVdN4v_cos) diff --git a/sysdeps/x86_64/fpu/test-double-vlen4.c b/sysdeps/x86_64/fpu/test-double-vlen4.c new file mode 100644 index 0000000..4d3d9a3 --- /dev/null +++ b/sysdeps/x86_64/fpu/test-double-vlen4.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define FUNC(function) function +#define TEST_MSG "testing double vector math (without inline functions)\n" +#define MATHCONST(x) x +#define CHOOSE(Clongdouble,Cdouble,Cfloat,Cinlinelongdouble,Cinlinedouble,Cinlinefloat) Cdouble +#define PRINTF_EXPR "e" +#define PRINTF_XEXPR "a" +#define PRINTF_NEXPR "f" +#define TEST_DOUBLE 1 + +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES +#endif + +#define EXCEPTION_TESTS_double 0 +#define ROUNDING_TESTS_double(MODE) ((MODE) == FE_TONEAREST) + +#define TEST_MATHVEC 1 +#define CHECK_ARCH_EXT if (!avx2_usable) return; + +#include "test-double-vlen4.h" + +extern FLOAT WRAPPER_NAME (cos) (FLOAT); + +#include "libm-test.c" diff --git a/sysdeps/x86_64/fpu/test-double-vlen4.h b/sysdeps/x86_64/fpu/test-double-vlen4.h new file mode 100644 index 0000000..f664fa6 --- /dev/null +++ b/sysdeps/x86_64/fpu/test-double-vlen4.h @@ -0,0 +1,8 @@ + +#define FLOAT double + +#define VEC_PREFIX vlen4_ + +#define CONC(a,b) a ## b +#define CONC1(a,b) CONC(a,b) +#define WRAPPER_NAME(function) CONC1(VEC_PREFIX,function) diff --git a/sysdeps/x86_64/fpu/test-float-vlen8-wrapper.c b/sysdeps/x86_64/fpu/test-float-vlen8-wrapper.c new file mode 100644 index 0000000..a11d853 --- /dev/null +++ b/sysdeps/x86_64/fpu/test-float-vlen8-wrapper.c @@ -0,0 +1,39 @@ +/* Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include "test-float-vlen8.h" + +#include + +//extern __m256 _ZGVdN8v_cosf(__m256); + +float vlen8_cosf(float x) +{ + int i; + __m256 mx = _mm256_set1_ps(x); + __m256 mr = mx; //_ZGVdN8v_cosf(mx); + + for(i=1;i<8;i++) + { + if(((float*)&mr)[0]!=((float*)&mr)[i]) + { + return ((float*)&mr)[0]+0.1; + } + } + + return ((float*)&mr)[0]; +} diff --git a/sysdeps/x86_64/fpu/test-float-vlen8.c b/sysdeps/x86_64/fpu/test-float-vlen8.c new file mode 100644 index 0000000..7bfc814 --- /dev/null +++ b/sysdeps/x86_64/fpu/test-float-vlen8.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define FUNC(function) function ## f +#define TEST_MSG "testing double vector math (without inline functions)\n" +#define MATHCONST(x) x +#define CHOOSE(Clongdouble,Cdouble,Cfloat,Cinlinelongdouble,Cinlinedouble,Cinlinefloat) Cfloat +#define PRINTF_EXPR "e" +#define PRINTF_XEXPR "a" +#define PRINTF_NEXPR "f" +#define TEST_FLOAT 1 + +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES +#endif + +#define EXCEPTION_TESTS_float 0 +#define ROUNDING_TESTS_float(MODE) ((MODE) == FE_TONEAREST) + +#define TEST_MATHVEC 1 +#define CHECK_ARCH_EXT if (!avx2_usable) return; + +#include "test-float-vlen8.h" + +extern FLOAT WRAPPER_NAME (cosf) (FLOAT); + +#include "libm-test.c" diff --git a/sysdeps/x86_64/fpu/test-float-vlen8.h b/sysdeps/x86_64/fpu/test-float-vlen8.h new file mode 100644 index 0000000..bf28229 --- /dev/null +++ b/sysdeps/x86_64/fpu/test-float-vlen8.h @@ -0,0 +1,8 @@ + +#define FLOAT float + +#define VEC_PREFIX vlen8_ + +#define CONC(a,b) a ## b +#define CONC1(a,b) CONC(a,b) +#define WRAPPER_NAME(function) CONC1(VEC_PREFIX,function)