about summary refs log tree commit diff
path: root/sysdeps/i386/fpu/s_ceilf.S
Commit message (Collapse)AuthorAgeFilesLines
* math: x86 ceill traps when FE_INEXACT is enabled (BZ 31600)Adhemerval Zanella2024-04-041-34/+0
| | | | | | | | | | | | | The implementations of ceil functions using x87 floating point (i386 and x86_64 long double only) traps when FE_INEXACT is enabled. Although this is a GNU extension outside the scope of the C standard, other architectures that also support traps do not show this behavior. The fix moves the implementation to a common one that holds any exceptions with a 'fnclex' (libc_feholdexcept_setround_387). Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* Remove "Contributed by" linesSiddhesh Poyarekar2021-09-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | We stopped adding "Contributed by" or similar lines in sources in 2012 in favour of git logs and keeping the Contributors section of the glibc manual up to date. Removing these lines makes the license header a bit more consistent across files and also removes the possibility of error in attribution when license blocks or files are copied across since the contributed-by lines don't actually reflect reality in those cases. Move all "Contributed by" and similar lines (Written by, Test by, etc.) into a new file CONTRIBUTED-BY to retain record of these contributions. These contributors are also mentioned in manual/contrib.texi, so we just maintain this additional record as a courtesy to the earlier developers. The following scripts were used to filter a list of files to edit in place and to clean up the CONTRIBUTED-BY file respectively. These were not added to the glibc sources because they're not expected to be of any use in future given that this is a one time task: https://gist.github.com/siddhesh/b5ecac94eabfd72ed2916d6d8157e7dc https://gist.github.com/siddhesh/15ea1f5e435ace9774f485030695ee02 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Use libm_alias_float for i386.Joseph Myers2017-11-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx function aliases, this patch makes i386 libm function implementations use libm_alias_float (or libm_alias_float_other in cases where the main symbol name is defined with versioned_symbol) to define function aliases. Tested with build-many-glibcs.py for all its i386 configurations that installed stripped shared libraries are unchanged by the patch, as well as running the full glibc testsuite for i686. * sysdeps/i386/fpu/s_asinhf.S: Include <libm-alias-float.h>. (asinhf): Define using libm_alias_float. * sysdeps/i386/fpu/s_atanf.S: Include <libm-alias-float.h>. (atanf): Define using libm_alias_float. * sysdeps/i386/fpu/s_cbrtf.S: Include <libm-alias-float.h>. (cbrtf): Define using libm_alias_float. * sysdeps/i386/fpu/s_ceilf.S: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/i386/fpu/s_copysignf.S: Include <libm-alias-float.h>. (copysignf): Define using libm_alias_float. * sysdeps/i386/fpu/s_expm1f.S: Include <libm-alias-float.h>. (expm1f): Define using libm_alias_float. * sysdeps/i386/fpu/s_fabsf.S: Include <libm-alias-float.h>. (fabsf): Define using libm_alias_float. * sysdeps/i386/fpu/s_floorf.S: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/i386/fpu/s_fmaxf.S: Include <libm-alias-float.h>. (fmaxf): Define using libm_alias_float. * sysdeps/i386/fpu/s_fminf.S: Include <libm-alias-float.h>. (fminf): Define using libm_alias_float. * sysdeps/i386/fpu/s_frexpf.S: Include <libm-alias-float.h>. (frexpf): Define using libm_alias_float. * sysdeps/i386/fpu/s_llrintf.S: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/i386/fpu/s_logbf.S: Include <libm-alias-float.h>. (logbf): Define using libm_alias_float. * sysdeps/i386/fpu/s_lrintf.S: Include <libm-alias-float.h>. (lrintf): Define using libm_alias_float. * sysdeps/i386/fpu/s_nearbyintf.S: Include <libm-alias-float.h>. (nearbyintf): Define using libm_alias_float. * sysdeps/i386/fpu/s_remquof.S: Include <libm-alias-float.h>. (remquof): Define using libm_alias_float. * sysdeps/i386/fpu/s_rintf.S: Include <libm-alias-float.h>. (rintf): Define using libm_alias_float. * sysdeps/i386/fpu/s_truncf.S: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float. * sysdeps/i386/i686/fpu/multiarch/e_exp2f.c: Include <libm-alias-float.h>. (exp2f): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/i386/i686/fpu/multiarch/e_expf.c: Include <libm-alias-float.h>. (expf): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/i386/i686/fpu/multiarch/e_log2f.c: Include <libm-alias-float.h>. (log2f): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/i386/i686/fpu/multiarch/e_logf.c: Include <libm-alias-float.h>. (logf): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/i386/i686/fpu/multiarch/e_powf.c: Include <libm-alias-float.h>. (powf): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Include <libm-alias-float.h>. (cosf): Define using libm_alias_float. * sysdeps/i386/i686/fpu/multiarch/s_sincosf.c: Include <libm-alias-float.h>. (sincosf): Define using libm_alias_float. * sysdeps/i386/i686/fpu/multiarch/s_sinf.c: Include <libm-alias-float.h>. (sinf): Define using libm_alias_float. * sysdeps/i386/i686/fpu/s_fmaxf.S: Include <libm-alias-float.h>. (fmaxf): Define using libm_alias_float. * sysdeps/i386/i686/fpu/s_fminf.S: Include <libm-alias-float.h>. (fminf): Define using libm_alias_float. * sysdeps/i386/i686/multiarch/s_fmaf.c: Include <libm-alias-float.h>. (fmaf): Define using libm_alias_float.
* Avoid "inexact" exceptions in i386/x86_64 ceil functions (bug 15479).Joseph Myers2016-06-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in <https://sourceware.org/ml/libc-alpha/2016-05/msg00577.html>, TS 18661-1 disallows ceil, floor, round and trunc functions from raising the "inexact" exception, in accordance with general IEEE 754 semantics for when that exception is raised. Fixing this for x87 floating point is more complicated than for the other versions of these functions, because they use the frndint instruction that raises "inexact" and this can only be avoided by saving and restoring the whole floating-point environment. As I noted in <https://sourceware.org/ml/libc-alpha/2016-06/msg00128.html>, I have now implemented a GCC option -fno-fp-int-builtin-inexact for GCC 7, such that GCC will inline these functions on x86, without caring about "inexact", when the default -ffp-int-builtin-inexact is in effect. This allows users to get optimized code depending on the options they pass to the compiler, while making the out-of-line functions follow TS 18661-1 semantics and avoid "inexact". This patch duly fixes the out-of-line ceil function implementations to avoid "inexact", in the same way as the nearbyint implementations. I do not know how the performance of implementations such as these based on saving the environment and changing the rounding mode temporarily compares to that of the C versions or SSE 4.1 versions (of course, for 32-bit x86 SSE implementations still need to get the return value in an x87 register); it's entirely possible other implementations could be faster in some cases. Tested for x86_64 and x86. [BZ #15479] * sysdeps/i386/fpu/s_ceil.S (__ceil): Save and restore floating-point environment rather than just control word. * sysdeps/i386/fpu/s_ceilf.S (__ceilf): Likewise. * sysdeps/i386/fpu/s_ceill.S (__ceill): Save and restore floating-point environment, with "invalid" exceptions merged in, rather than just control word. * sysdeps/x86_64/fpu/s_ceill.S (__ceill): Likewise. * math/libm-test.inc (ceil_test_data): Do not allow spurious "inexact" exceptions.
* Add CFI to x86 ceil / floor / trunc (bug 16681).Joseph Myers2014-06-161-0/+2
| | | | | | | | | | | | | | | | | | | This patch adds CFI to the sysdeps/i386/fpu/ implementations of ceil, floor and trunc functions, for consistency with other x86 .S files in glibc which have CFI for stack adjustments. Tested x86. [BZ #16681] * sysdeps/i386/fpu/s_ceil.S (__ceil): Add CFI. * sysdeps/i386/fpu/s_ceilf.S (__ceilf): Likewise. * sysdeps/i386/fpu/s_ceill.S (__ceill): Likewise. * sysdeps/i386/fpu/s_floor.S (__floor): Likewise. * sysdeps/i386/fpu/s_floorf.S (__floorf): Likewise. * sysdeps/i386/fpu/s_floorl.S (__floorl): Likewise. * sysdeps/i386/fpu/s_trunc.S (__trunc): Likewise. * sysdeps/i386/fpu/s_truncf.S (__truncf): Likewise. * sysdeps/i386/fpu/s_truncl.S (__truncl): Likewise.
* Update.Ulrich Drepper1999-07-141-0/+32