diff options
Diffstat (limited to 'sysdeps/sh/sh4/fpu')
-rw-r--r-- | sysdeps/sh/sh4/fpu/fclrexcpt.c | 42 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fedisblxcpt.c | 39 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/feenablxcpt.c | 38 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fegetenv.c | 34 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fegetexcept.c | 32 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fegetmode.c | 27 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fegetround.c | 35 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/feholdexcpt.c | 44 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fesetenv.c | 36 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fesetexcept.c | 32 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fesetmode.c | 38 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fesetround.c | 45 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/feupdateenv.c | 41 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fgetexcptflg.c | 38 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fraiseexcpt.c | 75 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/fsetexcptflg.c | 39 | ||||
-rw-r--r-- | sysdeps/sh/sh4/fpu/ftestexcept.c | 32 |
17 files changed, 0 insertions, 667 deletions
diff --git a/sysdeps/sh/sh4/fpu/fclrexcpt.c b/sysdeps/sh/sh4/fpu/fclrexcpt.c deleted file mode 100644 index 5a430f6655..0000000000 --- a/sysdeps/sh/sh4/fpu/fclrexcpt.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Clear given exceptions in current floating-point environment. - Copyright (C) 1998-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -feclearexcept (int excepts) -{ - fpu_control_t cw; - - /* Mask out unsupported bits/exceptions. */ - excepts &= FE_ALL_EXCEPT; - - /* Read the complete control word. */ - _FPU_GETCW (cw); - - /* Clear exception bits. */ - cw &= ~excepts; - - /* Put the new data in effect. */ - _FPU_SETCW (cw); - - return 0; -} -libm_hidden_def (feclearexcept) diff --git a/sysdeps/sh/sh4/fpu/fedisblxcpt.c b/sysdeps/sh/sh4/fpu/fedisblxcpt.c deleted file mode 100644 index 718ae70899..0000000000 --- a/sysdeps/sh/sh4/fpu/fedisblxcpt.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Disable floating-point exceptions. - Copyright (C) 2012-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fedisableexcept (int excepts) -{ - fpu_control_t temp, old_exc; - - /* Get the current control register contents. */ - _FPU_GETCW (temp); - - old_exc = (temp >> 5) & FE_ALL_EXCEPT; - - excepts &= FE_ALL_EXCEPT; - - temp &= ~(excepts << 5); - _FPU_SETCW (temp); - - return old_exc; -} diff --git a/sysdeps/sh/sh4/fpu/feenablxcpt.c b/sysdeps/sh/sh4/fpu/feenablxcpt.c deleted file mode 100644 index d638714149..0000000000 --- a/sysdeps/sh/sh4/fpu/feenablxcpt.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Enable floating-point exceptions. - Copyright (C) 2012-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -feenableexcept (int excepts) -{ - fpu_control_t temp, old_flag; - - /* Get current exceptions. */ - _FPU_GETCW (temp); - - old_flag = (temp >> 5) & FE_ALL_EXCEPT; - excepts &= FE_ALL_EXCEPT; - - temp |= excepts << 5; - _FPU_SETCW (temp); - - return old_flag; -} diff --git a/sysdeps/sh/sh4/fpu/fegetenv.c b/sysdeps/sh/sh4/fpu/fegetenv.c deleted file mode 100644 index 00945f1072..0000000000 --- a/sysdeps/sh/sh4/fpu/fegetenv.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Store current floating-point environment. - Copyright (C) 1997-2017 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -__fegetenv (fenv_t *envp) -{ - fpu_control_t temp; - _FPU_GETCW (temp); - - envp->__fpscr = temp; - - return 0; -} -libm_hidden_def (__fegetenv) -weak_alias (__fegetenv, fegetenv) -libm_hidden_weak (fegetenv) diff --git a/sysdeps/sh/sh4/fpu/fegetexcept.c b/sysdeps/sh/sh4/fpu/fegetexcept.c deleted file mode 100644 index 4d1299e310..0000000000 --- a/sysdeps/sh/sh4/fpu/fegetexcept.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Get enabled floating-point exceptions. - Copyright (C) 2012-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fegetexcept (void) -{ - fpu_control_t temp; - - /* Get current exceptions. */ - _FPU_GETCW (temp); - - return (temp >> 5) & FE_ALL_EXCEPT; -} diff --git a/sysdeps/sh/sh4/fpu/fegetmode.c b/sysdeps/sh/sh4/fpu/fegetmode.c deleted file mode 100644 index e839a9b25f..0000000000 --- a/sysdeps/sh/sh4/fpu/fegetmode.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Store current floating-point control modes. SH4 version. - Copyright (C) 2016-2017 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fegetmode (femode_t *modep) -{ - _FPU_GETCW (*modep); - return 0; -} diff --git a/sysdeps/sh/sh4/fpu/fegetround.c b/sysdeps/sh/sh4/fpu/fegetround.c deleted file mode 100644 index 4c97d23e12..0000000000 --- a/sysdeps/sh/sh4/fpu/fegetround.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Return current rounding direction. - Copyright (C) 1998-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -__fegetround (void) -{ - fpu_control_t cw; - - /* Get control word. */ - _FPU_GETCW (cw); - - return cw & 0x1; -} -libm_hidden_def (__fegetround) -weak_alias (__fegetround, fegetround) -libm_hidden_weak (fegetround) diff --git a/sysdeps/sh/sh4/fpu/feholdexcpt.c b/sysdeps/sh/sh4/fpu/feholdexcpt.c deleted file mode 100644 index b905e594cd..0000000000 --- a/sysdeps/sh/sh4/fpu/feholdexcpt.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Store current floating-point environment and clear exceptions. - Copyright (C) 1997-2017 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -__feholdexcept (fenv_t *envp) -{ - fpu_control_t temp; - - /* Store the environment. */ - _FPU_GETCW (temp); - envp->__fpscr = temp; - - /* Clear the status flags. */ - temp &= ~FE_ALL_EXCEPT; - - /* Now set all exceptions to non-stop. */ - temp &= ~(FE_ALL_EXCEPT << 5); - - _FPU_SETCW (temp); - - /* Success. */ - return 0; -} -libm_hidden_def (__feholdexcept) -weak_alias (__feholdexcept, feholdexcept) -libm_hidden_weak (feholdexcept) diff --git a/sysdeps/sh/sh4/fpu/fesetenv.c b/sysdeps/sh/sh4/fpu/fesetenv.c deleted file mode 100644 index 8628c508e5..0000000000 --- a/sysdeps/sh/sh4/fpu/fesetenv.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Install given floating-point environment. - Copyright (C) 1997-2017 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -__fesetenv (const fenv_t *envp) -{ - if (envp == FE_DFL_ENV) - _FPU_SETCW (_FPU_DEFAULT); - else - { - fpu_control_t temp = envp->__fpscr; - _FPU_SETCW (temp); - } - return 0; -} -libm_hidden_def (__fesetenv) -weak_alias (__fesetenv, fesetenv) -libm_hidden_weak (fesetenv) diff --git a/sysdeps/sh/sh4/fpu/fesetexcept.c b/sysdeps/sh/sh4/fpu/fesetexcept.c deleted file mode 100644 index ecfad75fff..0000000000 --- a/sysdeps/sh/sh4/fpu/fesetexcept.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Set given exception flags. SH4 version. - Copyright (C) 2016-2017 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fesetexcept (int excepts) -{ - fpu_control_t temp; - - _FPU_GETCW (temp); - temp |= (excepts & FE_ALL_EXCEPT); - _FPU_SETCW (temp); - - return 0; -} diff --git a/sysdeps/sh/sh4/fpu/fesetmode.c b/sysdeps/sh/sh4/fpu/fesetmode.c deleted file mode 100644 index d2b9e05128..0000000000 --- a/sysdeps/sh/sh4/fpu/fesetmode.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Install given floating-point control modes. SH4 version. - Copyright (C) 2016-2017 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -#define FPU_STATUS 0x3f07c - -int -fesetmode (const femode_t *modep) -{ - fpu_control_t fpscr; - - _FPU_GETCW (fpscr); - fpscr &= FPU_STATUS; - if (modep == FE_DFL_MODE) - fpscr |= _FPU_DEFAULT; - else - fpscr |= *modep & ~FPU_STATUS; - _FPU_SETCW (fpscr); - - return 0; -} diff --git a/sysdeps/sh/sh4/fpu/fesetround.c b/sysdeps/sh/sh4/fpu/fesetround.c deleted file mode 100644 index 20acb7c5e9..0000000000 --- a/sysdeps/sh/sh4/fpu/fesetround.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Set current rounding direction. - Copyright (C) 1998-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1998. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -__fesetround (int round) -{ - fpu_control_t cw; - - if ((round & ~0x1) != 0) - /* ROUND is no valid rounding mode. */ - return 1; - - /* Get current state. */ - _FPU_GETCW (cw); - - /* Set rounding bits. */ - cw &= ~0x1; - cw |= round; - /* Set new state. */ - _FPU_SETCW (cw); - - return 0; -} -libm_hidden_def (__fesetround) -weak_alias (__fesetround, fesetround) -libm_hidden_weak (fesetround) diff --git a/sysdeps/sh/sh4/fpu/feupdateenv.c b/sysdeps/sh/sh4/fpu/feupdateenv.c deleted file mode 100644 index 3b886a2235..0000000000 --- a/sysdeps/sh/sh4/fpu/feupdateenv.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Install given floating-point environment and raise exceptions. - Copyright (C) 2012-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -__feupdateenv (const fenv_t *envp) -{ - fpu_control_t temp; - - _FPU_GETCW (temp); - temp = (temp & FE_ALL_EXCEPT); - - /* 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. */ - __fesetenv (envp); - __feraiseexcept ((int) temp); - - return 0; -} -libm_hidden_def (__feupdateenv) -weak_alias (__feupdateenv, feupdateenv) -libm_hidden_weak (feupdateenv) diff --git a/sysdeps/sh/sh4/fpu/fgetexcptflg.c b/sysdeps/sh/sh4/fpu/fgetexcptflg.c deleted file mode 100644 index 02fc3948bc..0000000000 --- a/sysdeps/sh/sh4/fpu/fgetexcptflg.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Store current representation for exceptions. - Copyright (C) 2013-2017 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fegetexceptflag (fexcept_t *flagp, int excepts) -{ - fpu_control_t temp; - - /* Get the current exceptions. */ - _FPU_GETCW (temp); - - /* We only save the relevant bits here. In particular, care has to be - taken with the CAUSE bits, as an inadvertent restore later on could - generate unexpected exceptions. */ - - *flagp = temp & excepts & FE_ALL_EXCEPT; - - /* Success. */ - return 0; -} diff --git a/sysdeps/sh/sh4/fpu/fraiseexcpt.c b/sysdeps/sh/sh4/fpu/fraiseexcpt.c deleted file mode 100644 index 4bd0eb9ef5..0000000000 --- a/sysdeps/sh/sh4/fpu/fraiseexcpt.c +++ /dev/null @@ -1,75 +0,0 @@ -/* Raise given exceptions. - Copyright (C) 1997-2017 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <float.h> -#include <fpu_control.h> -#include <math.h> - -int -__feraiseexcept (int excepts) -{ - if (excepts == 0) - return 0; - - /* Raise exceptions represented by EXPECTS. */ - - if (excepts & FE_INEXACT) - { - double d = 1.0, x = 3.0; - __asm__ __volatile__ ("fdiv %1, %0" : "+d" (d) : "d" (x)); - } - - if (excepts & FE_UNDERFLOW) - { - long double d = LDBL_MIN, x = 10; - __asm__ __volatile__ ("fdiv %1, %0" : "+d" (d) : "d" (x)); - } - - if (excepts & FE_OVERFLOW) - { - long double d = LDBL_MAX; - __asm__ __volatile__ ("fmul %0, %0" : "+d" (d) : "d" (d)); - } - - if (excepts & FE_DIVBYZERO) - { - double d = 1.0, x = 0.0; - __asm__ __volatile__ ("fdiv %1, %0" : "+d" (d) : "d" (x)); - } - - if (excepts & FE_INVALID) - { - double d = HUGE_VAL, x = 0.0; - __asm__ __volatile__ ("fmul %1, %0" : "+d" (d) : "d" (x)); - } - - { - /* Restore flag fields. */ - fpu_control_t cw; - _FPU_GETCW (cw); - cw |= (excepts & FE_ALL_EXCEPT); - _FPU_SETCW (cw); - } - - return 0; -} -libm_hidden_def (__feraiseexcept) -weak_alias (__feraiseexcept, feraiseexcept) -libm_hidden_weak (feraiseexcept) diff --git a/sysdeps/sh/sh4/fpu/fsetexcptflg.c b/sysdeps/sh/sh4/fpu/fsetexcptflg.c deleted file mode 100644 index 3a6ea33c26..0000000000 --- a/sysdeps/sh/sh4/fpu/fsetexcptflg.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Set floating-point environment exception handling. - Copyright (C) 1997-2017 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <math.h> -#include <fpu_control.h> - -int -fesetexceptflag (const fexcept_t *flagp, int excepts) -{ - fpu_control_t temp; - - /* Get the current environment. */ - _FPU_GETCW (temp); - - /* Set the desired exception mask. */ - temp &= ~(excepts & FE_ALL_EXCEPT); - temp |= (*flagp & excepts & FE_ALL_EXCEPT); - - /* Save state back to the FPU. */ - _FPU_SETCW (temp); - - return 0; -} diff --git a/sysdeps/sh/sh4/fpu/ftestexcept.c b/sysdeps/sh/sh4/fpu/ftestexcept.c deleted file mode 100644 index fa2c011825..0000000000 --- a/sysdeps/sh/sh4/fpu/ftestexcept.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Test exception in current environment. - Copyright (C) 1997-2017 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 Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <fenv.h> -#include <fpu_control.h> - -int -fetestexcept (int excepts) -{ - fpu_control_t temp; - - /* Get current exceptions. */ - _FPU_GETCW (temp); - - return temp & excepts & FE_ALL_EXCEPT; -} -libm_hidden_def (fetestexcept) |