glibc/sysdeps/powerpc/nofpu/fegetround.c

31 lines
1.1 KiB
C
Raw Normal View History

2002-10-19 Roland McGrath <roland@redhat.com> * config.make.in: Nix completely-soft nonsense. * configure.in: Likewise. Under --without-fp, use nofpu subdirectory of machine directories instead of fpu subdirectory. * sysdeps/powerpc/soft-fp/Makefile: Remove cruft added in last change. * sysdeps/powerpc/nofpu/Makefile: Put it in this new file instead. * sysdeps/powerpc/soft-fp/sim-full.c: Moved to ... * sysdeps/powerpc/nofpu/sim-full.c: ... here. * sysdeps/powerpc/soft-fp/fraiseexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fraiseexcpt.c: ... here. * sysdeps/powerpc/soft-fp/fegetexcept.c: Moved to ... * sysdeps/powerpc/nofpu/fegetexcept.c: ... here. * sysdeps/powerpc/soft-fp/fclrexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fclrexcpt.c: ... here. * sysdeps/powerpc/soft-fp/ftestexcept.c: Moved to ... * sysdeps/powerpc/nofpu/ftestexcept.c: ... here. * sysdeps/powerpc/soft-fp/fgetexcptflg.c: Moved to ... * sysdeps/powerpc/nofpu/fgetexcptflg.c: ... here. * sysdeps/powerpc/soft-fp/fsetexcptflg.c: Moved to ... * sysdeps/powerpc/nofpu/fsetexcptflg.c: ... here. * sysdeps/powerpc/soft-fp/fedisblxcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fedisblxcpt.c: ... here. * sysdeps/powerpc/soft-fp/feenablxcpt.c: Moved to ... * sysdeps/powerpc/nofpu/feenablxcpt.c: ... here. * sysdeps/powerpc/soft-fp/fegetenv.c: Moved to ... * sysdeps/powerpc/nofpu/fegetenv.c: ... here. * sysdeps/powerpc/soft-fp/fesetenv.c: Moved to ... * sysdeps/powerpc/nofpu/fesetenv.c: ... here. * sysdeps/powerpc/soft-fp/fegetround.c: Moved to ... * sysdeps/powerpc/nofpu/fegetround.c: ... here. * sysdeps/powerpc/soft-fp/fesetround.c: Moved to ... * sysdeps/powerpc/nofpu/fesetround.c: ... here. * sysdeps/powerpc/soft-fp/feupdateenv.c: Moved to ... * sysdeps/powerpc/nofpu/feupdateenv.c: ... here. * sysdeps/powerpc/soft-fp/feholdexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/feholdexcpt.c: ... here. * sysdeps/powerpc/soft-fp/fenv_const.c: Moved to ... * sysdeps/powerpc/nofpu/fenv_const.c: ... here. * sysdeps/powerpc/soft-fp/libm-test-ulps: Moved to ... * sysdeps/powerpc/nofpu/libm-test-ulps: ... here. * sysdeps/powerpc/soft-fp/soft-supp.h: Moved to ... * sysdeps/powerpc/nofpu/soft-supp.h: ... here. * sysdeps/powerpc/soft-fp/Versions (libc: GLIBC_2.3.2): Moved to ... * sysdeps/powerpc/nofpu/Versions: ... here, new file.
2002-10-19 22:06:29 +02:00
/* Return current rounding mode (soft-float edition).
Copyright (C) 2002-2018 Free Software Foundation, Inc.
2002-10-19 Roland McGrath <roland@redhat.com> * config.make.in: Nix completely-soft nonsense. * configure.in: Likewise. Under --without-fp, use nofpu subdirectory of machine directories instead of fpu subdirectory. * sysdeps/powerpc/soft-fp/Makefile: Remove cruft added in last change. * sysdeps/powerpc/nofpu/Makefile: Put it in this new file instead. * sysdeps/powerpc/soft-fp/sim-full.c: Moved to ... * sysdeps/powerpc/nofpu/sim-full.c: ... here. * sysdeps/powerpc/soft-fp/fraiseexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fraiseexcpt.c: ... here. * sysdeps/powerpc/soft-fp/fegetexcept.c: Moved to ... * sysdeps/powerpc/nofpu/fegetexcept.c: ... here. * sysdeps/powerpc/soft-fp/fclrexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fclrexcpt.c: ... here. * sysdeps/powerpc/soft-fp/ftestexcept.c: Moved to ... * sysdeps/powerpc/nofpu/ftestexcept.c: ... here. * sysdeps/powerpc/soft-fp/fgetexcptflg.c: Moved to ... * sysdeps/powerpc/nofpu/fgetexcptflg.c: ... here. * sysdeps/powerpc/soft-fp/fsetexcptflg.c: Moved to ... * sysdeps/powerpc/nofpu/fsetexcptflg.c: ... here. * sysdeps/powerpc/soft-fp/fedisblxcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fedisblxcpt.c: ... here. * sysdeps/powerpc/soft-fp/feenablxcpt.c: Moved to ... * sysdeps/powerpc/nofpu/feenablxcpt.c: ... here. * sysdeps/powerpc/soft-fp/fegetenv.c: Moved to ... * sysdeps/powerpc/nofpu/fegetenv.c: ... here. * sysdeps/powerpc/soft-fp/fesetenv.c: Moved to ... * sysdeps/powerpc/nofpu/fesetenv.c: ... here. * sysdeps/powerpc/soft-fp/fegetround.c: Moved to ... * sysdeps/powerpc/nofpu/fegetround.c: ... here. * sysdeps/powerpc/soft-fp/fesetround.c: Moved to ... * sysdeps/powerpc/nofpu/fesetround.c: ... here. * sysdeps/powerpc/soft-fp/feupdateenv.c: Moved to ... * sysdeps/powerpc/nofpu/feupdateenv.c: ... here. * sysdeps/powerpc/soft-fp/feholdexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/feholdexcpt.c: ... here. * sysdeps/powerpc/soft-fp/fenv_const.c: Moved to ... * sysdeps/powerpc/nofpu/fenv_const.c: ... here. * sysdeps/powerpc/soft-fp/libm-test-ulps: Moved to ... * sysdeps/powerpc/nofpu/libm-test-ulps: ... here. * sysdeps/powerpc/soft-fp/soft-supp.h: Moved to ... * sysdeps/powerpc/nofpu/soft-supp.h: ... here. * sysdeps/powerpc/soft-fp/Versions (libc: GLIBC_2.3.2): Moved to ... * sysdeps/powerpc/nofpu/Versions: ... here, new file.
2002-10-19 22:06:29 +02:00
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
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
2012-03-10 00:56:38 +01:00
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
2002-10-19 Roland McGrath <roland@redhat.com> * config.make.in: Nix completely-soft nonsense. * configure.in: Likewise. Under --without-fp, use nofpu subdirectory of machine directories instead of fpu subdirectory. * sysdeps/powerpc/soft-fp/Makefile: Remove cruft added in last change. * sysdeps/powerpc/nofpu/Makefile: Put it in this new file instead. * sysdeps/powerpc/soft-fp/sim-full.c: Moved to ... * sysdeps/powerpc/nofpu/sim-full.c: ... here. * sysdeps/powerpc/soft-fp/fraiseexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fraiseexcpt.c: ... here. * sysdeps/powerpc/soft-fp/fegetexcept.c: Moved to ... * sysdeps/powerpc/nofpu/fegetexcept.c: ... here. * sysdeps/powerpc/soft-fp/fclrexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fclrexcpt.c: ... here. * sysdeps/powerpc/soft-fp/ftestexcept.c: Moved to ... * sysdeps/powerpc/nofpu/ftestexcept.c: ... here. * sysdeps/powerpc/soft-fp/fgetexcptflg.c: Moved to ... * sysdeps/powerpc/nofpu/fgetexcptflg.c: ... here. * sysdeps/powerpc/soft-fp/fsetexcptflg.c: Moved to ... * sysdeps/powerpc/nofpu/fsetexcptflg.c: ... here. * sysdeps/powerpc/soft-fp/fedisblxcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fedisblxcpt.c: ... here. * sysdeps/powerpc/soft-fp/feenablxcpt.c: Moved to ... * sysdeps/powerpc/nofpu/feenablxcpt.c: ... here. * sysdeps/powerpc/soft-fp/fegetenv.c: Moved to ... * sysdeps/powerpc/nofpu/fegetenv.c: ... here. * sysdeps/powerpc/soft-fp/fesetenv.c: Moved to ... * sysdeps/powerpc/nofpu/fesetenv.c: ... here. * sysdeps/powerpc/soft-fp/fegetround.c: Moved to ... * sysdeps/powerpc/nofpu/fegetround.c: ... here. * sysdeps/powerpc/soft-fp/fesetround.c: Moved to ... * sysdeps/powerpc/nofpu/fesetround.c: ... here. * sysdeps/powerpc/soft-fp/feupdateenv.c: Moved to ... * sysdeps/powerpc/nofpu/feupdateenv.c: ... here. * sysdeps/powerpc/soft-fp/feholdexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/feholdexcpt.c: ... here. * sysdeps/powerpc/soft-fp/fenv_const.c: Moved to ... * sysdeps/powerpc/nofpu/fenv_const.c: ... here. * sysdeps/powerpc/soft-fp/libm-test-ulps: Moved to ... * sysdeps/powerpc/nofpu/libm-test-ulps: ... here. * sysdeps/powerpc/soft-fp/soft-supp.h: Moved to ... * sysdeps/powerpc/nofpu/soft-supp.h: ... here. * sysdeps/powerpc/soft-fp/Versions (libc: GLIBC_2.3.2): Moved to ... * sysdeps/powerpc/nofpu/Versions: ... here, new file.
2002-10-19 22:06:29 +02:00
#include "soft-fp.h"
#include "soft-supp.h"
int
Fix libm fegetround namespace (bug 17748). 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.
2015-01-02 21:44:42 +01:00
__fegetround (void)
2002-10-19 Roland McGrath <roland@redhat.com> * config.make.in: Nix completely-soft nonsense. * configure.in: Likewise. Under --without-fp, use nofpu subdirectory of machine directories instead of fpu subdirectory. * sysdeps/powerpc/soft-fp/Makefile: Remove cruft added in last change. * sysdeps/powerpc/nofpu/Makefile: Put it in this new file instead. * sysdeps/powerpc/soft-fp/sim-full.c: Moved to ... * sysdeps/powerpc/nofpu/sim-full.c: ... here. * sysdeps/powerpc/soft-fp/fraiseexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fraiseexcpt.c: ... here. * sysdeps/powerpc/soft-fp/fegetexcept.c: Moved to ... * sysdeps/powerpc/nofpu/fegetexcept.c: ... here. * sysdeps/powerpc/soft-fp/fclrexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fclrexcpt.c: ... here. * sysdeps/powerpc/soft-fp/ftestexcept.c: Moved to ... * sysdeps/powerpc/nofpu/ftestexcept.c: ... here. * sysdeps/powerpc/soft-fp/fgetexcptflg.c: Moved to ... * sysdeps/powerpc/nofpu/fgetexcptflg.c: ... here. * sysdeps/powerpc/soft-fp/fsetexcptflg.c: Moved to ... * sysdeps/powerpc/nofpu/fsetexcptflg.c: ... here. * sysdeps/powerpc/soft-fp/fedisblxcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fedisblxcpt.c: ... here. * sysdeps/powerpc/soft-fp/feenablxcpt.c: Moved to ... * sysdeps/powerpc/nofpu/feenablxcpt.c: ... here. * sysdeps/powerpc/soft-fp/fegetenv.c: Moved to ... * sysdeps/powerpc/nofpu/fegetenv.c: ... here. * sysdeps/powerpc/soft-fp/fesetenv.c: Moved to ... * sysdeps/powerpc/nofpu/fesetenv.c: ... here. * sysdeps/powerpc/soft-fp/fegetround.c: Moved to ... * sysdeps/powerpc/nofpu/fegetround.c: ... here. * sysdeps/powerpc/soft-fp/fesetround.c: Moved to ... * sysdeps/powerpc/nofpu/fesetround.c: ... here. * sysdeps/powerpc/soft-fp/feupdateenv.c: Moved to ... * sysdeps/powerpc/nofpu/feupdateenv.c: ... here. * sysdeps/powerpc/soft-fp/feholdexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/feholdexcpt.c: ... here. * sysdeps/powerpc/soft-fp/fenv_const.c: Moved to ... * sysdeps/powerpc/nofpu/fenv_const.c: ... here. * sysdeps/powerpc/soft-fp/libm-test-ulps: Moved to ... * sysdeps/powerpc/nofpu/libm-test-ulps: ... here. * sysdeps/powerpc/soft-fp/soft-supp.h: Moved to ... * sysdeps/powerpc/nofpu/soft-supp.h: ... here. * sysdeps/powerpc/soft-fp/Versions (libc: GLIBC_2.3.2): Moved to ... * sysdeps/powerpc/nofpu/Versions: ... here, new file.
2002-10-19 22:06:29 +02:00
{
return __sim_round_mode_thread;
2002-10-19 Roland McGrath <roland@redhat.com> * config.make.in: Nix completely-soft nonsense. * configure.in: Likewise. Under --without-fp, use nofpu subdirectory of machine directories instead of fpu subdirectory. * sysdeps/powerpc/soft-fp/Makefile: Remove cruft added in last change. * sysdeps/powerpc/nofpu/Makefile: Put it in this new file instead. * sysdeps/powerpc/soft-fp/sim-full.c: Moved to ... * sysdeps/powerpc/nofpu/sim-full.c: ... here. * sysdeps/powerpc/soft-fp/fraiseexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fraiseexcpt.c: ... here. * sysdeps/powerpc/soft-fp/fegetexcept.c: Moved to ... * sysdeps/powerpc/nofpu/fegetexcept.c: ... here. * sysdeps/powerpc/soft-fp/fclrexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fclrexcpt.c: ... here. * sysdeps/powerpc/soft-fp/ftestexcept.c: Moved to ... * sysdeps/powerpc/nofpu/ftestexcept.c: ... here. * sysdeps/powerpc/soft-fp/fgetexcptflg.c: Moved to ... * sysdeps/powerpc/nofpu/fgetexcptflg.c: ... here. * sysdeps/powerpc/soft-fp/fsetexcptflg.c: Moved to ... * sysdeps/powerpc/nofpu/fsetexcptflg.c: ... here. * sysdeps/powerpc/soft-fp/fedisblxcpt.c: Moved to ... * sysdeps/powerpc/nofpu/fedisblxcpt.c: ... here. * sysdeps/powerpc/soft-fp/feenablxcpt.c: Moved to ... * sysdeps/powerpc/nofpu/feenablxcpt.c: ... here. * sysdeps/powerpc/soft-fp/fegetenv.c: Moved to ... * sysdeps/powerpc/nofpu/fegetenv.c: ... here. * sysdeps/powerpc/soft-fp/fesetenv.c: Moved to ... * sysdeps/powerpc/nofpu/fesetenv.c: ... here. * sysdeps/powerpc/soft-fp/fegetround.c: Moved to ... * sysdeps/powerpc/nofpu/fegetround.c: ... here. * sysdeps/powerpc/soft-fp/fesetround.c: Moved to ... * sysdeps/powerpc/nofpu/fesetround.c: ... here. * sysdeps/powerpc/soft-fp/feupdateenv.c: Moved to ... * sysdeps/powerpc/nofpu/feupdateenv.c: ... here. * sysdeps/powerpc/soft-fp/feholdexcpt.c: Moved to ... * sysdeps/powerpc/nofpu/feholdexcpt.c: ... here. * sysdeps/powerpc/soft-fp/fenv_const.c: Moved to ... * sysdeps/powerpc/nofpu/fenv_const.c: ... here. * sysdeps/powerpc/soft-fp/libm-test-ulps: Moved to ... * sysdeps/powerpc/nofpu/libm-test-ulps: ... here. * sysdeps/powerpc/soft-fp/soft-supp.h: Moved to ... * sysdeps/powerpc/nofpu/soft-supp.h: ... here. * sysdeps/powerpc/soft-fp/Versions (libc: GLIBC_2.3.2): Moved to ... * sysdeps/powerpc/nofpu/Versions: ... here, new file.
2002-10-19 22:06:29 +02:00
}
Fix libm fegetround namespace (bug 17748). 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.
2015-01-02 21:44:42 +01:00
libm_hidden_def (__fegetround)
weak_alias (__fegetround, fegetround)
libm_hidden_weak (fegetround)