Return value and add alias.

This commit is contained in:
Ulrich Drepper 1999-10-31 23:13:47 +00:00
parent 6c555ab57e
commit 146bade74f
24 changed files with 258 additions and 122 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);