diff options
Diffstat (limited to 'libc/sysdeps/s390/fpu')
-rw-r--r-- | libc/sysdeps/s390/fpu/bits/fenv.h | 49 | ||||
-rw-r--r-- | libc/sysdeps/s390/fpu/fclrexcpt.c | 3 | ||||
-rw-r--r-- | libc/sysdeps/s390/fpu/fegetenv.c | 4 | ||||
-rw-r--r-- | libc/sysdeps/s390/fpu/feholdexcpt.c | 4 | ||||
-rw-r--r-- | libc/sysdeps/s390/fpu/fesetenv.c | 12 |
5 files changed, 41 insertions, 31 deletions
diff --git a/libc/sysdeps/s390/fpu/bits/fenv.h b/libc/sysdeps/s390/fpu/bits/fenv.h index 6df7b177f..88c6f7ac0 100644 --- a/libc/sysdeps/s390/fpu/bits/fenv.h +++ b/libc/sysdeps/s390/fpu/bits/fenv.h @@ -24,16 +24,21 @@ of the appropriate bits in the FPU control word. */ enum { - FE_INVALID = 0x80, -#define FE_INVALID FE_INVALID - FE_DIVBYZERO = 0x40, -#define FE_DIVBYZERO FE_DIVBYZERO - FE_OVERFLOW = 0x20, -#define FE_OVERFLOW FE_OVERFLOW - FE_UNDERFLOW = 0x10, -#define FE_UNDERFLOW FE_UNDERFLOW - FE_INEXACT = 0x08 -#define FE_INEXACT FE_INEXACT + FE_INVALID = +#define FE_INVALID 0x80 + FE_INVALID, + FE_DIVBYZERO = +#define FE_DIVBYZERO 0x40 + FE_DIVBYZERO, + FE_OVERFLOW = +#define FE_OVERFLOW 0x20 + FE_OVERFLOW, + FE_UNDERFLOW = +#define FE_UNDERFLOW 0x10 + FE_UNDERFLOW, + FE_INEXACT = +#define FE_INEXACT 0x08 + FE_INEXACT }; /* We dont use the y bit of the DXC in the floating point control register as glibc has no FE encoding for fe inexact incremented @@ -48,14 +53,18 @@ enum enum { - FE_TONEAREST = 0, -#define FE_TONEAREST FE_TONEAREST - FE_DOWNWARD = 0x3, -#define FE_DOWNWARD FE_DOWNWARD - FE_UPWARD = 0x2, -#define FE_UPWARD FE_UPWARD - FE_TOWARDZERO = 0x1 -#define FE_TOWARDZERO FE_TOWARDZERO + FE_TONEAREST = +#define FE_TONEAREST 0 + FE_TONEAREST, + FE_DOWNWARD = +#define FE_DOWNWARD 0x3 + FE_DOWNWARD, + FE_UPWARD = +#define FE_UPWARD 0x2 + FE_UPWARD, + FE_TOWARDZERO = +#define FE_TOWARDZERO 0x1 + FE_TOWARDZERO }; @@ -67,8 +76,8 @@ typedef unsigned int fexcept_t; /* size of fpc */ to the layout of the block written by the `fstenv'. */ typedef struct { - fexcept_t fpc; - void *ieee_instruction_pointer; + fexcept_t __fpc; + void *__ieee_instruction_pointer; /* failing instruction for ieee exceptions */ } fenv_t; diff --git a/libc/sysdeps/s390/fpu/fclrexcpt.c b/libc/sysdeps/s390/fpu/fclrexcpt.c index 2352d74b0..3e8d9bb3a 100644 --- a/libc/sysdeps/s390/fpu/fclrexcpt.c +++ b/libc/sysdeps/s390/fpu/fclrexcpt.c @@ -1,5 +1,5 @@ /* Clear given exceptions in current floating-point environment. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000-2012 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 @@ -37,3 +37,4 @@ feclearexcept (int excepts) /* Success. */ return 0; } +libm_hidden_def (feclearexcept) diff --git a/libc/sysdeps/s390/fpu/fegetenv.c b/libc/sysdeps/s390/fpu/fegetenv.c index 243f1f1e1..afbe2c771 100644 --- a/libc/sysdeps/s390/fpu/fegetenv.c +++ b/libc/sysdeps/s390/fpu/fegetenv.c @@ -1,5 +1,5 @@ /* Store current floating-point environment. - Copyright (C) 2000, 2008 Free Software Foundation, Inc. + Copyright (C) 2000-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com). @@ -23,7 +23,7 @@ int fegetenv (fenv_t *envp) { - _FPU_GETCW (envp->fpc); + _FPU_GETCW (envp->__fpc); /* Success. */ return 0; diff --git a/libc/sysdeps/s390/fpu/feholdexcpt.c b/libc/sysdeps/s390/fpu/feholdexcpt.c index 76ca70fb4..5b97ade02 100644 --- a/libc/sysdeps/s390/fpu/feholdexcpt.c +++ b/libc/sysdeps/s390/fpu/feholdexcpt.c @@ -1,5 +1,5 @@ /* Store current floating-point environment and clear exceptions. - Copyright (C) 2000, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2000-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com). @@ -27,7 +27,7 @@ int feholdexcept (fenv_t *envp) fegetenv (envp); /* Clear the current sticky bits as more than one exception may be generated. */ - fpc = envp->fpc & ~(FPC_FLAGS_MASK | FPC_DXC_MASK); + fpc = envp->__fpc & ~(FPC_FLAGS_MASK | FPC_DXC_MASK); /* Hold from generating fpu exceptions temporarily. */ _FPU_SETCW ((fpc & ~(FE_ALL_EXCEPT << FPC_EXCEPTION_MASK_SHIFT))); return 0; diff --git a/libc/sysdeps/s390/fpu/fesetenv.c b/libc/sysdeps/s390/fpu/fesetenv.c index 4fe82999d..b5342051f 100644 --- a/libc/sysdeps/s390/fpu/fesetenv.c +++ b/libc/sysdeps/s390/fpu/fesetenv.c @@ -1,5 +1,5 @@ /* Install given floating-point environment. - Copyright (C) 2000, 2008 Free Software Foundation, Inc. + Copyright (C) 2000-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com). @@ -31,18 +31,18 @@ fesetenv (const fenv_t *envp) if (envp == FE_DFL_ENV) { - env.fpc = _FPU_DEFAULT; - env.ieee_instruction_pointer = 0; + env.__fpc = _FPU_DEFAULT; + env.__ieee_instruction_pointer = 0; } else if (envp == FE_NOMASK_ENV) { - env.fpc = FPC_EXCEPTION_MASK; - env.ieee_instruction_pointer = 0; + env.__fpc = FPC_EXCEPTION_MASK; + env.__ieee_instruction_pointer = 0; } else env = (*envp); - _FPU_SETCW (env.fpc); + _FPU_SETCW (env.__fpc); /* Success. */ return 0; |