about summary refs log tree commit diff
path: root/sysdeps/ieee754/flt-32/s_sinf.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* New generic sincosfRajalakshmi Srinivasaraghavan2017-12-161-100/+7
| | | | | This implementation is based on generic s_sinf.c and s_cosf.c. Tested on s390x, powerpc64le and powerpc32.
* math: Use sign as double for reduced case in sinfAdhemerval Zanella2017-12-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch avoid an extra floating point to integer conversion in reduced internal function for generic sinf by defining the sign as double instead of integers. There is no much difference on Haswell with GCC 7.2.1: Before After min 9.11 9.108 mean 21.982 21.9224 However H.J. Lu reported gains on Skylake: Before: "sinf": { "": { "duration": 3.4044e+10, "iterations": 1.9942e+09, "max": 141.106, "min": 7.704, "mean": 17.0715 } } After: "sinf": { "": { "duration": 3.40665e+10, "iterations": 2.03199e+09, "max": 95.994, "min": 7.704, "mean": 16.765 } } Checked on x86_64-linux-gnu. * sysdeps/ieee754/flt-32/s_sinf.c (ones): Define as double. (reduced): Use ones as double instead of integer.
* [PATCH] fix sinf(NAN)Szabolcs Nagy2017-12-051-3/+3
| | | | | | | | | sinf(NAN) should not signal invalid fp exception so use isless instead of < where NAN is compared. this makes the sinf tests pass on aarch64. * sysdeps/ieee754/flt-32/s_sinf.c (sinf): Use isless.
* s_sinf.c: Replace floor with simple castsH.J. Lu2017-12-051-6/+6
| | | | | | | | | | | | | | | | | | | | Since s_sinf.c either assigns the return value of floor to integer or passes double converted from integer to floor, this patch replaces floor with simple casts. Also since long == int for 32-bit targets, we can use long instead of int to avoid 64-bit integer for 64-bit targets. On Skylake, bench-sinf reports performance improvement: Before After Improvement max 130.566 129.564 30% min 7.704 7.706 0% mean 21.8188 19.1363 30% * sysdeps/ieee754/flt-32/s_sinf.c (reduced): Replace long with int. (SINF_FUNC): Likewise. Replace floor with simple casts.
* Use __floor not floor in sinf.Joseph Myers2017-12-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | The new sinf implementation introduced localplt failures for all platforms where the compiler did not inline the calls to floor (converted to trunc by machine-independent optimizations). This patch changes the calls to use __floor as normal in libm. We can't use the public function names floor / floorf / floorl / floorf128 in libm code in the absence of appropriate asms to redirect floor/trunc calls, if not inlined, to use the internal names instead (while avoiding breaking code building the floor functions themselves) - while having such asms and then calling the public functions unconditionally would be desirable for optimization (few architectures have __floor inlines in math_private.h, and once the built-in function is used you don't need them), using __floor is the minimum safe fix for the present test regressions. Tested with build-many-glibcs.py that this fixes the localplt test failure for arm-linux-gnueabi. * sysdeps/ieee754/flt-32/s_sinf.c (SINF_FUNC): Use __floor instead of floor.
* New generic sinfRajalakshmi Srinivasaraghavan2017-12-041-41/+226
| | | | | This implementation is based on optimized sinf assembly versions of x86_64 and powerpc.
* Use libm_alias_float in flt-32.Joseph Myers2017-09-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes flt-32 libm functions use libm_alias_float to define public interfaces (in cases where _Float32 aliases of those interfaces would be appropriate, so not for finitef / isinff / isnanf). Tested for x86_64. Also tested with build-many-glibcs.py that installed stripped shared libraries are unchanged by the patch. * sysdeps/ieee754/flt-32/s_asinhf.c: Include <libm-alias-float.h>. (asinhf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_atanf.c: Include <libm-alias-float.h>. (atanf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_cbrtf.c: Include <libm-alias-float.h>. (cbrtf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_ceilf.c: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_copysignf.c: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_cosf.c: Include <libm-alias-float.h>. (cosf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_erff.c: Include <libm-alias-float.h>. (erff): Define using libm_alias_float. (erfcf): Likewise. * sysdeps/ieee754/flt-32/s_expm1f.c: Include <libm-alias-float.h>. (expm1f): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_fabsf.c: Include <libm-alias-float.h>. (fabsf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_floorf.c: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_frexpf.c: Include <libm-alias-float.h>. (frexpf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_fromfpf.c (fromfpf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_fromfpf_main.c: Include <libm-alias-float.h>. * sysdeps/ieee754/flt-32/s_fromfpxf.c (fromfpxf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_getpayloadf.c: Include <libm-alias-float.h>. (getpayloadf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_llrintf.c: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_llroundf.c: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_logbf.c: Include <libm-alias-float.h>. (logbf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_lrintf.c: Include <libm-alias-float.h>. (lrintf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_lroundf.c: Include <libm-alias-float.h>. (lroundf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_modff.c: Include <libm-alias-float.h>. (modff): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_nearbyintf.c: Include <libm-alias-float.h>. (nearbyintf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_nextafterf.c: Include <libm-alias-float.h>. (nextafterf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_nextupf.c: Include <libm-alias-float.h>. (nextupf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_remquof.c: Include <libm-alias-float.h>. (remquof): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_rintf.c: Include <libm-alias-float.h>. (rintf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_roundevenf.c: Include <libm-alias-float.h>. (roundevenf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_roundf.c: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_setpayloadf.c (setpayloadf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_setpayloadf_main.c: Include <libm-alias-float.h>. * sysdeps/ieee754/flt-32/s_setpayloadsigf.c (setpayloadsigf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_sincosf.c: Include <libm-alias-float.h>. (sincosf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_sinf.c: Include <libm-alias-float.h>. (sinf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_tanf.c: Include <libm-alias-float.h>. (tanf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_tanhf.c: Include <libm-alias-float.h>. (tanhf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_totalorderf.c: Include <libm-alias-float.h>. (totalorderf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_totalordermagf.c: Include <libm-alias-float.h>. (totalordermagf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_truncf.c: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_ufromfpf.c (ufromfpf): Define using libm_alias_float. * sysdeps/ieee754/flt-32/s_ufromfpxf.c (ufromfpxf): Define using libm_alias_float.
* Add optimized sinf and cosf routines for x86 and x86-64Liubov Dmitrieva2012-09-031-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * sysdeps/i386/i686/fpu/multiarch/Makefile (sysdep_routines): Add s_sinf-sse2, s_conf-sse2. * sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.S: New file. * sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.S: New file. * sysdeps/i386/i686/fpu/multiarch/s_sinf.c: New file. * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: New file. * sysdeps/ieee754/flt-32/s_sinf.c (SINF, SINF_FUNC): Add macros for using routine as __sinf_ia32. Use macro for function declaration and weak_alias. * sysdeps/ieee754/flt-32/s_cosf.c (COSF, COSF_FUNC): Add macros for using routine as __cosf_ia32. Use macro for function declaration and weak_alias. * sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S: Fix Copyright. * sysdeps/i386/i686/fpu/multiarch/e_expf.c: Fix Copyright. * sysdeps/x86_64/fpu/s_sinf.S: New file. * sysdeps/x86_64/fpu/s_cosf.S: New file. * sysdeps/x86_64/fpu/libm-test-ulps: Update. * math/libm-test.inc (cos_test): Add more test cases. (sin_test): Likewise. (sincos_test): Likewise.
* Use <> for math.h and math_private.h everywhere.Richard Henderson2012-03-091-2/+2
| | | | Entire tree edited via find | grep | sed.
* Remove __STDC__ conditionals from libm.Joseph Myers2012-01-271-6/+1
|
* * sysdeps/i386/fpu/s_cos.S: Set errno for ±Inf.Ulrich Drepper2009-04-261-2/+7
| | | | | | | | | | | | | | | | | * sysdeps/i386/fpu/s_cosf.S: Likewise. * sysdeps/i386/fpu/s_cosl.S: Likewise. * sysdeps/i386/fpu/s_sin.S: Likewise. * sysdeps/i386/fpu/s_sinf.S: Likewise. * sysdeps/i386/fpu/s_sinl.S: Likewise. * sysdeps/ieee754/dbl-64/s_sin.c: Likewise. * sysdeps/ieee754/flt-32/s_cosf.c: Likewise. * sysdeps/ieee754/flt-32/s_sinf.c: Likewise. * sysdeps/ieee754/ldbl-96/s_cosl.c: Likewise. * sysdeps/ieee754/ldbl-96/s_sinl.c: Likewise. * sysdeps/x86_64/fpu/s_cosl.S: Likewise. * sysdeps/x86_64/fpu/s_sinl.S: Likewise. * math/libm-test.inc: Add tests for errno after sin/cos calls with ±Inf.
* Update.Ulrich Drepper1999-07-141-0/+54