2015-01-06 Joseph Myers <joseph@codesourcery.com>
+ [BZ #17748]
+ * include/fenv.h (__fesetround): Declare. Use libm_hidden_proto.
+ * math/fesetround.c (fesetround): Rename to __fesetround and
+ define as weak alias of __fesetround. Use libm_hidden_weak.
+ * sysdeps/aarch64/fpu/fesetround.c (fesetround): Likewise.
+ * sysdeps/alpha/fpu/fesetround.c (fesetround): Likewise.
+ * sysdeps/arm/fesetround.c (fesetround): Likewise.
+ * sysdeps/hppa/fpu/fesetround.c (fesetround): Likewise.
+ * sysdeps/i386/fpu/fesetround.c (fesetround): Likewise.
+ * sysdeps/ia64/fpu/fesetround.c (fesetround): Likewise.
+ * sysdeps/m68k/fpu/fesetround.c (fesetround): Likewise.
+ * sysdeps/mips/fpu/fesetround.c (fesetround): Likewise.
+ * sysdeps/powerpc/fpu/fenv_libc.h (__fesetround): Rename to
+ __fesetround_inline.
+ * sysdeps/powerpc/fpu/fenv_private.h (libc_fesetround_ppc): Call
+ __fesetround_inline instead of __fesetround.
+ * sysdeps/powerpc/fpu/fesetround.c (fesetround): Rename to
+ __fesetround and define as weak alias of __fesetround. Use
+ libm_hidden_weak. Call __fesetround_inline instead of
+ __fesetround.
+ * sysdeps/powerpc/nofpu/fesetround.c (fesetround): Rename to
+ __fesetround and define as weak alias of __fesetround. Use
+ libm_hidden_weak.
+ * sysdeps/powerpc/powerpc32/e500/nofpu/fesetround.c (fesetround):
+ Likewise.
+ * sysdeps/s390/fpu/fesetround.c (fesetround): Likewise.
+ * sysdeps/sh/sh4/fpu/fesetround.c (fesetround): Likewise.
+ * sysdeps/sparc/fpu/fesetround.c (fesetround): Likewise.
+ * sysdeps/tile/math_private.h (__fesetround): New inline function.
+ * sysdeps/x86_64/fpu/fesetround.c (fesetround): Rename to
+ __fesetround and define as weak alias of __fesetround. Use
+ libm_hidden_weak.
+ * sysdeps/generic/math_private.h (default_libc_fesetround): Call
+ __fesetround instead of fesetround.
+ (default_libc_feholdexcept_setround): Likewise.
+ (libc_feholdsetround_ctx): Likewise.
+ (libc_feholdsetround_noex_ctx): Likewise.
+
[BZ #17748]
* include/fenv.h (__fesetenv): Use libm_hidden_proto.
* math/fesetenv.c (__fesetenv): Use libm_hidden_def.
extern int __feupdateenv (const fenv_t *__envp);
extern __typeof (fegetround) __fegetround;
extern __typeof (feholdexcept) __feholdexcept;
+extern __typeof (fesetround) __fesetround;
libm_hidden_proto (feraiseexcept)
libm_hidden_proto (__feraiseexcept)
libm_hidden_proto (fesetenv)
libm_hidden_proto (__fesetenv)
libm_hidden_proto (fesetround)
+libm_hidden_proto (__fesetround)
libm_hidden_proto (feholdexcept)
libm_hidden_proto (__feholdexcept)
libm_hidden_proto (feupdateenv)
#include <fenv.h>
int
-fesetround (int round)
+__fesetround (int round)
{
#ifdef FE_TONEAREST
return (round == FE_TONEAREST) ? 0 : 1;
return 1; /* Signal we are unable to set the direction. */
#endif
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
stub_warning (fesetround)
#include <fpu_control.h>
int
-fesetround (int round)
+__fesetround (int round)
{
if (round & ~_FPU_FPCR_RM_MASK)
return 1;
libc_fesetround_aarch64 (round);
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
#include <fenv_libc.h>
int
-fesetround (int round)
+__fesetround (int round)
{
unsigned long fpcr;
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
int
-fesetround (int round)
+__fesetround (int round)
{
/* FE_TONEAREST is the only supported rounding mode
if a VFP unit isn't present. */
libc_fesetround_vfp (round);
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
static __always_inline void
default_libc_fesetround (int r)
{
- (void) fesetround (r);
+ (void) __fesetround (r);
}
#ifndef libc_fesetround
default_libc_feholdexcept_setround (fenv_t *e, int r)
{
__feholdexcept (e);
- fesetround (r);
+ __fesetround (r);
}
#ifndef libc_feholdexcept_setround
{
ctx->updated_status = true;
__fegetenv (&ctx->env);
- fesetround (round);
+ __fesetround (round);
}
}
/* Update rounding mode only if different. */
if (__glibc_unlikely (round != get_rounding_mode ()))
- fesetround (round);
+ __fesetround (round);
}
static __always_inline void
#include <fenv.h>
int
-fesetround (int round)
+__fesetround (int round)
{
union { unsigned long long l; unsigned int sw[2]; } s;
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
#include <dl-procinfo.h>
int
-fesetround (int round)
+__fesetround (int round)
{
unsigned short int cw;
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
#include <fenv.h>
int
-fesetround (int round)
+__fesetround (int round)
{
fenv_t fpsr;
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
#include <fenv.h>
int
-fesetround (int round)
+__fesetround (int round)
{
fexcept_t fpcr;
return 0;
}
-libm_hidden_def (fesetround);
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
#include <fpu_control.h>
int
-fesetround (int round)
+__fesetround (int round)
{
fpu_control_t cw;
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
static inline int
-__fesetround (int round)
+__fesetround_inline (int round)
{
if ((unsigned int) round < 2)
{
static __always_inline void
libc_fesetround_ppc (int r)
{
- __fesetround (r);
+ __fesetround_inline (r);
}
static __always_inline void
#undef fesetround
int
-fesetround (int round)
+__fesetround (int round)
{
if ((unsigned int) round > 3)
return 1;
else
- return __fesetround(round);
+ return __fesetround_inline(round);
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
#include "soft-supp.h"
int
-fesetround (int round)
+__fesetround (int round)
{
if ((unsigned int) round > FE_DOWNWARD)
return 1;
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
#include <fenv_libc.h>
int
-fesetround (int round)
+__fesetround (int round)
{
unsigned long fpescr;
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
#include <fpu_control.h>
int
-fesetround (int round)
+__fesetround (int round)
{
if ((round|FPC_RM_MASK) != FPC_RM_MASK)
{
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
#include <fpu_control.h>
int
-fesetround (int round)
+__fesetround (int round)
{
fpu_control_t cw;
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
#include <fenv.h>
int
-fesetround (int round)
+__fesetround (int round)
{
fenv_t tmp;
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
extern inline int fegetround (void) { return FE_TONEAREST; }
extern inline int __fegetround (void) { return FE_TONEAREST; }
extern inline int fesetround (int __d) { return 0; }
+extern inline int __fesetround (int __d) { return 0; }
#endif
#include <fenv.h>
int
-fesetround (int round)
+__fesetround (int round)
{
unsigned short int cw;
int mxcsr;
return 0;
}
-libm_hidden_def (fesetround)
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)