about summary refs log tree commit diff
path: root/sysdeps/aarch64/fpu
Commit message (Collapse)AuthorAgeFilesLines
...
* [AArch64] Fix testsuite error due to fpsr/fscr changeWilco Dijkstra2018-02-101-0/+2
| | | | | | Add features.h include for __GNUC_PREREQ. * sysdeps/aarch64/fpu/fpu_control.h: Add features.h to fix build error.
* [AArch64] Use builtins for fpcr/fpsrWilco Dijkstra2018-02-091-4/+11
| | | | | | | | | | Since GCC has support for accessing FPSR/FPCR, use them when possible so that the asm instructions can be removed eventually. Although GCC 5 supports the builtins, it has an optimization bug, so use them from GCC 6 onwards. * sysdeps/aarch64/fpu/fpu_control.h: Use builtins for accessing FPCR/FPSR.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-0148-48/+48
| | | | | | | * 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.
* Use libm_alias_float for aarch64.Joseph Myers2017-11-2813-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx function aliases, this patch makes aarch64 libm function implementations use libm_alias_float to define function aliases. Tested with build-many-glibcs.py for aarch64-linux-gnu that installed stripped shared libraries are unchanged by the patch. * sysdeps/aarch64/fpu/s_ceilf.c: Include <libm-alias-float.h>. (ceilf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_floorf.c: Include <libm-alias-float.h>. (floorf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_fmaf.c: Include <libm-alias-float.h>. (fmaf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_fmaxf.c: Include <libm-alias-float.h>. (fmaxf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_fminf.c: Include <libm-alias-float.h>. (fminf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_llrintf.c: Include <libm-alias-float.h>. (llrintf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_llroundf.c: Include <libm-alias-float.h>. (llroundf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_lrintf.c: Include <libm-alias-float.h>. (lrintf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_lroundf.c: Include <libm-alias-float.h>. (lroundf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_nearbyintf.c: Include <libm-alias-float.h>. (nearbyintf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_rintf.c: Include <libm-alias-float.h>. (rintf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_roundf.c: Include <libm-alias-float.h>. (roundf): Define using libm_alias_float. * sysdeps/aarch64/fpu/s_truncf.c: Include <libm-alias-float.h>. (truncf): Define using libm_alias_float.
* Use libm_alias_double for aarch64.Joseph Myers2017-11-2713-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the preparation for additional _FloatN / _FloatNx function aliases, this patch makes aarch64 libm function implementations use libm_alias_double to define function aliases. Tested with build-many-glibcs.py for aarch64-linux-gnu that installed stripped shared libraries are unchanged by the patch. * sysdeps/aarch64/fpu/s_ceil.c: Include <libm-alias-double.h>. (ceil): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_floor.c: Include <libm-alias-double.h>. (floor): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_fma.c: Include <libm-alias-double.h>. (fma): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_fmax.c: Include <libm-alias-double.h>. (fmax): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_fmin.c: Include <libm-alias-double.h>. (fmin): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_llrint.c: Include <libm-alias-double.h>. (llrint): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_llround.c: Include <libm-alias-double.h>. (llround): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_lrint.c: Include <libm-alias-double.h>. (lrint): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_lround.c: Include <libm-alias-double.h>. (lround): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_nearbyint.c: Include <libm-alias-double.h>. (nearbyint): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_rint.c: Include <libm-alias-double.h>. (rint): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_round.c: Include <libm-alias-double.h>. (round): Define using libm_alias_double. * sysdeps/aarch64/fpu/s_trunc.c: Include <libm-alias-double.h>. (trunc): Define using libm_alias_double.
* aarch64: Fix f{max,min}{f} build for GCC 4.9 and 5Adhemerval Zanella2017-11-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | GCC 4.9 and 5 do not generate a correct f{max,min}nm instruction for __builtin_{fmax,fmin}{f} without -ffinite-math-only. It is clear a compiler issue since the instruction can handle NaN and Inf correctly and GCC6+ does not show this issue. We can backport a fix to GCC 5, raise the minimum required GCC version for aarch64 (since GCC 4.9 branch is now closed [1]) and/or add configure check to check for this issue. However I think -ffinite-math-only should be safe for these specific implementations and it is a simpler solution. Checked on aarch64-linux-gnu with GCC 5.3.1. * sysdeps/aarch64/fpu/Makefile (CFLAGS-s_fmax.c, CFLAGS-s_fmaxf.c, CFLAGS-s_fmin.c, CFLAGS-s_fminf.c): New rule: add -ffinite-math-only. [1] https://gcc.gnu.org/ml/gcc/2016-08/msg00010.html Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* aarch64: Add missing math Makefile for recent commitSzabolcs Nagy2017-10-231-0/+8
| | | | | Without -fno-math-errno, the builtins just do a call instead of inlining a single instruction.
* aarch64: Implement math acceleration via builtinsMichael Collison2017-10-2330-288/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts asm statements into builtins for AArch64. As an example for the file sysdeps/aarch64/fpu/s_ceil.c, we convert the function from double __ceil (double x) { double result; asm ("frintp\t%d0, %d1" : "=w" (result) : "w" (x) ); return result; } into double __ceil (double x) { return __builtin_ceil (x); } Tested on aarch64-linux-gnu with gcc-4.9.4 and gcc-6. * sysdeps/aarch64/fpu/e_sqrt.c (ieee754_sqrt): Replace asm statements with __builtin_sqrt. * sysdeps/aarch64/fpu/e_sqrtf.c (ieee754_sqrtf): Replace asm statements with __builtin_sqrtf. * sysdeps/aarch64/fpu/s_ceil.c (__ceil): Replace asm statements with __builtin_ceil. * sysdeps/aarch64/fpu/s_ceilf.c (__ceilf): Replace asm statements with __builtin_ceilf. * sysdeps/aarch64/fpu/s_floor.c (__floor): Replace asm statements with __builtin_floor. * sysdeps/aarch64/fpu/s_floorf.c (__floorf): Replace asm statements with __builtin_floorf. * sysdeps/aarch64/fpu/s_fma.c (__fma): Replace asm statements with __builtin_fma. * sysdeps/aarch64/fpu/s_fmaf.c (__fmaf): Replace asm statements with __builtin_fmaf. * sysdeps/aarch64/fpu/s_fmax.c (__fmax): Replace asm statements with __builtin_fmax. * sysdeps/aarch64/fpu/s_fmaxf.c (__fmaxf): Replace asm statements with __builtin_fmaxf. * sysdeps/aarch64/fpu/s_fmin.c (__fmin): Replace asm statements with __builtin_fmin. * sysdeps/aarch64/fpu/s_fminf.c (__fminf): Replace asm statements with __builtin_fminf. * sysdeps/aarch64/fpu/s_frint.c: Delete file. * sysdeps/aarch64/fpu/s_frintf.c: Delete file. * sysdeps/aarch64/fpu/s_llrint.c (__llrint): Replace asm statements with builtin_rint and conversion to int. * sysdeps/aarch64/fpu/s_llrintf.c (__llrintf): Likewise. * sysdeps/aarch64/fpu/s_llround.c (__llround): Replace asm statements with builtin_llround. * sysdeps/aarch64/fpu/s_llroundf.c (__llroundf): Likewise. * sysdeps/aarch64/fpu/s_lrint.c (__lrint): Replace asm statements with builtin_rint and conversion to long int. * sysdeps/aarch64/fpu/s_lrintf.c (__lrintf): Likewise. * sysdeps/aarch64/fpu/s_lround.c (__lround): Replace asm statements with builtin_lround. * sysdeps/aarch64/fpu/s_lroundf.c (__lroundf): Replace asm statements with builtin_lroundf. * sysdeps/aarch64/fpu/s_nearbyint.c (__nearbyint): Replace asm statements with __builtin_nearbyint. * sysdeps/aarch64/fpu/s_nearbyintf.c (__nearbyintf): Replace asm statements with __builtin_nearbyintf. * sysdeps/aarch64/fpu/s_rint.c (__rint): Replace asm statements with __builtin_rint. * sysdeps/aarch64/fpu/s_rintf.c (__rintf): Replace asm statements with __builtin_rintf. * sysdeps/aarch64/fpu/s_round.c (__round): Replace asm statements with __builtin_round. * sysdeps/aarch64/fpu/s_roundf.c (__roundf): Replace asm statements with __builtin_roundf. * sysdeps/aarch64/fpu/s_trunc.c (__trunc): Replace asm statements with __builtin_trunc. * sysdeps/aarch64/fpu/s_truncf.c (__truncf): Replace asm statements with __builtin_truncf. * sysdeps/aarch64/fpu/Makefile: Build e_sqrt[f].c with -fno-math-errno.
* Optimized generic expf and exp2f with wrappersSzabolcs Nagy2017-09-251-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on new expf and exp2f code from https://github.com/ARM-software/optimized-routines/ with wrapper on aarch64: expf reciprocal-throughput: 2.3x faster expf latency: 1.7x faster without wrapper on aarch64: expf reciprocal-throughput: 3.3x faster expf latency: 1.7x faster without wrapper on aarch64: exp2f reciprocal-throughput: 2.8x faster exp2f latency: 1.3x faster libm.so size on aarch64: .text size: -152 bytes .rodata size: -1740 bytes expf/exp2f worst case nearest rounding error: 0.502 ulp worst case non-nearest rounding error: 1 ulp Error checks are inline and errno setting is in separate tail called functions, but the wrappers are kept in this patch to handle the _LIB_VERSION==_SVID_ case. (So e.g. errno is set twice for expf calls and once for __expf_finite calls on targets where the new code is used.) Double precision arithmetics is used which is expected to be faster on most targets (including soft-float) than using single precision and it is easier to get good precision result with it. Const data is kept in a separate translation unit which complicates maintenance a bit, but is expected to give good code for literal loads on most targets and allows sharing data across expf, exp2f and powf. (This data is disabled on i386, m68k and ia64 which have their own expf, exp2f and powf code.) Some details may need target specific tweaks: - best convert and round to int operation in the arg reduction may be different across targets. - code was optimized on fma target, optimal polynomial eval may be different without fma. - gcc does not always generate good code for fp bit representation access via unions or it may be inherently slow on some targets. The libm-test-ulps will need adjustment because.. - The argument reduction ideally uses nearest rounded rint, but that is not efficient on most targets, so the polynomial can get evaluated on a wider interval in non-nearest rounding mode making 1 ulp errors common in that case. - The polynomial is evaluated such that it may have 1 ulp error on negative tiny inputs with upward rounding. * math/Makefile (type-float-routines): Add math_errf and e_exp2f_data. * sysdeps/aarch64/fpu/math_private.h (TOINT_INTRINSICS): Define. (roundtoint, converttoint): Likewise. * sysdeps/ieee754/flt-32/e_expf.c: New implementation. * sysdeps/ieee754/flt-32/e_exp2f.c: New implementation. * sysdeps/ieee754/flt-32/e_exp2f_data.c: New file. * sysdeps/ieee754/flt-32/math_config.h: New file. * sysdeps/ieee754/flt-32/math_errf.c: New file. * sysdeps/ieee754/flt-32/t_exp2f.h: Remove. * sysdeps/i386/fpu/e_exp2f_data.c: New file. * sysdeps/i386/fpu/math_errf.c: New file. * sysdeps/ia64/fpu/e_exp2f_data.c: New file. * sysdeps/ia64/fpu/math_errf.c: New file. * sysdeps/m68k/m680x0/fpu/e_exp2f_data.c: New file. * sysdeps/m68k/m680x0/fpu/math_errf.c: New file.
* ILP32 math changesSteve Ellcey2017-08-318-12/+87
| | | | | | | | | | | | | | | | | | | | | | * sysdeps/aarch64/fpu/s_llrint.c (OREG_SIZE): New macro. * sysdeps/aarch64/fpu/s_llround.c (OREG_SIZE): Likewise. * sysdeps/aarch64/fpu/s_llrintf.c (OREGS, IREGS): Remove. (IREG_SIZE, OREG_SIZE): New macros. * sysdeps/aarch64/fpu/s_llroundf.c: (OREGS, IREGS): Remove. (IREG_SIZE, OREG_SIZE): New macros. * sysdeps/aarch64/fpu/s_lrintf.c (IREGS): Remove. (IREG_SIZE): New macro. * sysdeps/aarch64/fpu/s_lroundf.c (IREGS): Remove. (IREG_SIZE): New macro. * sysdeps/aarch64/fpu/s_lrint.c (get-rounding-mode.h, stdint.h): New includes. (IREG_SIZE, OREG_SIZE): Initialize if not already set. (OREGS, IREGS): Set based on IREG_SIZE and OREG_SIZE. (__CONCATX): Handle exceptions correctly on large values that may set FE_INVALID. * sysdeps/aarch64/fpu/s_lround.c (IREG_SIZE, OREG_SIZE): Initialize if not already set. (OREGS, IREGS): Set based on IREG_SIZE and OREG_SIZE.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-0150-50/+50
|
* Add femode_t functions: aarch64.Joseph Myers2016-09-072-0/+61
| | | | | | | | This patch adds AArch64 versions of fegetmode and fesetmode. Untested. * sysdeps/aarch64/fpu/fegetmode.c: New file. * sysdeps/aarch64/fpu/fesetmode.c: Likewise.
* Make common fmax implementation generic.Paul E. Murphy2016-09-013-3/+3
| | | | | Also update aarch64 to ensure the correct s_fmin.c is included. The include order favors including the generated copy.
* Add fesetexcept: aarch64.Joseph Myers2016-08-161-0/+34
| | | | | | This patch adds an AArch64 version of fesetexcept. Untested. * sysdeps/aarch64/fpu/fesetexcept.c: New file.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-0447-47/+47
|
* 2015-08-24 Wilco Dijkstra <wdijkstr@arm.com>Wilco Dijkstra2015-08-241-8/+4
| | | | | | * sysdeps/aarch64/fpu/math_private.h (libc_feholdsetround_aarch64_ctx): Unconditionally set __fpcr to avoid uninialized warning. (libc_feholdsetround_noex_aarch64_ctx): Likewise.
* Improve feenableexcept performance - avoid an unnecessary FPCR read in caseWilco Dijkstra2015-08-051-9/+7
| | | | the FPCR does not change. Also improve the logic of the return value.
* Improve fesetenv performance by avoiding unnecessary FPSR/FPCR reads/writes.Wilco Dijkstra2015-08-051-17/+23
| | | | | | It uses the same logic as the ARM version. The common case removes 1 FPSR and 1 FPCR read. For FE_DFL_ENV and FE_NOMASK_ENV a FPCR read is avoided in case the FPCR does not change.
* Add AArch64 versions of math_opt_barrier and math_force_eval that avoid ↵Wilco Dijkstra2015-07-131-0/+5
| | | | going via memory.
* Inline __ieee754_sqrt and __ieee754_sqrtf. Also add external definitions.Wilco Dijkstra2015-07-063-0/+72
|
* Fix libm feupdateenv namespace (bug 17748).Joseph Myers2015-01-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Concluding the fixes for C90 libm functions calling C99 fe* functions, this patch fixes the case of feupdateenv by making it a weak alias for __feupdateenv and making the affected code call __feupdateenv. Tested for x86_64 (testsuite, and that installed stripped shared libraries are unchanged by the patch). Also tested for ARM (soft-float) that the math.h linknamespace tests now pass. [BZ #17748] * include/fenv.h (__feupdateenv): Use libm_hidden_proto. * math/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/aarch64/fpu/feupdateenv.c (feupdateenv): Rename to __feupdateenv and define as weak alias of __feupdateenv. Use libm_hidden_weak. * sysdeps/alpha/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/arm/feupdateenv.c (feupdateenv): Rename to __feupdateenv and define as weak alias of __feupdateenv. Use libm_hidden_weak. * sysdeps/hppa/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/i386/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Rename to __feupdateenv and define as weak alias of __feupdateenv. Use libm_hidden_weak. * sysdeps/m68k/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/mips/fpu/feupdateenv.c (feupdateenv): Rename to __feupdateenv and define as weak alias of __feupdateenv. Use libm_hidden_weak. * sysdeps/powerpc/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/powerpc/nofpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/s390/fpu/feupdateenv.c (feupdateenv): Rename to __feupdateenv and define as weak alias of __feupdateenv. Use libm_hidden_weak. * sysdeps/sh/sh4/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/sparc/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/tile/math_private.h (__feupdateenv): New inline function. * sysdeps/x86_64/fpu/feupdateenv.c (__feupdateenv): Use libm_hidden_def. * sysdeps/generic/math_private.h (default_libc_feupdateenv): Call __feupdateenv instead of feupdateenv. (default_libc_feupdateenv_test): Likewise. (libc_feresetround_ctx): Likewise.
* Fix libm fesetround namespace (bug 17748).Joseph Myers2015-01-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the fixes for C90 libm functions calling C99 fe* functions, this patch fixes the case of fesetround by making it a weak alias of __fesetround and making the affected code call __fesetround. An existing __fesetround function in fenv_libc.h for powerpc is renamed to __fesetround_inline. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). Also tested for ARM (soft-float) that fesetround failures disappear from the linknamespace test results (feupdateenv remains to be addressed to complete fixing bug 17748). [BZ #17748] * include/fenv.h (__fesetround): Declare. Use libm_hidden_proto. * math/fesetround.c (fesetround): Rename to __fesetround and define as weak alias of __fesetround. Use libm_hidden_weak. * sysdeps/aarch64/fpu/fesetround.c (fesetround): Likewise. * sysdeps/alpha/fpu/fesetround.c (fesetround): Likewise. * sysdeps/arm/fesetround.c (fesetround): Likewise. * sysdeps/hppa/fpu/fesetround.c (fesetround): Likewise. * sysdeps/i386/fpu/fesetround.c (fesetround): Likewise. * sysdeps/ia64/fpu/fesetround.c (fesetround): Likewise. * sysdeps/m68k/fpu/fesetround.c (fesetround): Likewise. * sysdeps/mips/fpu/fesetround.c (fesetround): Likewise. * sysdeps/powerpc/fpu/fenv_libc.h (__fesetround): Rename to __fesetround_inline. * sysdeps/powerpc/fpu/fenv_private.h (libc_fesetround_ppc): Call __fesetround_inline instead of __fesetround. * sysdeps/powerpc/fpu/fesetround.c (fesetround): Rename to __fesetround and define as weak alias of __fesetround. Use libm_hidden_weak. Call __fesetround_inline instead of __fesetround. * sysdeps/powerpc/nofpu/fesetround.c (fesetround): Rename to __fesetround and define as weak alias of __fesetround. Use libm_hidden_weak. * sysdeps/powerpc/powerpc32/e500/nofpu/fesetround.c (fesetround): Likewise. * sysdeps/s390/fpu/fesetround.c (fesetround): Likewise. * sysdeps/sh/sh4/fpu/fesetround.c (fesetround): Likewise. * sysdeps/sparc/fpu/fesetround.c (fesetround): Likewise. * sysdeps/tile/math_private.h (__fesetround): New inline function. * sysdeps/x86_64/fpu/fesetround.c (fesetround): Rename to __fesetround and define as weak alias of __fesetround. Use libm_hidden_weak. * sysdeps/generic/math_private.h (default_libc_fesetround): Call __fesetround instead of fesetround. (default_libc_feholdexcept_setround): Likewise. (libc_feholdsetround_ctx): Likewise. (libc_feholdsetround_noex_ctx): Likewise.
* Fix libm fesetenv namespace (bug 17748).Joseph Myers2015-01-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the fixes for C90 libm functions calling C99 fe* functions, this patch fixes the case of fesetenv by making it a weak alias of __fesetenv and making the affected code (including various copies of feupdateenv which also gets called from C90 functions) call __fesetenv. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). Also tested for ARM (soft-float) that fesetenv failures disappear from the linknamespace test results (fsetround and feupdateenv remain to be addressed to complete fixing bug 17748). [BZ #17748] * include/fenv.h (__fesetenv): Use libm_hidden_proto. * math/fesetenv.c (__fesetenv): Use libm_hidden_def. * sysdeps/aarch64/fpu/fesetenv.c (fesetenv): Rename to __fesetenv and define as weak alias of __fesetenv. Use libm_hidden_weak. * sysdeps/alpha/fpu/fesetenv.c (__fesetenv): Use libm_hidden_def. * sysdeps/arm/fesetenv.c (fesetenv): Rename to __fesetenv and define as weak alias of __fesetenv. Use libm_hidden_weak. * sysdeps/hppa/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/i386/fpu/fesetenv.c (__fesetenv): Use libm_hidden_def. * sysdeps/ia64/fpu/fesetenv.c (fesetenv): Rename to __fesetenv and define as weak alias of __fesetenv. Use libm_hidden_weak. * sysdeps/m68k/fpu/fesetenv.c (__fesetenv): Use libm_hidden_def. * sysdeps/mips/fpu/fesetenv.c (fesetenv): Rename to __fesetenv and define as weak alias of __fesetenv. Use libm_hidden_weak. * sysdeps/powerpc/fpu/fesetenv.c (__fesetenv): Use libm_hidden_def. * sysdeps/powerpc/nofpu/fesetenv.c (__fesetenv): Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/fesetenv.c (__fesetenv): Likewise. * sysdeps/s390/fpu/fesetenv.c (fesetenv): Rename to __fesetenv and define as weak alias of __fesetenv. Use libm_hidden_weak. * sysdeps/sh/sh4/fpu/fesetenv.c (fesetenv): Likewise. * sysdeps/sparc/fpu/fesetenv.c (__fesetenv): Use libm_hidden_def. * sysdeps/tile/math_private.h (__fesetenv): New inline function. * sysdeps/x86_64/fpu/fesetenv.c (fesetenv): Rename to __fesetenv and define as weak alias of __fesetenv. Use libm_hidden_weak. * sysdeps/generic/math_private.h (default_libc_fesetenv): Use __fesetenv instead of fesetenv. (libc_feresetround_noex_ctx): Likewise. * sysdeps/alpha/fpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/hppa/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/i386/fpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/m68k/fpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/mips/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/powerpc/nofpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/s390/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/sh/sh4/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/sparc/fpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/x86_64/fpu/feupdateenv.c (__feupdateenv): Likewise.
* Fix libm feholdexcept namespace (bug 17748).Joseph Myers2015-01-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the fixes for C90 libm functions calling C99 fe* functions, this patch fixes the case of feholdexcept by making it a weak alias of __feholdexcept and making the affected code call __feholdexcept. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). Also tested for ARM (soft-float) that feholdexcept failures disappear from the linknamespace test failures (fesetenv, fsetround and feupdateenv remain to be addressed to complete fixing bug 17748). [BZ #17748] * include/fenv.h (__feholdexcept): Declare. Use libm_hidden_proto. * math/feholdexcpt.c (feholdexcept): Rename to __feholdexcept and define as weak alias of __feholdexcept. Use libm_hidden_weak. * sysdeps/aarch64/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/alpha/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/arm/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/hppa/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/i386/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/ia64/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/m68k/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/mips/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/powerpc/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/powerpc/nofpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/s390/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/sh/sh4/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/sparc/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/x86_64/fpu/feholdexcpt.c (feholdexcept): Likewise. * sysdeps/generic/math_private.h (default_libc_feholdexcept): Use __feholdexcept instead of feholdexcept. (default_libc_feholdexcept_setround): Likewise.
* Fix libm fegetround namespace (bug 17748).Joseph Myers2015-01-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the fixes for C90 libm functions calling C99 fe* functions, this patch fixes the case of fegetround by making it a weak alias of __fegetround and making the affected code call __fegetround. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). Also tested for ARM (soft-float) that fegetround failures disappear from the linknamespace test failures (feholdexcept, fesetenv, fesetround and feupdateenv remain to be addressed before bug 17748 is fully fixed, although this patch may suffice to fix the failures in some cases, when the libc_fe* functions are implemented but there is no architecture-specific sqrt implementation in use so there were failures from fegetround used by sqrt but no other such failures). [BZ #17748] * include/fenv.h (__fegetround): Declare. Use libm_hidden_proto. * math/fegetround.c (fegetround): Rename to __fegetround and define as weak alias of __fegetround. Use libm_hidden_weak. * sysdeps/aarch64/fpu/fegetround.c (fegetround): Likewise. * sysdeps/alpha/fpu/fegetround.c (fegetround): Likewise. * sysdeps/arm/fegetround.c (fegetround): Likewise. * sysdeps/hppa/fpu/fegetround.c (fegetround): Likewise. * sysdeps/i386/fpu/fegetround.c (fegetround): Likewise. * sysdeps/ia64/fpu/fegetround.c (fegetround): Likewise. * sysdeps/m68k/fpu/fegetround.c (fegetround): Likewise. * sysdeps/mips/fpu/fegetround.c (fegetround): Likewise. * sysdeps/powerpc/fpu/fegetround.c (fegetround): Likewise. Undefine after rather than before function definition; use parentheses around function name in definition. (__fegetround): Also undefine macro after function definition. * sysdeps/powerpc/nofpu/fegetround.c (fegetround): Rename to __fegetround and define as weak alias of __fegetround. Use libm_hidden_weak. Do not undefine as macro. * sysdeps/powerpc/powerpc32/e500/nofpu/fegetround.c (fegetround): Likewise. * sysdeps/s390/fpu/fegetround.c (fegetround): Rename to __fegetround and define as weak alias of __fegetround. Use libm_hidden_weak. * sysdeps/sh/sh4/fpu/fegetround.c (fegetround): Likewise. * sysdeps/sparc/fpu/fegetround.c (fegetround): Likewise. * sysdeps/tile/math_private.h (__fegetround): New inline function. * sysdeps/x86_64/fpu/fegetround.c (fegetround): Rename to __fegetround and define as weak alias of __fegetround. Use libm_hidden_weak. * sysdeps/ieee754/dbl-64/e_sqrt.c (__ieee754_sqrt): Use __fegetround instead of fegetround.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-0245-45/+45
|
* Fix libm fegetenv namespace (bug 17748).Joseph Myers2014-12-311-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some C90 libm functions call fegetenv via libc_feholdsetround* functions in math_private.h. This patch makes them call __fegetenv instead, making fegetenv into a weak alias for __fegetenv as needed. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). Also tested for ARM (soft-float) that fegetenv failures disappear from the linknamespace test failures (however, similar fixes will also be needed for fegetround, feholdexcept, fesetenv, fesetround and feupdateenv before this set of namespace issues covered by bug 17748 is fully fixed and those linknamespace tests start passing). [BZ #17748] * include/fenv.h (__fegetenv): Use libm_hidden_proto. * math/fegetenv.c (__fegetenv): Use libm_hidden_def. * sysdeps/aarch64/fpu/fegetenv.c (fegetenv): Rename to __fegetenv and define as weak alias of __fegetenv. Use libm_hidden_weak. * sysdeps/alpha/fpu/fegetenv.c (__fegetenv): Use libm_hidden_def. * sysdeps/arm/fegetenv.c (fegetenv): Rename to __fegetenv and define as weak alias of __fegetenv. Use libm_hidden_weak. * sysdeps/hppa/fpu/fegetenv.c (fegetenv): Likewise. * sysdeps/i386/fpu/fegetenv.c (__fegetenv): Use libm_hidden_def. * sysdeps/ia64/fpu/fegetenv.c (fegetenv): Rename to __fegetenv and define as weak alias of __fegetenv. Use libm_hidden_weak. * sysdeps/m68k/fpu/fegetenv.c (__fegetenv): Use libm_hidden_def. * sysdeps/mips/fpu/fegetenv.c (fegetenv): Rename to __fegetenv and define as weak alias of __fegetenv. Use libm_hidden_weak. * sysdeps/powerpc/fpu/fegetenv.c (__fegetenv): Use libm_hidden_def. * sysdeps/powerpc/nofpu/fegetenv.c (__fegetenv): Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/fegetenv.c (__fegetenv): Likewise. * sysdeps/s390/fpu/fegetenv.c (fegetenv): Rename to __fegetenv and define as weak alias of __fegetenv. Use libm_hidden_weak. * sysdeps/sh/sh4/fpu/fegetenv.c (fegetenv): Likewise. * sysdeps/sparc/fpu/fegetenv.c (__fegetenv): Use libm_hidden_def. * sysdeps/tile/math_private.h (__fegetenv): New inline function. * sysdeps/x86_64/fpu/fegetenv.c (fegetenv): Rename to __fegetenv and define as weak alias of __fegetenv. Use libm_hidden_weak. * sysdeps/generic/math_private.h (libc_feholdsetround_ctx): Use __fegetenv instead of fegetenv. (libc_feholdsetround_noex_ctx): Likewise.
* Fix libm feraiseexcept namespace (bug 17723).Joseph Myers2014-12-303-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various C90 and UNIX98 libm functions call feraiseexcept, which is not in those standards. This causes linknamespace test failures - except on x86 / x86_64, where feraiseexcept is inline (for the relevant constant arguments) in bits/fenv.h. This patch fixes this by making those functions call __feraiseexcept instead. All changes are applied to all architectures rather than considering the possibility that some might not be needed in some cases (e.g. x86) as it seems most maintainable to keep architectures consistent. Where __feraiseexcept does not exist, it is added, with feraiseexcept made a weak alias; where it is a strong alias, it is made weak. libm_hidden_def / libm_hidden_proto are used with __feraiseexcept (this might in some cases improve code generation for existing calls to __feraiseexcept in some code on some architectures). Where there are dummy feraiseexcept macros (on architectures without floating-point exceptions support, to avoid compile errors from references to undefined FE_* macros), corresponding dummy __feraiseexcept macros are added. And on x86, to ensure __feraiseexcept calls still get inlined, the inline function in bits/fenv.h is refactored so that most of it can be reused in an inline __feraiseexcept in a separate include/bits/fenv.h. Calls are changed in C90/UNIX98 functions, but generally not in functions missing from those standards. They are also changed in libc_fe* functions (on the basis that those might be used in any libm function), and in feupdateenv (on the same basis - may be used, via default libc_*, in any libm function - of course feupdateenv will need changing to __feupdateenv in a subsequent patch to make that fully namespace-clean). No __feraiseexcept is added corresponding to the feraiseexcept in powerpc bits/fenvinline.h, because that macro definition is conditional on !defined __NO_MATH_INLINES, and glibc libm is built with -D__NO_MATH_INLINES, so changing internal calls to use __feraiseexcept should make no difference. Tested for x86_64 (testsuite; the only change in disassembly of installed shared libraries is a slight code reordering in clog10, of no apparent significance). Also tested for MIPS, where (in the configuration tested) it eliminates math.h linknamespace failures for n32 and n64 (some for o32 remain because of other issues). [BZ #17723] * include/fenv.h (__feraiseexcept): Use libm_hidden_proto. * math/fraiseexcpt.c (__feraiseexcept): Use libm_hidden_def. * sysdeps/aarch64/fpu/fraiseexcpt.c (feraiseexcept): Rename to __feraiseexcept and define as weak alias of __feraiseexcept. Use libm_hidden_weak. * sysdeps/arm/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/hppa/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/i386/fpu/fraiseexcpt.c (__feraiseexcept): Use libm_hidden_def. * sysdeps/ia64/fpu/fraiseexcpt.c (feraiseexcept): Rename to __feraiseexcept and define as weak alias of __feraiseexcept. Use libm_hidden_weak. * sysdeps/m68k/coldfire/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/microblaze/math_private.h (__feraiseexcept): New macro. * sysdeps/mips/fpu/fraiseexcpt.c (feraiseexcept): Rename to __feraiseexcept and define as weak alias of __feraiseexcept. Use libm_hidden_weak. * sysdeps/powerpc/fpu/fraiseexcpt.c (__feraiseexcept): Use libm_hidden_def. * sysdeps/powerpc/nofpu/fraiseexcpt.c (__feraiseexcept): Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/fraiseexcpt.c (__feraiseexcept): Likewise. * sysdeps/s390/fpu/fraiseexcpt.c (feraiseexcept): Rename to __feraiseexcept and define as weak alias of __feraiseexcept. Use libm_hidden_weak. * sysdeps/sh/sh4/fpu/fraiseexcpt.c (feraiseexcept): Likewise. * sysdeps/sparc/fpu/fraiseexcpt.c (__feraiseexcept): Use libm_hidden_def. * sysdeps/tile/math_private.h (__feraiseexcept): New macro. * sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S (__feraiseexcept): Use libm_hidden_def. * sysdeps/x86_64/fpu/fraiseexcpt.c (__feraiseexcept): Use libm_hidden_def. (feraiseexcept): Define as weak not strong alias. Use libm_hidden_weak. * sysdeps/x86/fpu/bits/fenv.h (__feraiseexcept_invalid_divbyzero): New inline function. Factored out of ... (feraiseexcept): ... here. Use __feraiseexcept_invalid_divbyzero. * sysdeps/x86/fpu/include/bits/fenv.h: New file. * math/e_scalb.c (invalid_fn): Call __feraiseexcept instead of feraiseexcept. * math/w_acos.c (__acos): Likewise. * math/w_asin.c (__asin): Likewise. * math/w_ilogb.c (__ilogb): Likewise. * math/w_j0.c (y0): Likewise. * math/w_j1.c (y1): Likewise. * math/w_jn.c (yn): Likewise. * math/w_log.c (__log): Likewise. * math/w_log10.c (__log10): Likewise. * sysdeps/aarch64/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/aarch64/fpu/math_private.h (libc_feupdateenv_test_aarch64): Likewise. * sysdeps/alpha/fpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/arm/fenv_private.h (libc_feupdateenv_test_vfp): Likewise. * sysdeps/arm/feupdateenv.c (feupdateenv): Likewise. * sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/m68k/fpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/mips/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/powerpc/fpu/e_sqrt.c (__slow_ieee754_sqrt): Likewise. * sysdeps/s390/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/sh/sh4/fpu/feupdateenv.c (feupdateenv): Likewise. * sysdeps/sparc/fpu/feupdateenv.c (__feupdateenv): Likewise.
* Call libc_fetestexcept_aarch64.Wilco Dijkstra2014-12-221-7/+2
|
* Call libc_fesetround_aarch64.Wilco Dijkstra2014-12-221-20/+5
|
* Call libc_fetestexcept_aarch64 from math_private.h rather than duplicating ↵Wilco Dijkstra2014-10-241-8/+2
| | | | functionality.
* Call libc_feholdexcept_aarch64 from math_private.h rather than duplicating ↵Wilco Dijkstra2014-10-241-24/+2
| | | | functionality.
* Call get_rounding_mode rather than duplicating functionality.Wilco Dijkstra2014-10-241-4/+2
|
* Cleanup feenableexcept to use the same logic as the ARM version. No ↵Wilco Dijkstra2014-10-241-6/+1
| | | | functional changes.
* Cleanup fedisableexcept to use the same logic as the ARM version. No ↵Wilco Dijkstra2014-10-241-6/+1
| | | | functional changes.
* Cleanup feclearexcept to use the same logic as the ARM version. No ↵Wilco Dijkstra2014-10-241-1/+1
| | | | functional changes.
* Cleanup fesetexceptflag to use the same logic as the ARM version. No ↵Wilco Dijkstra2014-10-241-2/+3
| | | | functional changes.
* Remove an unused include.Wilco Dijkstra2014-10-241-1/+0
|
* Remove spaces.Wilco Dijkstra2014-10-244-4/+0
|
* This patch adds new function libc_feholdsetround_noex_aarch64_ctx, enablingWilco Dijkstra2014-08-071-3/+27
| | | | | | | further optimization. libc_feholdsetround_aarch64_ctx now only needs to read the FPCR in the typical case, avoiding a redundant FPSR read. Performance results show a good improvement (5-10% on sin()) on cores with expensive FPCR/FPSR instructions.
* [AArch64] Switch from FE_TOWARDZERO to _FPU_FPCR_RM_MASKWilco2014-06-032-6/+6
|
* [AArch64] Cleanup declarations in math_private.h.Wilco2014-06-031-8/+22
|
* [AArch64] Remove ISB after FPCR write.Wilco2014-06-021-5/+2
|
* [AArch64] Rewrite feupdateenv (BZ 17009).Wilco2014-06-021-5/+54
|
* [AArch64] Suppress unnecessary FPSR and FPCR writes.Ian Bolton2014-04-247-28/+46
|
* [AArch64] Define HAVE_RM_CTX and related hooks.Ian Bolton2014-04-171-0/+55
|
* [AArch64] Provide initial implementation of math_private.h.Ian Bolton2014-04-171-0/+214
|
* [PATCH] [AArch64] Optional trapping exceptions support.Marcus Shawcroft2014-03-072-0/+23
| | | | | | | Trapping exceptions in AArch64 are optional. The relevant exception control bits in FPCR are are defined as RES0 hence the absence of support can be detected by reading back the FPCR and comparing with the desired value.
* Relocate AArch64 from ports to libc.Marcus Shawcroft2014-02-1144-0/+1453
This patch moves the AArch64 port to the main sysdeps hierarchy. The move is essentially: git mv ports/sysdeps/aarch64 sysdeps/aarch64 git mv ports/sysdeps/unix/sysv/linux/aarch64 sysdeps/unix/sysv/linux/aarch64 The README is updated and I've updated ChangeLog.aarch64 along the lines of the ARM move. The AArch64 build has been tested to confirm that there were no changes in objdump -dr output or the shared objects.