mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 02:40:08 +00:00
Update.
* Versions.def (libm): Add GLIBC_2.1.3. ISO C99 TR1 changes various fe* functions to return an error value. * math/Versions [GLIBC_2.1.3]: Add feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag, fegetenv, fesetenv, and feupdateenv. * sysdeps/alpha/fpu/fclrexcpt.c: Return value and add alias. * sysdeps/alpha/fpu/fegetenv.c: Likewise. * sysdeps/alpha/fpu/fesetenv.c: Likewise. * sysdeps/alpha/fpu/feupdateenv.c: Likewise. * sysdeps/alpha/fpu/fgetexcptflg.c: Likewise. * sysdeps/alpha/fpu/fraiseexcpt.c: Likewise. * sysdeps/alpha/fpu/fsetexcptflg.c: Likewise. * sysdeps/arm/fpu/fclrexcpt.c: Likewise. * sysdeps/arm/fpu/fegetenv.c: Likewise. * sysdeps/arm/fpu/fesetenv.c: Likewise. * sysdeps/arm/fpu/fraiseexcpt.c: Likewise. * sysdeps/arm/fpu/fsetexcptflg.c: Likewise. * sysdeps/generic/fclrexcpt.c: Likewise. * sysdeps/generic/fegetenv.c: Likewise. * sysdeps/generic/fesetenv.c: Likewise. * sysdeps/generic/feupdateenv.c: Likewise. * sysdeps/generic/fgetexcptflg.c: Likewise. * sysdeps/generic/fraiseexcpt.c: Likewise. * sysdeps/generic/fsetexcptflg.c: Likewise. * sysdeps/i386/fpu/fclrexcpt.c: Likewise. * sysdeps/i386/fpu/fegetenv.c: Likewise. * sysdeps/i386/fpu/fesetenv.c: Likewise. * sysdeps/i386/fpu/feupdateenv.c: Likewise. * sysdeps/i386/fpu/fgetexcptflg.c: Likewise. * sysdeps/i386/fpu/fraiseexcpt.c: Likewise. * sysdeps/i386/fpu/fsetexcptflg.c: Likewise. * sysdeps/m68k/fpu/fclrexcpt.c: Likewise. * sysdeps/m68k/fpu/fegetenv.c: Likewise. * sysdeps/m68k/fpu/fesetenv.c: Likewise. * sysdeps/m68k/fpu/feupdateenv.c: Likewise. * sysdeps/m68k/fpu/fgetexcptflg.c: Likewise. * sysdeps/m68k/fpu/fraiseexcpt.c: Likewise. * sysdeps/m68k/fpu/fsetexcptflg.c: Likewise. * sysdeps/mips/fclrexcpt.c: Likewise. * sysdeps/mips/fegetenv.c: Likewise. * sysdeps/mips/fesetenv.c: Likewise. * sysdeps/mips/feupdateenv.c: Likewise. * sysdeps/mips/fgetexcptflg.c: Likewise. * sysdeps/powerpc/fclrexcpt.c: Likewise. * sysdeps/powerpc/fegetenv.c: Likewise. * sysdeps/powerpc/fesetenv.c: Likewise. * sysdeps/powerpc/feupdateenv.c: Likewise. * sysdeps/powerpc/fgetexcptflg.c: Likewise. * sysdeps/powerpc/fraiseexcpt.c: Likewise. * sysdeps/powerpc/fsetexcptflg.c: Likewise. * sysdeps/sparc/fpu/fclrexcpt.c: Likewise. * sysdeps/sparc/fpu/fegetenv.c: Likewise. * sysdeps/sparc/fpu/fesetenv.c: Likewise. * sysdeps/sparc/fpu/feupdateenv.c: Likewise. * sysdeps/sparc/fpu/fgetexcptflg.c: Likewise. * sysdeps/sparc/fpu/fraiseexcpt.c: Likewise. * sysdeps/sparc/fpu/fsetexcptflg.c: Likewise. * math/fenv.h: Adjust prototypes.: Likewise. * manual/arith.texi: Adjust documentation for these changes. * manual/arith.texi: Document feraiseexcept. * sysdeps/powerpc/fegetenv.c: Moved to... * sysdeps/powerpc/fpu/fegetenv.c: ...here. * sysdeps/powerpc/fegetround.c: Moved to... * sysdeps/powerpc/fpu/fegetround.c: ...here. * sysdeps/powerpc/feholdexcpt.c: Moved to... * sysdeps/powerpc/fpu/feholdexcpt.c: ...here. * sysdeps/powerpc/fesetenv.c: Moved to... * sysdeps/powerpc/fpu/fesetenv.c: ...here. * sysdeps/powerpc/fenv_libc.h: Moved to... * sysdeps/powerpc/fpu/fenv_libc.h: ...here. * sysdeps/powerpc/feupdateenv.c: Moved to... * sysdeps/powerpc/fpu/feupdateenv.c: ...here. * sysdeps/powerpc/fgetexcptflg.c: Moved to... * sysdeps/powerpc/fpu/fgetexcptflg.c: ...here. * sysdeps/powerpc/fraiseexcpt.c: Moved to... * sysdeps/powerpc/fpu/fraiseexcpt.c: ...here. * sysdeps/powerpc/fsetexcptflg.c: Moved to... * sysdeps/powerpc/fpu/fsetexcptflg.c: ...here. * sysdeps/powerpc/ftestexcept.c: Moved to... * sysdeps/powerpc/fpu/ftestexcept.c: ...here. * sysdeps/powerpc/fesetround.c: Moved to... * sysdeps/powerpc/fpu/fesetround.c: ...here * sysdeps/powerpc/fenv_const.c: Moved to... * sysdeps/powerpc/fpu/fenv_const.c: ...here. 1999-10-29 Jakub Jelinek <jakub@redhat.com> * stdlib/longlong.h: Avoid UDIV_TIME redefinition. * sysdeps/sparc/sparc32/dl-machine.h: Fix loading of SPARC v8plus libraries from statically linked programs. * sysdeps/unix/sysv/linux/sparc/bits/sigaction.h: POSIX 199309 fix for sigaction on SPARC. Patches by David S. Miller <davem@redhat.com>. * sysdeps/unix/sysv/linux/sparc/sys/ucontext.h: Declare gregset_t and other required structures and defines for SPARC 64bit ABI as well, not only 32bit ABI. 1999-10-31 Andreas Jaeger <aj@suse.de> * sysdeps/sparc/sparc64/fpu/bits/huge_val.h: Replace __USE_ISOC9X by __USE_ISOC99 and update comments. * math/complex.h: Update comments for ISO C99. * math/fenv.h: Likewise. * math/test-fenv.c: Likewise. * math/tgmath.h: Likewise. * libio/stdio.h: Likewise. * posix/sys/types.h: Likewise. * sysdeps/generic/inttypes.h: Likewise. * sysdeps/generic/stdint.h: Likewise. 1999-10-31 Ulrich Drepper <drepper@cygnus.com>
This commit is contained in:
parent
b4cbd37109
commit
63ae7b6309
116
ChangeLog
116
ChangeLog
@ -1,3 +1,119 @@
|
||||
1999-10-31 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* Versions.def (libm): Add GLIBC_2.1.3.
|
||||
|
||||
ISO C99 TR1 changes various fe* functions to return an error value.
|
||||
* math/Versions [GLIBC_2.1.3]: Add feclearexcept, fegetexceptflag,
|
||||
feraiseexcept, fesetexceptflag, fegetenv, fesetenv, and feupdateenv.
|
||||
* sysdeps/alpha/fpu/fclrexcpt.c: Return value and add alias.
|
||||
* sysdeps/alpha/fpu/fegetenv.c: Likewise.
|
||||
* sysdeps/alpha/fpu/fesetenv.c: Likewise.
|
||||
* sysdeps/alpha/fpu/feupdateenv.c: Likewise.
|
||||
* sysdeps/alpha/fpu/fgetexcptflg.c: Likewise.
|
||||
* sysdeps/alpha/fpu/fraiseexcpt.c: Likewise.
|
||||
* sysdeps/alpha/fpu/fsetexcptflg.c: Likewise.
|
||||
* sysdeps/arm/fpu/fclrexcpt.c: Likewise.
|
||||
* sysdeps/arm/fpu/fegetenv.c: Likewise.
|
||||
* sysdeps/arm/fpu/fesetenv.c: Likewise.
|
||||
* sysdeps/arm/fpu/fraiseexcpt.c: Likewise.
|
||||
* sysdeps/arm/fpu/fsetexcptflg.c: Likewise.
|
||||
* sysdeps/generic/fclrexcpt.c: Likewise.
|
||||
* sysdeps/generic/fegetenv.c: Likewise.
|
||||
* sysdeps/generic/fesetenv.c: Likewise.
|
||||
* sysdeps/generic/feupdateenv.c: Likewise.
|
||||
* sysdeps/generic/fgetexcptflg.c: Likewise.
|
||||
* sysdeps/generic/fraiseexcpt.c: Likewise.
|
||||
* sysdeps/generic/fsetexcptflg.c: Likewise.
|
||||
* sysdeps/i386/fpu/fclrexcpt.c: Likewise.
|
||||
* sysdeps/i386/fpu/fegetenv.c: Likewise.
|
||||
* sysdeps/i386/fpu/fesetenv.c: Likewise.
|
||||
* sysdeps/i386/fpu/feupdateenv.c: Likewise.
|
||||
* sysdeps/i386/fpu/fgetexcptflg.c: Likewise.
|
||||
* sysdeps/i386/fpu/fraiseexcpt.c: Likewise.
|
||||
* sysdeps/i386/fpu/fsetexcptflg.c: Likewise.
|
||||
* sysdeps/m68k/fpu/fclrexcpt.c: Likewise.
|
||||
* sysdeps/m68k/fpu/fegetenv.c: Likewise.
|
||||
* sysdeps/m68k/fpu/fesetenv.c: Likewise.
|
||||
* sysdeps/m68k/fpu/feupdateenv.c: Likewise.
|
||||
* sysdeps/m68k/fpu/fgetexcptflg.c: Likewise.
|
||||
* sysdeps/m68k/fpu/fraiseexcpt.c: Likewise.
|
||||
* sysdeps/m68k/fpu/fsetexcptflg.c: Likewise.
|
||||
* sysdeps/mips/fclrexcpt.c: Likewise.
|
||||
* sysdeps/mips/fegetenv.c: Likewise.
|
||||
* sysdeps/mips/fesetenv.c: Likewise.
|
||||
* sysdeps/mips/feupdateenv.c: Likewise.
|
||||
* sysdeps/mips/fgetexcptflg.c: Likewise.
|
||||
* sysdeps/powerpc/fclrexcpt.c: Likewise.
|
||||
* sysdeps/powerpc/fegetenv.c: Likewise.
|
||||
* sysdeps/powerpc/fesetenv.c: Likewise.
|
||||
* sysdeps/powerpc/feupdateenv.c: Likewise.
|
||||
* sysdeps/powerpc/fgetexcptflg.c: Likewise.
|
||||
* sysdeps/powerpc/fraiseexcpt.c: Likewise.
|
||||
* sysdeps/powerpc/fsetexcptflg.c: Likewise.
|
||||
* sysdeps/sparc/fpu/fclrexcpt.c: Likewise.
|
||||
* sysdeps/sparc/fpu/fegetenv.c: Likewise.
|
||||
* sysdeps/sparc/fpu/fesetenv.c: Likewise.
|
||||
* sysdeps/sparc/fpu/feupdateenv.c: Likewise.
|
||||
* sysdeps/sparc/fpu/fgetexcptflg.c: Likewise.
|
||||
* sysdeps/sparc/fpu/fraiseexcpt.c: Likewise.
|
||||
* sysdeps/sparc/fpu/fsetexcptflg.c: Likewise.
|
||||
* math/fenv.h: Adjust prototypes.: Likewise.
|
||||
* manual/arith.texi: Adjust documentation for these changes.
|
||||
|
||||
* manual/arith.texi: Document feraiseexcept.
|
||||
|
||||
* sysdeps/powerpc/fegetenv.c: Moved to...
|
||||
* sysdeps/powerpc/fpu/fegetenv.c: ...here.
|
||||
* sysdeps/powerpc/fegetround.c: Moved to...
|
||||
* sysdeps/powerpc/fpu/fegetround.c: ...here.
|
||||
* sysdeps/powerpc/feholdexcpt.c: Moved to...
|
||||
* sysdeps/powerpc/fpu/feholdexcpt.c: ...here.
|
||||
* sysdeps/powerpc/fesetenv.c: Moved to...
|
||||
* sysdeps/powerpc/fpu/fesetenv.c: ...here.
|
||||
* sysdeps/powerpc/fenv_libc.h: Moved to...
|
||||
* sysdeps/powerpc/fpu/fenv_libc.h: ...here.
|
||||
* sysdeps/powerpc/feupdateenv.c: Moved to...
|
||||
* sysdeps/powerpc/fpu/feupdateenv.c: ...here.
|
||||
* sysdeps/powerpc/fgetexcptflg.c: Moved to...
|
||||
* sysdeps/powerpc/fpu/fgetexcptflg.c: ...here.
|
||||
* sysdeps/powerpc/fraiseexcpt.c: Moved to...
|
||||
* sysdeps/powerpc/fpu/fraiseexcpt.c: ...here.
|
||||
* sysdeps/powerpc/fsetexcptflg.c: Moved to...
|
||||
* sysdeps/powerpc/fpu/fsetexcptflg.c: ...here.
|
||||
* sysdeps/powerpc/ftestexcept.c: Moved to...
|
||||
* sysdeps/powerpc/fpu/ftestexcept.c: ...here.
|
||||
* sysdeps/powerpc/fesetround.c: Moved to...
|
||||
* sysdeps/powerpc/fpu/fesetround.c: ...here
|
||||
* sysdeps/powerpc/fenv_const.c: Moved to...
|
||||
* sysdeps/powerpc/fpu/fenv_const.c: ...here.
|
||||
|
||||
1999-10-29 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* stdlib/longlong.h: Avoid UDIV_TIME redefinition.
|
||||
* sysdeps/sparc/sparc32/dl-machine.h: Fix loading of SPARC v8plus
|
||||
libraries from statically linked programs.
|
||||
* sysdeps/unix/sysv/linux/sparc/bits/sigaction.h: POSIX 199309
|
||||
fix for sigaction on SPARC.
|
||||
Patches by David S. Miller <davem@redhat.com>.
|
||||
|
||||
* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h: Declare
|
||||
gregset_t and other required structures and defines for SPARC 64bit
|
||||
ABI as well, not only 32bit ABI.
|
||||
|
||||
1999-10-31 Andreas Jaeger <aj@suse.de>
|
||||
|
||||
* sysdeps/sparc/sparc64/fpu/bits/huge_val.h: Replace __USE_ISOC9X
|
||||
by __USE_ISOC99 and update comments.
|
||||
|
||||
* math/complex.h: Update comments for ISO C99.
|
||||
* math/fenv.h: Likewise.
|
||||
* math/test-fenv.c: Likewise.
|
||||
* math/tgmath.h: Likewise.
|
||||
* libio/stdio.h: Likewise.
|
||||
* posix/sys/types.h: Likewise.
|
||||
* sysdeps/generic/inttypes.h: Likewise.
|
||||
* sysdeps/generic/stdint.h: Likewise.
|
||||
|
||||
1999-10-31 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* manual/creature.texi (Feature Test Macros): Mention _ISOC99_SOURCE.
|
||||
|
@ -114,7 +114,7 @@ typedef _G_fpos64_t fpos64_t;
|
||||
extern FILE *stdin; /* Standard input stream. */
|
||||
extern FILE *stdout; /* Standard output stream. */
|
||||
extern FILE *stderr; /* Standard error output stream. */
|
||||
/* C89/C9x say they're macros. Make them happy. */
|
||||
/* C89/C99 say they're macros. Make them happy. */
|
||||
#define stdin stdin
|
||||
#define stdout stdout
|
||||
#define stderr stderr
|
||||
|
@ -1,5 +1,5 @@
|
||||
*.d *.o *.so *.po *.go stamp.* *.stamp *.ustamp *.udeps
|
||||
*.gz *.Z *.tar *.tgz
|
||||
*.gz *.Z *.tar *.tgz *.bz2
|
||||
=*
|
||||
TODO COPYING* AUTHORS copyr-* copying.*
|
||||
glibc-*
|
||||
@ -10,3 +10,5 @@ glibc-*
|
||||
|
||||
texis top-menu.texi chapters.texi summary.texi stamp-*
|
||||
distinfo dir-add.texinfo
|
||||
|
||||
libm-err.texi
|
||||
|
@ -476,9 +476,27 @@ and save and restore the set of exceptions flagged.
|
||||
|
||||
@comment fenv.h
|
||||
@comment ISO
|
||||
@deftypefun void feclearexcept (int @var{excepts})
|
||||
@deftypefun int feclearexcept (int @var{excepts})
|
||||
This function clears all of the supported exception flags indicated by
|
||||
@var{excepts}.
|
||||
|
||||
The function returns zero in case the operation was successful, a
|
||||
non-zero value otherwise.
|
||||
@end deftypefun
|
||||
|
||||
@comment fenv.h
|
||||
@comment ISO
|
||||
@deftypefun int feraiseexcept (int @var{excepts})
|
||||
This function raises the supported exceptions indicated by
|
||||
@var{excepts}. If more than one exception bit in @var{excepts} is set
|
||||
the order in which the exceptions are raised is undefined except that
|
||||
overflow (@code{FE_OVERFLOW}) or underflow (@code{FE_UNDERFLOW}) are
|
||||
raised before inexact (@code{FE_INEXACT}). Whether for overflow or
|
||||
underflow the inexact exception is also raised is also implementation
|
||||
dependent.
|
||||
|
||||
The function returns zero in case the operation was successful, a
|
||||
non-zero value otherwise.
|
||||
@end deftypefun
|
||||
|
||||
@comment fenv.h
|
||||
@ -519,19 +537,25 @@ following functions:
|
||||
|
||||
@comment fenv.h
|
||||
@comment ISO
|
||||
@deftypefun void fegetexceptflag (fexcept_t *@var{flagp}, int @var{excepts})
|
||||
@deftypefun int fegetexceptflag (fexcept_t *@var{flagp}, int @var{excepts})
|
||||
This function stores in the variable pointed to by @var{flagp} an
|
||||
implementation-defined value representing the current setting of the
|
||||
exception flags indicated by @var{excepts}.
|
||||
|
||||
The function returns zero in case the operation was successful, a
|
||||
non-zero value otherwise.
|
||||
@end deftypefun
|
||||
|
||||
@comment fenv.h
|
||||
@comment ISO
|
||||
@deftypefun void fesetexceptflag (const fexcept_t *@var{flagp}, int
|
||||
@deftypefun int fesetexceptflag (const fexcept_t *@var{flagp}, int
|
||||
@var{excepts})
|
||||
This function restores the flags for the exceptions indicated by
|
||||
@var{excepts} to the values stored in the variable pointed to by
|
||||
@var{flagp}.
|
||||
|
||||
The function returns zero in case the operation was successful, a
|
||||
non-zero value otherwise.
|
||||
@end deftypefun
|
||||
|
||||
Note that the value stored in @code{fexcept_t} bears no resemblance to
|
||||
@ -736,9 +760,12 @@ To save the state of the FPU, use one of these functions:
|
||||
|
||||
@comment fenv.h
|
||||
@comment ISO
|
||||
@deftypefun void fegetenv (fenv_t *@var{envp})
|
||||
@deftypefun int fegetenv (fenv_t *@var{envp})
|
||||
Store the floating-point environment in the variable pointed to by
|
||||
@var{envp}.
|
||||
|
||||
The function returns zero in case the operation was successful, a
|
||||
non-zero value otherwise.
|
||||
@end deftypefun
|
||||
|
||||
@comment fenv.h
|
||||
@ -780,19 +807,25 @@ functions:
|
||||
|
||||
@comment fenv.h
|
||||
@comment ISO
|
||||
@deftypefun void fesetenv (const fenv_t *@var{envp})
|
||||
@deftypefun int fesetenv (const fenv_t *@var{envp})
|
||||
Set the floating-point environment to that described by @var{envp}.
|
||||
|
||||
The function returns zero in case the operation was successful, a
|
||||
non-zero value otherwise.
|
||||
@end deftypefun
|
||||
|
||||
@comment fenv.h
|
||||
@comment ISO
|
||||
@deftypefun void feupdateenv (const fenv_t *@var{envp})
|
||||
@deftypefun int feupdateenv (const fenv_t *@var{envp})
|
||||
Like @code{fesetenv}, this function sets the floating-point environment
|
||||
to that described by @var{envp}. However, if any exceptions were
|
||||
flagged in the status word before @code{feupdateenv} was called, they
|
||||
remain flagged after the call. In other words, after @code{feupdateenv}
|
||||
is called, the status word is the bitwise OR of the previous status word
|
||||
and the one saved in @var{envp}.
|
||||
|
||||
The function returns zero in case the operation was successful, a
|
||||
non-zero value otherwise.
|
||||
@end deftypefun
|
||||
|
||||
@node Arithmetic Functions
|
||||
|
@ -196,7 +196,7 @@ This macro was introduced as part of the Large File Support extension
|
||||
@comment (none)
|
||||
@comment GNU
|
||||
@defvr Macro _ISOC99_SOURCE
|
||||
Until the revides @w{ISO C} standard is widely adopted the new features
|
||||
Until the revised @w{ISO C} standard is widely adopted the new features
|
||||
are not automatically enabled. The GNU libc nevertheless has a complete
|
||||
implementation of the new standard and to enable the new features the
|
||||
macro @code{_ISOC99_SOURCE} should be defined.
|
||||
|
@ -153,4 +153,9 @@ libm {
|
||||
__fpclassify; __fpclassifyf; __fpclassifyl;
|
||||
__signbit; __signbitf; __signbitl;
|
||||
}
|
||||
GLIBC_2.1.3 {
|
||||
# fp environment functions changes from ISO C99 TR1
|
||||
feclearexcept; fegetenv; fegetexceptflag; feraiseexcept;
|
||||
fesetenv; fesetexceptflag; feupdateenv;
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/*
|
||||
* ISO C 9X: 7.8 Complex arithmetic <complex.h>
|
||||
* ISO C99: 7.8 Complex arithmetic <complex.h>
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_H
|
||||
@ -25,13 +25,13 @@
|
||||
|
||||
#include <features.h>
|
||||
|
||||
/* Get general and ISO C 9X specific information. */
|
||||
/* Get general and ISO C99 specific information. */
|
||||
#include <bits/mathdef.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* We might need to add support for more compilers here. But once ISO
|
||||
C 9X is out hopefully all maintained compilers will provide the data
|
||||
/* We might need to add support for more compilers here. But since ISO
|
||||
C99 is out hopefully all maintained compilers will soon provide the data
|
||||
types `float complex' and `double complex'. */
|
||||
#if __GNUC_PREREQ (2, 7)
|
||||
# define _Complex __complex__
|
||||
@ -82,7 +82,7 @@ __BEGIN_DECLS
|
||||
#undef __MATH_PRECNAME
|
||||
|
||||
/* And the long double versions. It is non-critical to define them
|
||||
here unconditionally since `long double' is required in ISO C 9X. */
|
||||
here unconditionally since `long double' is required in ISO C99. */
|
||||
#if __STDC__ - 0 || __GNUC__ - 0 && !defined __NO_LONG_DOUBLE_MATH
|
||||
# ifndef _Mlong_double_
|
||||
# define _Mlong_double_ long double
|
||||
|
16
math/fenv.h
16
math/fenv.h
@ -17,7 +17,7 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/*
|
||||
* ISO C 9X 7.6: Floating-point environment <fenv.h>
|
||||
* ISO C99 7.6: Floating-point environment <fenv.h>
|
||||
*/
|
||||
|
||||
#ifndef _FENV_H
|
||||
@ -62,18 +62,18 @@ __BEGIN_DECLS
|
||||
/* Floating-point exception handling. */
|
||||
|
||||
/* Clear the supported exceptions represented by EXCEPTS. */
|
||||
extern void feclearexcept (int __excepts) __THROW;
|
||||
extern int feclearexcept (int __excepts) __THROW;
|
||||
|
||||
/* Store implementation-defined representation of the exception flags
|
||||
indicated by EXCEPTS in the object pointed to by FLAGP. */
|
||||
extern void fegetexceptflag (fexcept_t *__flagp, int __excepts) __THROW;
|
||||
extern int fegetexceptflag (fexcept_t *__flagp, int __excepts) __THROW;
|
||||
|
||||
/* Raise the supported exceptions represented by EXCEPTS. */
|
||||
extern void feraiseexcept (int __excepts) __THROW;
|
||||
extern int feraiseexcept (int __excepts) __THROW;
|
||||
|
||||
/* Set complete status for exceptions indicated by EXCEPTS according to
|
||||
the representation in the object pointed to by FLAGP. */
|
||||
extern void fesetexceptflag (__const fexcept_t *__flagp, int __excepts) __THROW;
|
||||
extern int fesetexceptflag (__const fexcept_t *__flagp, int __excepts) __THROW;
|
||||
|
||||
/* Determine which of subset of the exceptions specified by EXCEPTS are
|
||||
currently set. */
|
||||
@ -93,7 +93,7 @@ extern int fesetround (int __rounding_direction) __THROW;
|
||||
|
||||
/* Store the current floating-point environment in the object pointed
|
||||
to by ENVP. */
|
||||
extern void fegetenv (fenv_t *__envp) __THROW;
|
||||
extern int fegetenv (fenv_t *__envp) __THROW;
|
||||
|
||||
/* Save the current environment in the object pointed to by ENVP, clear
|
||||
exception flags and install a non-stop mode (if available) for all
|
||||
@ -102,12 +102,12 @@ extern int feholdexcept (fenv_t *__envp) __THROW;
|
||||
|
||||
/* Establish the floating-point environment represented by the object
|
||||
pointed to by ENVP. */
|
||||
extern void fesetenv (__const fenv_t *__envp) __THROW;
|
||||
extern int fesetenv (__const fenv_t *__envp) __THROW;
|
||||
|
||||
/* Save current exceptions in temporary storage, install environment
|
||||
represented by object pointed to by ENVP and raise exceptions
|
||||
according to saved exceptions. */
|
||||
extern void feupdateenv (__const fenv_t *__envp) __THROW;
|
||||
extern int feupdateenv (__const fenv_t *__envp) __THROW;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
@ -373,7 +373,7 @@ feenv_tests (void)
|
||||
}
|
||||
|
||||
|
||||
/* IEC 559 and ISO C 9X define a default startup environment */
|
||||
/* IEC 559 and ISO C99 define a default startup environment */
|
||||
static void
|
||||
initial_tests (void)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/*
|
||||
* ISO C 9X Standard: 7.9 Type-generic math <tgmath.h>
|
||||
* ISO C99 Standard: 7.22 Type-generic math <tgmath.h>
|
||||
*/
|
||||
|
||||
#ifndef _TGMATH_H
|
||||
|
@ -144,7 +144,7 @@ typedef unsigned int uint;
|
||||
|
||||
#if !__GNUC_PREREQ (2, 7)
|
||||
|
||||
/* These types are defined by the ISO C 9x header <inttypes.h>. */
|
||||
/* These types are defined by the ISO C99 header <inttypes.h>. */
|
||||
# ifndef __int8_t_defined
|
||||
# define __int8_t_defined
|
||||
typedef char int8_t;
|
||||
|
@ -1179,7 +1179,9 @@ extern USItype __udiv_qrnnd ();
|
||||
#define UDIV_TIME (3+7*32) /* 7 instructions/iteration. 32 iterations. */
|
||||
#else
|
||||
extern USItype __udiv_qrnnd __P ((USItype *, USItype, USItype, USItype));
|
||||
#ifndef UDIV_TIME
|
||||
#define UDIV_TIME 140
|
||||
#endif /* UDIV_TIME */
|
||||
#endif /* udiv_qrnnd */
|
||||
#endif /* __sparc__ */
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Clear given exceptions in current floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson <rth@tamu.edu>, 1997.
|
||||
|
||||
@ -20,17 +20,23 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
feclearexcept (int excepts)
|
||||
int
|
||||
__feclearexcept (int excepts)
|
||||
{
|
||||
unsigned long swcr;
|
||||
unsigned long int swcr;
|
||||
|
||||
/* Get the current state. */
|
||||
swcr = __ieee_get_fp_control();
|
||||
swcr = __ieee_get_fp_control ();
|
||||
|
||||
/* Clear the relevant bits. */
|
||||
swcr &= ~((unsigned long)excepts & FE_ALL_EXCEPT);
|
||||
swcr &= ~((unsigned long int) excepts & FE_ALL_EXCEPT);
|
||||
|
||||
/* Put the new state in effect. */
|
||||
__ieee_set_fp_control(swcr);
|
||||
__ieee_set_fp_control (swcr);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feclearexcept, __old_feclearexcept)
|
||||
symbol_version (__old_feclearexcept, feclearexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feclearexcept, feclearexcept, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson <rth@tamu.edu>, 1997
|
||||
|
||||
@ -20,18 +20,25 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fegetenv (fenv_t *envp)
|
||||
int
|
||||
__fegetenv (fenv_t *envp)
|
||||
{
|
||||
unsigned long fpcr, swcr;
|
||||
unsigned long int fpcr;
|
||||
unsigned long int swcr;
|
||||
|
||||
/* Get status from software and hardware. Note that we don't need an
|
||||
excb because the callsys is an implied trap barrier. */
|
||||
swcr = __ieee_get_fp_control();
|
||||
__asm__ __volatile__("mf_fpcr %0" : "=f"(fpcr));
|
||||
swcr = __ieee_get_fp_control ();
|
||||
__asm__ __volatile__ ("mf_fpcr %0" : "=f" (fpcr));
|
||||
|
||||
/* Merge the two bits of information. The magic number at the end is
|
||||
the exception enable mask. */
|
||||
|
||||
*envp = (fpcr & (3UL << 58)) | (swcr & (FE_ALL_EXCEPT | 0x3e));
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetenv, __old_fegetenv)
|
||||
symbol_version (__old_fegetenv, fegetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fegetenv, fegetenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Install given floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson <rth@tamu.edu>, 1997
|
||||
|
||||
@ -20,26 +20,32 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fesetenv (const fenv_t *envp)
|
||||
int
|
||||
__fesetenv (const fenv_t *envp)
|
||||
{
|
||||
unsigned long fpcr;
|
||||
unsigned long int fpcr;
|
||||
fenv_t env;
|
||||
|
||||
/* Magic encoding of default values: high bit set (never possible for a
|
||||
user-space address) is not indirect. And we don't even have to get
|
||||
rid of it since we mask things around just below. */
|
||||
if ((long)envp >= 0)
|
||||
if ((long int) envp >= 0)
|
||||
env = *envp;
|
||||
else
|
||||
env = (unsigned long)envp;
|
||||
env = (unsigned long int) envp;
|
||||
|
||||
/* Reset the rounding mode with the hardware fpcr. Note that the following
|
||||
system call is an implied trap barrier for our modification. */
|
||||
__asm__ __volatile__("excb; mf_fpcr %0" : "=f"(fpcr));
|
||||
__asm__ __volatile__ ("excb; mf_fpcr %0" : "=f" (fpcr));
|
||||
fpcr = (fpcr & ~(3UL << 58)) | (env & (3UL << 58));
|
||||
__asm__ __volatile__("mt_fpcr %0" : : "f"(fpcr));
|
||||
__asm__ __volatile__ ("mt_fpcr %0" : : "f" (fpcr));
|
||||
|
||||
/* Reset the exception status and mask with the kernel's FP code. */
|
||||
__ieee_set_fp_control(env & (FE_ALL_EXCEPT | 0x3e));
|
||||
__ieee_set_fp_control (env & (FE_ALL_EXCEPT | 0x3e));
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetenv, __old_fesetenv)
|
||||
symbol_version (__old_fesetenv, fesetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fesetenv, fesetenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Install given floating-point environment and raise exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson <rth@tamu.edu>, 1997.
|
||||
|
||||
@ -20,19 +20,25 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
feupdateenv (const fenv_t *envp)
|
||||
int
|
||||
__feupdateenv (const fenv_t *envp)
|
||||
{
|
||||
unsigned long tmp;
|
||||
unsigned long int tmp;
|
||||
|
||||
/* Get the current exception state. */
|
||||
tmp = __ieee_get_fp_control();
|
||||
tmp = __ieee_get_fp_control ();
|
||||
|
||||
/* Install new environment. */
|
||||
fesetenv(envp);
|
||||
fesetenv (envp);
|
||||
|
||||
/* Raise the saved exception. Incidently for us the implementation
|
||||
defined format of the values in objects of type fexcept_t is the
|
||||
same as the ones specified using the FE_* constants. */
|
||||
feraiseexcept((int)tmp & FE_ALL_EXCEPT);
|
||||
feraiseexcept ((int) tmp & FE_ALL_EXCEPT);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feupdateenv, __old_feupdateenv)
|
||||
symbol_version (__old_feupdateenv, feupdateenv, GLIBC_2.1);
|
||||
default_symbol_version (__feupdateenv, feupdateenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current representation for exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson <rth@tamu.edu>, 1997.
|
||||
|
||||
@ -20,14 +20,20 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
{
|
||||
unsigned long tmp;
|
||||
unsigned long int tmp;
|
||||
|
||||
/* Get the current state. */
|
||||
tmp = __ieee_get_fp_control();
|
||||
|
||||
/* Return that portion that corresponds to the requested exceptions. */
|
||||
*flagp = tmp & excepts & FE_ALL_EXCEPT;
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetexceptflag, __old_fegetexceptflag)
|
||||
symbol_version (__old_fegetexceptflag, fegetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fegetexceptflag, fegetexceptflag, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Raise given exceptions.
|
||||
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson <rth@tamu.edu>, 1997.
|
||||
|
||||
@ -22,9 +22,10 @@
|
||||
#include <math.h>
|
||||
|
||||
void
|
||||
feraiseexcept (int excepts)
|
||||
__feraiseexcept (int excepts)
|
||||
{
|
||||
double tmp, dummy;
|
||||
double tmp;
|
||||
double dummy;
|
||||
|
||||
/* Raise exceptions represented by EXPECTS. But we must raise only
|
||||
one signal at a time. It is important the if the overflow/underflow
|
||||
@ -36,38 +37,34 @@ feraiseexcept (int excepts)
|
||||
|
||||
/* First: invalid exception. */
|
||||
if (FE_INVALID & excepts)
|
||||
{
|
||||
/* One example of a invalid operation is 0 * Infinity. */
|
||||
__asm__ __volatile__("mult/sui $f31,%1,%0; trapb"
|
||||
: "=&f"(tmp) : "f"(HUGE_VAL));
|
||||
}
|
||||
/* One example of a invalid operation is 0 * Infinity. */
|
||||
__asm__ __volatile__("mult/sui $f31,%1,%0; trapb"
|
||||
: "=&f" (tmp) : "f" (HUGE_VAL));
|
||||
|
||||
/* Next: division by zero. */
|
||||
if (FE_DIVBYZERO & excepts)
|
||||
{
|
||||
__asm__ __volatile__("cmpteq $f31,$f31,%1; divt/sui %1,$f31,%0; trapb"
|
||||
: "=&f"(tmp), "=f"(dummy));
|
||||
}
|
||||
__asm__ __volatile__("cmpteq $f31,$f31,%1; divt/sui %1,$f31,%0; trapb"
|
||||
: "=&f" (tmp), "=f" (dummy));
|
||||
|
||||
/* Next: overflow. */
|
||||
if (FE_OVERFLOW & excepts)
|
||||
{
|
||||
__asm__ __volatile__("mult/sui %1,%1,%0; trapb"
|
||||
: "=&f"(tmp) : "f"(DBL_MAX));
|
||||
}
|
||||
__asm__ __volatile__("mult/sui %1,%1,%0; trapb"
|
||||
: "=&f" (tmp) : "f" (DBL_MAX));
|
||||
|
||||
/* Next: underflow. */
|
||||
if (FE_UNDERFLOW & excepts)
|
||||
{
|
||||
__asm__ __volatile__("divt/sui %1,%2,%0; trapb"
|
||||
: "=&f"(tmp) : "f"(DBL_MIN),
|
||||
"f"((double) (1UL << 60)));
|
||||
}
|
||||
__asm__ __volatile__("divt/sui %1,%2,%0; trapb"
|
||||
: "=&f" (tmp) : "f" (DBL_MIN),
|
||||
"f" ((double) (1UL << 60)));
|
||||
|
||||
/* Last: inexact. */
|
||||
if (FE_INEXACT & excepts)
|
||||
{
|
||||
__asm__ __volatile__("divt/sui %1,%2,%0; trapb"
|
||||
: "=&f"(tmp) : "f"(1.0), "f"(M_PI));
|
||||
}
|
||||
__asm__ __volatile__("divt/sui %1,%2,%0; trapb"
|
||||
: "=&f" (tmp) : "f" (1.0), "f" (M_PI));
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feraiseexcept, __old_feraiseexcept)
|
||||
symbol_version (__old_feraiseexcept, feraiseexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feraiseexcept, feraiseexcept, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Set floating-point environment exception handling.
|
||||
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Richard Henderson <rth@tamu.edu>, 1997.
|
||||
|
||||
@ -20,17 +20,23 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
{
|
||||
unsigned long tmp;
|
||||
unsigned long int tmp;
|
||||
|
||||
/* Get the current exception state. */
|
||||
tmp = __ieee_get_fp_control();
|
||||
tmp = __ieee_get_fp_control ();
|
||||
|
||||
/* Set all the bits that were called for. */
|
||||
tmp = (tmp & ~FE_ALL_EXCEPT) | (*flagp & excepts & FE_ALL_EXCEPT);
|
||||
|
||||
/* And store it back. */
|
||||
__ieee_set_fp_control(tmp);
|
||||
__ieee_set_fp_control (tmp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
|
||||
symbol_version (__old_fesetexceptflag, fesetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fesetexceptflag, fesetexceptflag, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Clear given exceptions in current floating-point environment.
|
||||
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 1999 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
|
||||
@ -20,8 +20,8 @@
|
||||
#include <fenv.h>
|
||||
#include <fpu_control.h>
|
||||
|
||||
void
|
||||
feclearexcept (int excepts)
|
||||
int
|
||||
__feclearexcept (int excepts)
|
||||
{
|
||||
unsigned long int temp;
|
||||
|
||||
@ -29,11 +29,17 @@ feclearexcept (int excepts)
|
||||
excepts &= FE_ALL_EXCEPT;
|
||||
|
||||
/* Get the current floating point status. */
|
||||
_FPU_GETCW(temp);
|
||||
_FPU_GETCW (temp);
|
||||
|
||||
/* Clear the relevant bits. */
|
||||
temp &= excepts ^ FE_ALL_EXCEPT;
|
||||
|
||||
/* Put the new data in effect. */
|
||||
_FPU_SETCW(temp);
|
||||
_FPU_SETCW (temp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feclearexcept, __old_feclearexcept)
|
||||
symbol_version (__old_feclearexcept, feclearexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feclearexcept, feclearexcept, GLIBC_2.1.3);
|
||||
|
@ -20,10 +20,16 @@
|
||||
#include <fenv.h>
|
||||
#include <fpu_control.h>
|
||||
|
||||
void
|
||||
fegetenv (fenv_t *envp)
|
||||
int
|
||||
__fegetenv (fenv_t *envp)
|
||||
{
|
||||
unsigned long int temp;
|
||||
_FPU_GETCW(temp);
|
||||
_FPU_GETCW (temp);
|
||||
envp->__cw = temp;
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetenv, __old_fegetenv)
|
||||
symbol_version (__old_fegetenv, fegetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fegetenv, fegetenv, GLIBC_2.1.3);
|
||||
|
@ -20,14 +20,20 @@
|
||||
#include <fenv.h>
|
||||
#include <fpu_control.h>
|
||||
|
||||
void
|
||||
fesetenv (const fenv_t *envp)
|
||||
int
|
||||
__fesetenv (const fenv_t *envp)
|
||||
{
|
||||
if (envp == FE_DFL_ENV)
|
||||
_FPU_SETCW(_FPU_DEFAULT);
|
||||
_FPU_SETCW (_FPU_DEFAULT);
|
||||
else
|
||||
{
|
||||
unsigned long temp = envp->__cw;
|
||||
_FPU_SETCW(temp);
|
||||
unsigned long int temp = envp->__cw;
|
||||
_FPU_SETCW (temp);
|
||||
}
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetenv, __old_fesetenv)
|
||||
symbol_version (__old_fesetenv, fesetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fesetenv, fesetenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Raise given exceptions.
|
||||
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 1999 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
|
||||
@ -21,12 +21,18 @@
|
||||
#include <fpu_control.h>
|
||||
#include <math.h>
|
||||
|
||||
void
|
||||
feraiseexcept (int excepts)
|
||||
int
|
||||
__feraiseexcept (int excepts)
|
||||
{
|
||||
/* Raise exceptions represented by EXPECTS. */
|
||||
fexcept_t temp;
|
||||
_FPU_GETCW(temp);
|
||||
_FPU_GETCW (temp);
|
||||
temp |= (excepts & FE_ALL_EXCEPT);
|
||||
_FPU_SETCW(temp);
|
||||
_FPU_SETCW (temp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feraiseexcept, __old_feraiseexcept)
|
||||
symbol_version (__old_feraiseexcept, feraiseexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feraiseexcept, feraiseexcept, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Set floating-point environment exception handling.
|
||||
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 1999 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
|
||||
@ -21,18 +21,24 @@
|
||||
#include <math.h>
|
||||
#include <fpu_control.h>
|
||||
|
||||
void
|
||||
fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
{
|
||||
fexcept_t temp;
|
||||
|
||||
/* Get the current environment. */
|
||||
_FPU_GETCW(temp);
|
||||
_FPU_GETCW (temp);
|
||||
|
||||
/* Set the desired exception mask. */
|
||||
temp &= ~((excepts & FE_ALL_EXCEPT) << FE_EXCEPT_SHIFT);
|
||||
temp |= (*flagp & excepts & FE_ALL_EXCEPT) << FE_EXCEPT_SHIFT;
|
||||
|
||||
/* Save state back to the FPU. */
|
||||
_FPU_SETCW(temp);
|
||||
_FPU_SETCW (temp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
|
||||
symbol_version (__old_fesetexceptflag, fesetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fesetexceptflag, fesetexceptflag, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Clear given exceptions in current floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -20,9 +20,15 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
feclearexcept (int excepts)
|
||||
int
|
||||
__feclearexcept (int excepts)
|
||||
{
|
||||
/* This always fails. */
|
||||
return 1;
|
||||
}
|
||||
strong_alias (__feclearexcept, __old_feclearexcept)
|
||||
symbol_version (__old_feclearexcept, feclearexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feclearexcept, feclearexcept, GLIBC_2.1.3);
|
||||
|
||||
stub_warning (feclearexcept)
|
||||
#include <stub-tag.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -20,9 +20,15 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
int
|
||||
fegetenv (fenv_t *envp)
|
||||
{
|
||||
/* This always fails. */
|
||||
return 1;
|
||||
}
|
||||
strong_alias (__fegetenv, __old_fegetenv)
|
||||
symbol_version (__old_fegetenv, fegetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fegetenv, fegetenv, GLIBC_2.1.3);
|
||||
|
||||
stub_warning (fegetenv)
|
||||
#include <stub-tag.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Install given floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -20,9 +20,15 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fesetenv (const fenv_t *envp)
|
||||
int
|
||||
__fesetenv (const fenv_t *envp)
|
||||
{
|
||||
/* This always fails. */
|
||||
return 1;
|
||||
}
|
||||
strong_alias (__fesetenv, __old_fesetenv)
|
||||
symbol_version (__old_fesetenv, fesetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fesetenv, fesetenv, GLIBC_2.1.3);
|
||||
|
||||
stub_warning (fesetenv)
|
||||
#include <stub-tag.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Install given floating-point environment and raise exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -20,9 +20,15 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
feupdateenv (const fenv_t *envp)
|
||||
int
|
||||
__feupdateenv (const fenv_t *envp)
|
||||
{
|
||||
/* This always fails. */
|
||||
return 1;
|
||||
}
|
||||
strong_alias (__feupdateenv, __old_feupdateenv)
|
||||
symbol_version (__old_feupdateenv, feupdateenv, GLIBC_2.1);
|
||||
default_symbol_version (__feupdateenv, feupdateenv, GLIBC_2.1.3);
|
||||
|
||||
stub_warning (feupdateenv)
|
||||
#include <stub-tag.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current representation for exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -20,9 +20,15 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
{
|
||||
/* This always fails. */
|
||||
return 1;
|
||||
}
|
||||
strong_alias (__fegetexceptflag, __old_fegetexceptflag)
|
||||
symbol_version (__old_fegetexceptflag, fegetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fegetexceptflag, fegetexceptflag, GLIBC_2.1.3);
|
||||
|
||||
stub_warning (fegetexceptflag)
|
||||
#include <stub-tag.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Raise given exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -20,9 +20,15 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
feraiseexcept (int excepts)
|
||||
int
|
||||
__feraiseexcept (int excepts)
|
||||
{
|
||||
/* This always fails. */
|
||||
return 1;
|
||||
}
|
||||
strong_alias (__feraiseexcept, __old_feraiseexcept)
|
||||
symbol_version (__old_feraiseexcept, feraiseexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feraiseexcept, feraiseexcept, GLIBC_2.1.3);
|
||||
|
||||
stub_warning (feraiseexcept)
|
||||
#include <stub-tag.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Set floating-point environment exception handling.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -20,9 +20,15 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
{
|
||||
/* This always fails. */
|
||||
return 1;
|
||||
}
|
||||
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
|
||||
symbol_version (__old_fesetexceptflag, fesetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fesetexceptflag, fesetexceptflag, GLIBC_2.1.3);
|
||||
|
||||
stub_warning (fesetexceptflag)
|
||||
#include <stub-tag.h>
|
||||
|
@ -17,7 +17,7 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/*
|
||||
* ISO C 9X: 7.5 Format conversion of integer types <inttypes.h>
|
||||
* ISO C99: 7.8 Format conversion of integer types <inttypes.h>
|
||||
*/
|
||||
|
||||
#ifndef _INTTYPES_H
|
||||
@ -28,7 +28,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
/* The ISO C 9X standard specifies that these macros must only be
|
||||
/* The ISO C99 standard specifies that these macros must only be
|
||||
defined if explicitly requested. */
|
||||
#if !defined __cplusplus || defined __STDC_FORMAT_MACROS
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/*
|
||||
* ISO C 9X: 7.18 Integer types <stdint.h>
|
||||
* ISO C99: 7.18 Integer types <stdint.h>
|
||||
*/
|
||||
|
||||
#ifndef _STDINT_H
|
||||
@ -140,7 +140,7 @@ typedef unsigned long long int uintmax_t;
|
||||
#endif
|
||||
|
||||
|
||||
/* The ISO C 9X standard specifies that in C++ implementations these
|
||||
/* The ISO C99 standard specifies that in C++ implementations these
|
||||
macros should only be defined if explicitly requested. */
|
||||
#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
|
||||
|
||||
@ -280,7 +280,7 @@ typedef unsigned long long int uintmax_t;
|
||||
#endif /* C++ && limit macros */
|
||||
|
||||
|
||||
/* The ISO C 9X standard specifies that in C++ implementations these
|
||||
/* The ISO C99 standard specifies that in C++ implementations these
|
||||
should only be defined if explicitly requested. */
|
||||
#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
|
||||
|
||||
|
@ -20,8 +20,8 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
feclearexcept (int excepts)
|
||||
int
|
||||
__feclearexcept (int excepts)
|
||||
{
|
||||
fenv_t temp;
|
||||
|
||||
@ -37,4 +37,10 @@ feclearexcept (int excepts)
|
||||
|
||||
/* Put the new data in effect. */
|
||||
__asm__ ("fldenv %0" : : "m" (*&temp));
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feclearexcept, __old_feclearexcept)
|
||||
symbol_version (__old_feclearexcept, feclearexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feclearexcept, feclearexcept, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -20,8 +20,14 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fegetenv (fenv_t *envp)
|
||||
int
|
||||
__fegetenv (fenv_t *envp)
|
||||
{
|
||||
__asm__ ("fnstenv %0" : "=m" (*envp));
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetenv, __old_fegetenv)
|
||||
symbol_version (__old_fegetenv, fegetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fegetenv, fegetenv, GLIBC_2.1.3);
|
||||
|
@ -23,8 +23,8 @@
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
void
|
||||
fesetenv (const fenv_t *envp)
|
||||
int
|
||||
__fesetenv (const fenv_t *envp)
|
||||
{
|
||||
fenv_t temp;
|
||||
|
||||
@ -73,4 +73,10 @@ fesetenv (const fenv_t *envp)
|
||||
}
|
||||
|
||||
__asm__ ("fldenv %0" : : "m" (temp));
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetenv, __old_fesetenv)
|
||||
symbol_version (__old_fesetenv, fesetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fesetenv, fesetenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Install given floating-point environment and raise exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
feupdateenv (const fenv_t *envp)
|
||||
int
|
||||
__feupdateenv (const fenv_t *envp)
|
||||
{
|
||||
fexcept_t temp;
|
||||
|
||||
@ -36,4 +36,10 @@ feupdateenv (const fenv_t *envp)
|
||||
defined format of the values in objects of type fexcept_t is the
|
||||
same as the ones specified using the FE_* constants. */
|
||||
feraiseexcept ((int) temp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feupdateenv, __old_feupdateenv)
|
||||
symbol_version (__old_feupdateenv, feupdateenv, GLIBC_2.1);
|
||||
default_symbol_version (__feupdateenv, feupdateenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current representation for exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
{
|
||||
fexcept_t temp;
|
||||
|
||||
@ -29,4 +29,10 @@ fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
__asm__ ("fnstsw %0" : "=m" (*&temp));
|
||||
|
||||
*flagp = temp & excepts & FE_ALL_EXCEPT;
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetexceptflag, __old_fegetexceptflag)
|
||||
symbol_version (__old_fegetexceptflag, fegetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fegetexceptflag, fegetexceptflag, GLIBC_2.1.3);
|
||||
|
@ -21,8 +21,8 @@
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
|
||||
void
|
||||
feraiseexcept (int excepts)
|
||||
int
|
||||
__feraiseexcept (int excepts)
|
||||
{
|
||||
/* Raise exceptions represented by EXPECTS. But we must raise only
|
||||
one signal at a time. It is important that if the overflow/underflow
|
||||
@ -109,4 +109,10 @@ feraiseexcept (int excepts)
|
||||
/* And raise the exception. */
|
||||
__asm__ __volatile__ ("fwait");
|
||||
}
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feraiseexcept, __old_feraiseexcept)
|
||||
symbol_version (__old_feraiseexcept, feraiseexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feraiseexcept, feraiseexcept, GLIBC_2.1.3);
|
||||
|
@ -21,8 +21,8 @@
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
|
||||
void
|
||||
fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
{
|
||||
fenv_t temp;
|
||||
|
||||
@ -37,4 +37,10 @@ fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
Possibly new exceptions are set but they won't get executed unless
|
||||
the next floating-point instruction. */
|
||||
__asm__ ("fldenv %0" : : "m" (*&temp));
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
|
||||
symbol_version (__old_fesetexceptflag, fesetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fesetexceptflag, fesetexceptflag, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Clear given exceptions in current floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
feclearexcept (int excepts)
|
||||
int
|
||||
__feclearexcept (int excepts)
|
||||
{
|
||||
fexcept_t fpsr;
|
||||
|
||||
@ -36,4 +36,10 @@ feclearexcept (int excepts)
|
||||
|
||||
/* Put the new data in effect. */
|
||||
__asm__ __volatile__ ("fmove%.l %0,%/fpsr" : : "dm" (fpsr));
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feclearexcept, __old_feclearexcept)
|
||||
symbol_version (__old_feclearexcept, feclearexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feclearexcept, feclearexcept, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
@ -20,8 +20,14 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fegetenv (fenv_t *envp)
|
||||
int
|
||||
__fegetenv (fenv_t *envp)
|
||||
{
|
||||
__asm__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" : "=m" (*envp));
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetenv, __old_fegetenv)
|
||||
symbol_version (__old_fegetenv, fegetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fegetenv, fegetenv, GLIBC_2.1.3);
|
||||
|
@ -20,8 +20,8 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fesetenv (const fenv_t *envp)
|
||||
int
|
||||
__fesetenv (const fenv_t *envp)
|
||||
{
|
||||
fenv_t temp;
|
||||
|
||||
@ -45,4 +45,10 @@ fesetenv (const fenv_t *envp)
|
||||
}
|
||||
|
||||
__asm__ __volatile__ ("fmovem%.l %0,%/fpcr/%/fpsr/%/fpiar" : : "m" (*&temp));
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetenv, __old_fesetenv)
|
||||
symbol_version (__old_fesetenv, fesetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fesetenv, fesetenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Install given floating-point environment and raise exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
feupdateenv (const fenv_t *envp)
|
||||
int
|
||||
__feupdateenv (const fenv_t *envp)
|
||||
{
|
||||
fexcept_t fpsr;
|
||||
|
||||
@ -36,4 +36,10 @@ feupdateenv (const fenv_t *envp)
|
||||
defined format of the values in objects of type fexcept_t is the
|
||||
same as the ones specified using the FE_* constants. */
|
||||
feraiseexcept ((int) fpsr);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feupdateenv, __old_feupdateenv)
|
||||
symbol_version (__old_feupdateenv, feupdateenv, GLIBC_2.1);
|
||||
default_symbol_version (__feupdateenv, feupdateenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current representation for exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
{
|
||||
fexcept_t fpsr;
|
||||
|
||||
@ -29,4 +29,10 @@ fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
__asm__ ("fmove%.l %/fpsr,%0" : "=dm" (fpsr));
|
||||
|
||||
*flagp = fpsr & excepts & FE_ALL_EXCEPT;
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetexceptflag, __old_fegetexceptflag)
|
||||
symbol_version (__old_fegetexceptflag, fegetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fegetexceptflag, fegetexceptflag, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Raise given exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
@ -21,8 +21,8 @@
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
|
||||
void
|
||||
feraiseexcept (int excepts)
|
||||
int
|
||||
__feraiseexcept (int excepts)
|
||||
{
|
||||
/* Raise exceptions represented by EXCEPTS. But we must raise only one
|
||||
signal at a time. It is important that if the overflow/underflow
|
||||
@ -67,4 +67,10 @@ feraiseexcept (int excepts)
|
||||
long double d = 1.0;
|
||||
__asm__ __volatile__ ("fdiv%.s %#0r3,%0; fnop" : "=f" (d) : "0" (d));
|
||||
}
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feraiseexcept, __old_feraiseexcept)
|
||||
symbol_version (__old_feraiseexcept, feraiseexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feraiseexcept, feraiseexcept, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Set floating-point environment exception handling.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
@ -21,8 +21,8 @@
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
|
||||
void
|
||||
fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
{
|
||||
fexcept_t fpsr;
|
||||
|
||||
@ -35,4 +35,10 @@ fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
|
||||
/* Store the new status register. */
|
||||
__asm__ __volatile__ ("fmove%.l %0,%/fpsr" : : "dm" (fpsr));
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
|
||||
symbol_version (__old_fesetexceptflag, fesetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fesetexceptflag, fesetexceptflag, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Clear given exceptions in current floating-point environment.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
|
||||
|
||||
@ -21,8 +21,8 @@
|
||||
#include <fenv.h>
|
||||
#include <fpu_control.h>
|
||||
|
||||
void
|
||||
feclearexcept (int excepts)
|
||||
int
|
||||
__feclearexcept (int excepts)
|
||||
{
|
||||
int cw;
|
||||
|
||||
@ -34,7 +34,13 @@ feclearexcept (int excepts)
|
||||
|
||||
/* Clear exception bits. */
|
||||
cw &= ~excepts;
|
||||
|
||||
|
||||
/* Put the new data in effect. */
|
||||
_FPU_SETCW (cw);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feclearexcept, __old_feclearexcept)
|
||||
symbol_version (__old_feclearexcept, feclearexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feclearexcept, feclearexcept, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current floating-point environment.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
|
||||
|
||||
@ -21,8 +21,14 @@
|
||||
#include <fenv.h>
|
||||
#include <fpu_control.h>
|
||||
|
||||
void
|
||||
fegetenv (fenv_t *envp)
|
||||
int
|
||||
__fegetenv (fenv_t *envp)
|
||||
{
|
||||
_FPU_GETCW (*envp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetenv, __old_fegetenv)
|
||||
symbol_version (__old_fegetenv, fegetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fegetenv, fegetenv, GLIBC_2.1.3);
|
||||
|
@ -21,11 +21,17 @@
|
||||
#include <fenv.h>
|
||||
#include <fpu_control.h>
|
||||
|
||||
void
|
||||
fesetenv (const fenv_t *envp)
|
||||
int
|
||||
__fesetenv (const fenv_t *envp)
|
||||
{
|
||||
if (envp == FE_DFL_ENV)
|
||||
_FPU_SETCW (_FPU_DEFAULT);
|
||||
else
|
||||
_FPU_SETCW (envp->__fp_control_register);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetenv, __old_fesetenv)
|
||||
symbol_version (__old_fesetenv, fesetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fesetenv, fesetenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Install given floating-point environment and raise exceptions.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
|
||||
|
||||
@ -21,8 +21,8 @@
|
||||
#include <fenv.h>
|
||||
#include <fpu_control.h>
|
||||
|
||||
void
|
||||
feupdateenv (const fenv_t *envp)
|
||||
int
|
||||
__feupdateenv (const fenv_t *envp)
|
||||
{
|
||||
int temp;
|
||||
|
||||
@ -37,4 +37,10 @@ feupdateenv (const fenv_t *envp)
|
||||
defined format of the values in objects of type fexcept_t is the
|
||||
same as the ones specified using the FE_* constants. */
|
||||
feraiseexcept (temp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feupdateenv, __old_feupdateenv)
|
||||
symbol_version (__old_feupdateenv, feupdateenv, GLIBC_2.1);
|
||||
default_symbol_version (__feupdateenv, feupdateenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current representation for exceptions.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998.
|
||||
|
||||
@ -21,8 +21,8 @@
|
||||
#include <fenv.h>
|
||||
#include <fpu_control.h>
|
||||
|
||||
void
|
||||
fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
{
|
||||
fexcept_t temp;
|
||||
|
||||
@ -30,4 +30,10 @@ fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
_FPU_GETCW (temp);
|
||||
|
||||
*flagp = temp & excepts & FE_ALL_EXCEPT;
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetexceptflag, __old_fegetexceptflag)
|
||||
symbol_version (__old_fegetexceptflag, fegetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fegetexceptflag, fegetexceptflag, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Clear given exceptions in current floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 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
|
||||
@ -20,8 +20,8 @@
|
||||
#include <fenv_libc.h>
|
||||
|
||||
#undef feclearexcept
|
||||
void
|
||||
feclearexcept (int excepts)
|
||||
int
|
||||
__feclearexcept (int excepts)
|
||||
{
|
||||
fenv_union_t u;
|
||||
|
||||
@ -29,9 +29,15 @@ feclearexcept (int excepts)
|
||||
u.fenv = fegetenv_register ();
|
||||
|
||||
/* Clear the relevant bits. */
|
||||
u.l[1] = u.l[1] & ~((-((excepts) >> (31-FPSCR_VX) & 1) & FE_ALL_INVALID)
|
||||
| ((excepts) & FPSCR_STICKY_BITS));
|
||||
u.l[1] = u.l[1] & ~((-(excepts >> (31 - FPSCR_VX) & 1) & FE_ALL_INVALID)
|
||||
| (excepts & FPSCR_STICKY_BITS));
|
||||
|
||||
/* Put the new state in effect. */
|
||||
fesetenv_register (u.fenv);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feclearexcept, __old_feclearexcept)
|
||||
symbol_version (__old_feclearexcept, feclearexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feclearexcept, feclearexcept, GLIBC_2.1.3);
|
||||
|
@ -1,26 +0,0 @@
|
||||
/* Store current floating-point environment.
|
||||
Copyright (C) 1997 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 Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <fenv_libc.h>
|
||||
|
||||
void
|
||||
fegetenv (fenv_t *envp)
|
||||
{
|
||||
*envp = fegetenv_register ();
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/* Return current rounding direction.
|
||||
Copyright (C) 1997 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 Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <fenv_libc.h>
|
||||
|
||||
#undef fegetround
|
||||
int
|
||||
fegetround (void)
|
||||
{
|
||||
int result;
|
||||
asm ("mcrfs 7,7 ; mfcr %0" : "=r"(result) : : "cr7"); \
|
||||
return result & 3;
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
/* Install given floating-point environment.
|
||||
Copyright (C) 1997 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 Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <fenv_libc.h>
|
||||
|
||||
void
|
||||
fesetenv (const fenv_t *envp)
|
||||
{
|
||||
fesetenv_register (*envp);
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
/* Set current rounding direction.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <fenv_libc.h>
|
||||
|
||||
int
|
||||
fesetround (int round)
|
||||
{
|
||||
fenv_union_t u;
|
||||
|
||||
if ((unsigned int) round > 3)
|
||||
return 0;
|
||||
|
||||
/* Get the current state. */
|
||||
u.fenv = fegetenv_register ();
|
||||
|
||||
/* Set the relevant bits. */
|
||||
u.l[1] = (u.l[1] & ~3) | (round & 3);
|
||||
|
||||
/* Put the new state in effect. */
|
||||
fesetenv_register (u.fenv);
|
||||
|
||||
return 1;
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/* Install given floating-point environment and raise exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <fenv_libc.h>
|
||||
|
||||
void
|
||||
feupdateenv (const fenv_t *envp)
|
||||
{
|
||||
fenv_union_t old, new;
|
||||
|
||||
/* Save the currently set exceptions. */
|
||||
new.fenv = *envp;
|
||||
old.fenv = fegetenv_register ();
|
||||
|
||||
/* Copy the set exceptions from `old' to `new'. */
|
||||
new.l[1] = (new.l[1] & 0xE00000FF) | (old.l[1] & 0x1FFFFF00);
|
||||
|
||||
/* Atomically enable and raise (if appropriate) exceptions set in `new'. */
|
||||
fesetenv_register (new.fenv);
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* Store current representation for exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 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
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
#include <fenv_libc.h>
|
||||
|
||||
void
|
||||
fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
{
|
||||
fenv_union_t u;
|
||||
|
||||
@ -29,4 +29,10 @@ fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
|
||||
/* Return (all of) it. */
|
||||
*flagp = u.l[1];
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetexceptflag, __old_fegetexceptflag)
|
||||
symbol_version (__old_fegetexceptflag, fegetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fegetexceptflag, fegetexceptflag, GLIBC_2.1.3);
|
@ -1,5 +1,5 @@
|
||||
/* Raise given exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 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
|
||||
@ -20,8 +20,8 @@
|
||||
#include <fenv_libc.h>
|
||||
|
||||
#undef feraiseexcept
|
||||
void
|
||||
feraiseexcept (int excepts)
|
||||
int
|
||||
__feraiseexcept (int excepts)
|
||||
{
|
||||
fenv_union_t u;
|
||||
|
||||
@ -50,4 +50,10 @@ feraiseexcept (int excepts)
|
||||
case and raise FE_INVALID_SNAN instead. */
|
||||
&& !fetestexcept (FE_INVALID))
|
||||
set_fpscr_bit (FPSCR_VXSNAN);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feraiseexcept, __old_feraiseexcept)
|
||||
symbol_version (__old_feraiseexcept, feraiseexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feraiseexcept, feraiseexcept, GLIBC_2.1.3);
|
@ -1,5 +1,5 @@
|
||||
/* Set floating-point environment exception handling.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 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
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
#include <fenv_libc.h>
|
||||
|
||||
void
|
||||
fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
{
|
||||
fenv_union_t u;
|
||||
fexcept_t flag;
|
||||
@ -45,4 +45,10 @@ fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
/* Deal with FE_INVALID_SOFTWARE not being implemented on some chips. */
|
||||
if (flag & FE_INVALID)
|
||||
feraiseexcept(FE_INVALID);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
|
||||
symbol_version (__old_fesetexceptflag, fesetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fesetexceptflag, fesetexceptflag, GLIBC_2.1.3);
|
@ -1,33 +0,0 @@
|
||||
/* Test exception in current environment.
|
||||
Copyright (C) 1997 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 Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <fenv_libc.h>
|
||||
|
||||
int
|
||||
fetestexcept (int excepts)
|
||||
{
|
||||
fenv_union_t u;
|
||||
|
||||
/* Get the current state. */
|
||||
u.fenv = fegetenv_register ();
|
||||
|
||||
/* The FE_INVALID bit is dealt with correctly by the hardware, so we can
|
||||
just: */
|
||||
return u.l[1] & excepts;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* Clear given exceptions in current floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 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
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
feclearexcept (int excepts)
|
||||
int
|
||||
__feclearexcept (int excepts)
|
||||
{
|
||||
fenv_t tmp;
|
||||
|
||||
@ -29,4 +29,10 @@ feclearexcept (int excepts)
|
||||
tmp &= ~(excepts & FE_ALL_EXCEPT);
|
||||
|
||||
__fenv_ldfsr (tmp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feclearexcept, __old_feclearexcept)
|
||||
symbol_version (__old_feclearexcept, feclearexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feclearexcept, feclearexcept, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 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
|
||||
@ -19,8 +19,14 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fegetenv (fenv_t *envp)
|
||||
int
|
||||
__fegetenv (fenv_t *envp)
|
||||
{
|
||||
__fenv_stfsr (*envp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetenv, __old_fegetenv)
|
||||
symbol_version (__old_fegetenv, fegetenv, GLIBC_2.1)
|
||||
default_symbol_version (__fegetenv, fegetenv, GLIBC_2.1.3)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Install given floating-point environment.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 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
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fesetenv (const fenv_t *envp)
|
||||
int
|
||||
__fesetenv (const fenv_t *envp)
|
||||
{
|
||||
fenv_t dummy;
|
||||
|
||||
@ -40,4 +40,10 @@ fesetenv (const fenv_t *envp)
|
||||
}
|
||||
|
||||
__fenv_ldfsr (*envp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetenv, __old_fesetenv)
|
||||
symbol_version (__old_fesetenv, fesetenv, GLIBC_2.1);
|
||||
default_symbol_version (__fesetenv, fesetenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Install given floating-point environment and raise exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 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
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
feupdateenv (const fenv_t *envp)
|
||||
int
|
||||
__feupdateenv (const fenv_t *envp)
|
||||
{
|
||||
fexcept_t tmp;
|
||||
|
||||
@ -35,4 +35,10 @@ feupdateenv (const fenv_t *envp)
|
||||
defined format of the values in objects of type fexcept_t is the
|
||||
same as the ones specified using the FE_* constants. */
|
||||
feraiseexcept ((int) tmp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feupdateenv, __old_feupdateenv)
|
||||
symbol_version (__old_feupdateenv, feupdateenv, GLIBC_2.1);
|
||||
default_symbol_version (__feupdateenv, feupdateenv, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Store current representation for exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 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
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
{
|
||||
fexcept_t tmp;
|
||||
|
||||
@ -28,4 +28,10 @@ fegetexceptflag (fexcept_t *flagp, int excepts)
|
||||
__fenv_stfsr (tmp);
|
||||
|
||||
*flagp = tmp & excepts & FE_ALL_EXCEPT;
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fegetexceptflag, __old_fegetexceptflag)
|
||||
symbol_version (__old_fegetexceptflag, fegetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fegetexceptflag, fegetexceptflag, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Raise given exceptions.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 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
|
||||
@ -20,8 +20,8 @@
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
|
||||
void
|
||||
feraiseexcept (int excepts)
|
||||
int
|
||||
__feraiseexcept (int excepts)
|
||||
{
|
||||
static volatile double sink;
|
||||
static const struct {
|
||||
@ -37,32 +37,28 @@ feraiseexcept (int excepts)
|
||||
|
||||
/* First: invalid exception. */
|
||||
if ((FE_INVALID & excepts) != 0)
|
||||
{
|
||||
/* One example of a invalid operation is 0/0. */
|
||||
sink = c.zero / c.zero;
|
||||
}
|
||||
/* One example of a invalid operation is 0/0. */
|
||||
sink = c.zero / c.zero;
|
||||
|
||||
/* Next: division by zero. */
|
||||
if ((FE_DIVBYZERO & excepts) != 0)
|
||||
{
|
||||
sink = c.one / c.zero;
|
||||
}
|
||||
sink = c.one / c.zero;
|
||||
|
||||
/* Next: overflow. */
|
||||
if ((FE_OVERFLOW & excepts) != 0)
|
||||
{
|
||||
sink = c.max * c.max;
|
||||
}
|
||||
sink = c.max * c.max;
|
||||
|
||||
/* Next: underflow. */
|
||||
if ((FE_UNDERFLOW & excepts) != 0)
|
||||
{
|
||||
sink = c.min / c.sixteen;
|
||||
}
|
||||
sink = c.min / c.sixteen;
|
||||
|
||||
/* Last: inexact. */
|
||||
if ((FE_INEXACT & excepts) != 0)
|
||||
{
|
||||
sink = c.one / c.pi;
|
||||
}
|
||||
sink = c.one / c.pi;
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__feraiseexcept, __old_feraiseexcept)
|
||||
symbol_version (__old_feraiseexcept, feraiseexcept, GLIBC_2.1);
|
||||
default_symbol_version (__feraiseexcept, feraiseexcept, GLIBC_2.1.3);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Set floating-point environment exception handling.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1999 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
|
||||
@ -20,8 +20,8 @@
|
||||
#include <fenv.h>
|
||||
#include <math.h>
|
||||
|
||||
void
|
||||
fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
int
|
||||
__fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
{
|
||||
fenv_t tmp;
|
||||
|
||||
@ -31,4 +31,10 @@ fesetexceptflag (const fexcept_t *flagp, int excepts)
|
||||
tmp |= *flagp & excepts & FE_ALL_EXCEPT;
|
||||
|
||||
__fenv_ldfsr (tmp);
|
||||
|
||||
/* Success. */
|
||||
return 0;
|
||||
}
|
||||
strong_alias (__fesetexceptflag, __old_fesetexceptflag)
|
||||
symbol_version (__old_fesetexceptflag, fesetexceptflag, GLIBC_2.1);
|
||||
default_symbol_version (__fesetexceptflag, fesetexceptflag, GLIBC_2.1.3);
|
||||
|
@ -56,7 +56,9 @@ elf_machine_matches_host (Elf32_Half e_machine)
|
||||
weak_extern (_dl_hwcap_mask);
|
||||
|
||||
hwcap = WEAKADDR(_dl_hwcap);
|
||||
return hwcap && (*hwcap & _dl_hwcap_mask & HWCAP_SPARC_V9);
|
||||
/* XXX The following is wrong! Dave Miller rejected to implement it
|
||||
correctly. If this causes problems shoot *him*! */
|
||||
return hwcap == NULL || (*hwcap & _dl_hwcap_mask & HWCAP_SPARC_V9);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
@ -54,9 +54,9 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
|
||||
#endif /* GCC. */
|
||||
|
||||
|
||||
/* ISO C 9X extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */
|
||||
/* ISO C99 extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */
|
||||
|
||||
#ifdef __USE_ISOC9X
|
||||
#ifdef __USE_ISOC99
|
||||
|
||||
# if __GNUC_PREREQ(2,95)
|
||||
|
||||
@ -119,4 +119,4 @@ static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
|
||||
|
||||
# endif /* GCC 2.95. */
|
||||
|
||||
#endif /* __USE_ISOC9X. */
|
||||
#endif /* __USE_ISOC99. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* The proper definitions for Linux/SPARC sigaction.
|
||||
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1997, 1998, 1999 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
|
||||
@ -24,8 +24,21 @@
|
||||
/* Structure describing the action to be taken when a signal arrives. */
|
||||
struct sigaction
|
||||
{
|
||||
/* Signal handler. */
|
||||
/* Signal handler. */
|
||||
#ifdef __USE_POSIX199309
|
||||
union
|
||||
{
|
||||
/* Used if SA_SIGINFO is not set. */
|
||||
__sighandler_t sa_handler;
|
||||
/* Used if SA_SIGINFO is set. */
|
||||
void (*sa_sigaction) (int, siginfo_t *, void *);
|
||||
}
|
||||
__sigaction_handler;
|
||||
# define sa_handler __sigaction_handler.sa_handler
|
||||
# define sa_sigaction __sigaction_handler.sa_sigaction
|
||||
#else
|
||||
__sighandler_t sa_handler;
|
||||
#endif
|
||||
|
||||
/* Additional set of signals to be blocked. */
|
||||
__sigset_t sa_mask;
|
||||
|
@ -85,7 +85,7 @@ typedef struct ucontext {
|
||||
mcontext_t uc_mcontext;
|
||||
} ucontext_t;
|
||||
|
||||
#else /* __WORDSIZE == 32 */
|
||||
#endif /* __WORDISIZE == 64 */
|
||||
|
||||
/*
|
||||
* Location of the users' stored registers relative to R0.
|
||||
@ -117,11 +117,24 @@ typedef struct ucontext {
|
||||
* treats arrays and structures as parameters.
|
||||
*
|
||||
* Note that NGREG is really (sizeof (struct regs) / sizeof (greg_t)),
|
||||
* but that the ABI defines it absolutely to be 19.
|
||||
* but that the ABI defines it absolutely to be 21 (resp. 19).
|
||||
*/
|
||||
#define NGREG 19
|
||||
|
||||
#if __WORDSIZE == 64
|
||||
|
||||
#define REG_ASI (19)
|
||||
#define REG_FPRS (20)
|
||||
|
||||
#define NGREG 21
|
||||
typedef long greg_t;
|
||||
|
||||
#else /* __WORDSIZE == 32 */
|
||||
|
||||
#define NGREG 19
|
||||
typedef int greg_t;
|
||||
|
||||
#endif /* __WORDSIZE == 32 */
|
||||
|
||||
typedef greg_t gregset_t[NGREG];
|
||||
|
||||
/*
|
||||
@ -182,6 +195,24 @@ struct fq
|
||||
#define V9_FPU_FSR_TYPE unsigned long long
|
||||
#define V9_FPU_FPRS_TYPE unsigned
|
||||
|
||||
#if __WORDSIZE == 64
|
||||
|
||||
typedef struct fpu
|
||||
{
|
||||
union { /* FPU floating point regs */
|
||||
unsigned fpu_regs[32]; /* 32 singles */
|
||||
double fpu_dregs[16]; /* 32 doubles */
|
||||
long double fpu_qregs[16]; /* 16 quads */
|
||||
} fpu_fr;
|
||||
struct fq *fpu_q; /* ptr to array of FQ entries */
|
||||
unsigned long fpu_fsr; /* FPU status register */
|
||||
unsigned char fpu_qcnt; /* # of entries in saved FQ */
|
||||
unsigned char fpu_q_entrysize; /* # of bytes per FQ entry */
|
||||
unsigned char fpu_en; /* flag signifying fpu in use */
|
||||
} fpregset_t;
|
||||
|
||||
#else /* __WORDSIZE == 32 */
|
||||
|
||||
typedef struct fpu
|
||||
{
|
||||
union { /* FPU floating point regs */
|
||||
|
Loading…
Reference in New Issue
Block a user