diff options
author | Joseph Myers <joseph@codesourcery.com> | 2014-02-08 00:16:57 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2014-02-08 00:16:57 +0000 |
commit | 464263cc00549d2597b6d25309d55b1e4a6b1aac (patch) | |
tree | 4646131a3aa8ebb1b1749c453f7939fcd54ee2ec /ports/sysdeps/am33/fpu | |
parent | 32749f6cd23f65a2df1bafbf9b69749bdded4b10 (diff) | |
download | glibc-464263cc00549d2597b6d25309d55b1e4a6b1aac.tar.gz glibc-464263cc00549d2597b6d25309d55b1e4a6b1aac.tar.xz glibc-464263cc00549d2597b6d25309d55b1e4a6b1aac.zip |
Remove am33 port.
This patch removes the am33 port (no other port #includes any files from it), as previously discussed (see <https://sourceware.org/ml/libc-ports/2014-01/msg00046.html>).
Diffstat (limited to 'ports/sysdeps/am33/fpu')
-rw-r--r-- | ports/sysdeps/am33/fpu/bits/fenv.h | 72 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fclrexcpt.c | 52 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fedisblxcpt.c | 41 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/feenablxcpt.c | 41 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fegetenv.c | 34 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fegetexcept.c | 34 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fegetround.c | 35 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/feholdexcpt.c | 38 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fenv_libc.h | 32 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fesetenv.c | 59 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fesetround.c | 28 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/feupdateenv.c | 46 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fgetexcptflg.c | 43 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fpu_control.h | 73 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fraiseexcpt.c | 78 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/fsetexcptflg.c | 56 | ||||
-rw-r--r-- | ports/sysdeps/am33/fpu/ftestexcept.c | 33 |
17 files changed, 0 insertions, 795 deletions
diff --git a/ports/sysdeps/am33/fpu/bits/fenv.h b/ports/sysdeps/am33/fpu/bits/fenv.h deleted file mode 100644 index e4a396dd0b..0000000000 --- a/ports/sysdeps/am33/fpu/bits/fenv.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (C) 1998-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on the corresponding file in the mips port. - - 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/>. */ - -#ifndef _FENV_H -# error "Never use <bits/fenv.h> directly; include <fenv.h> instead." -#endif - - -/* Define bits representing the exception. We use the EF bit - positions of the appropriate bits in the FPCR register. */ -enum - { - FE_INEXACT = -#define FE_INEXACT 0x01 - FE_INEXACT, - FE_UNDERFLOW = -#define FE_UNDERFLOW 0x02 - FE_UNDERFLOW, - FE_OVERFLOW = -#define FE_OVERFLOW 0x04 - FE_OVERFLOW, - FE_DIVBYZERO = -#define FE_DIVBYZERO 0x08 - FE_DIVBYZERO, - FE_INVALID = -#define FE_INVALID 0x10 - FE_INVALID, - }; - -#define FE_ALL_EXCEPT \ - (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) - -/* The AM33/2.0 FPU supports only Round to nearest. Bits 3<<16 are - reserved to represent other rounding modes. */ -enum - { - FE_TONEAREST = -#define FE_TONEAREST 0x00000 - FE_TONEAREST, - }; - - -/* Type representing exception flags. */ -typedef unsigned int fexcept_t; - - -/* Type representing floating-point environment. */ -typedef unsigned int fenv_t; - -/* If the default argument is used we use this value. */ -#define FE_DFL_ENV ((__const fenv_t *) -1) - -#ifdef __USE_GNU -/* Floating-point environment where none of the exception is masked. */ -# define FE_NOMASK_ENV ((__const fenv_t *) -2) -#endif diff --git a/ports/sysdeps/am33/fpu/fclrexcpt.c b/ports/sysdeps/am33/fpu/fclrexcpt.c deleted file mode 100644 index 12bda643fe..0000000000 --- a/ports/sysdeps/am33/fpu/fclrexcpt.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Clear given exceptions in current floating-point environment. - Copyright (C) 1998-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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 <fenv_libc.h> -#include <fpu_control.h> -#include <shlib-compat.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 flag bits and cause bits. EF bits are cleared by - assigning 1 to them (and there's no way to set them); other bits - are copied normally. */ - - cw &= ~((excepts << CAUSE_SHIFT) | FE_ALL_EXCEPT); - cw |= excepts; - - /* Put the new data in effect. */ - _FPU_SETFCW (cw); - - /* Success. */ - return 0; -} - -libm_hidden_ver (__feclearexcept, feclearexcept) -versioned_symbol (libm, __feclearexcept, feclearexcept, GLIBC_2_2); diff --git a/ports/sysdeps/am33/fpu/fedisblxcpt.c b/ports/sysdeps/am33/fpu/fedisblxcpt.c deleted file mode 100644 index 5273d9023f..0000000000 --- a/ports/sysdeps/am33/fpu/fedisblxcpt.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Disable floating-point exceptions. - Copyright (C) 2000-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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 <fenv_libc.h> -#include <fpu_control.h> - -int -fedisableexcept (int excepts) -{ - fpu_control_t new_exc, old_exc; - - /* Get the current control word. */ - _FPU_GETCW (new_exc); - - old_exc = (new_exc & ENABLE_MASK) >> ENABLE_SHIFT; - - excepts &= FE_ALL_EXCEPT; - - new_exc &= ~(excepts << ENABLE_SHIFT); - _FPU_SETCW (new_exc); - - return old_exc; -} diff --git a/ports/sysdeps/am33/fpu/feenablxcpt.c b/ports/sysdeps/am33/fpu/feenablxcpt.c deleted file mode 100644 index ae4808a458..0000000000 --- a/ports/sysdeps/am33/fpu/feenablxcpt.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Enable floating-point exceptions. - Copyright (C) 2000-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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 <fenv_libc.h> -#include <fpu_control.h> - -int -feenableexcept (int excepts) -{ - fpu_control_t new_exc, old_exc; - - /* Get the current control word. */ - _FPU_GETCW (new_exc); - - old_exc = (new_exc & ENABLE_MASK) >> ENABLE_SHIFT; - - excepts &= FE_ALL_EXCEPT; - - new_exc |= excepts << ENABLE_SHIFT; - _FPU_SETCW (new_exc); - - return old_exc; -} diff --git a/ports/sysdeps/am33/fpu/fegetenv.c b/ports/sysdeps/am33/fpu/fegetenv.c deleted file mode 100644 index 87853bad18..0000000000 --- a/ports/sysdeps/am33/fpu/fegetenv.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Store current floating-point environment. - Copyright (C) 1998-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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> -#include <shlib-compat.h> - -int -__fegetenv (fenv_t *envp) -{ - _FPU_GETCW (*envp); - - /* Success. */ - return 0; -} - -versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2); diff --git a/ports/sysdeps/am33/fpu/fegetexcept.c b/ports/sysdeps/am33/fpu/fegetexcept.c deleted file mode 100644 index 01f7c0caa6..0000000000 --- a/ports/sysdeps/am33/fpu/fegetexcept.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Get enabled floating-point exceptions. - Copyright (C) 2000-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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 <fenv_libc.h> -#include <fpu_control.h> - -int -fegetexcept (void) -{ - unsigned int exc; - - /* Get the current control word. */ - _FPU_GETCW (exc); - - return (exc & ENABLE_MASK) >> ENABLE_SHIFT; -} diff --git a/ports/sysdeps/am33/fpu/fegetround.c b/ports/sysdeps/am33/fpu/fegetround.c deleted file mode 100644 index d946d9b6e8..0000000000 --- a/ports/sysdeps/am33/fpu/fegetround.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Return current rounding direction. - Copyright (C) 1998-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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 <fenv_libc.h> -#include <fpu_control.h> - -int -fegetround (void) -{ - int cw; - - /* Get control word. */ - _FPU_GETCW (cw); - - return (cw & ROUND_MASK); -} -libm_hidden_def (fegetround) diff --git a/ports/sysdeps/am33/fpu/feholdexcpt.c b/ports/sysdeps/am33/fpu/feholdexcpt.c deleted file mode 100644 index 1e662d0eec..0000000000 --- a/ports/sysdeps/am33/fpu/feholdexcpt.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Store current floating-point environment and clear exceptions. - Copyright (C) 2000-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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 cw; - - /* Save the current state. */ - _FPU_GETCW (cw); - *envp = cw; - - /* Clear all exception enable bits and flags. */ - cw &= ~(_FPU_MASK_V|_FPU_MASK_Z|_FPU_MASK_O|_FPU_MASK_U|_FPU_MASK_I); - _FPU_SETFCW (cw); - - return 0; -} diff --git a/ports/sysdeps/am33/fpu/fenv_libc.h b/ports/sysdeps/am33/fpu/fenv_libc.h deleted file mode 100644 index ee19a04eb2..0000000000 --- a/ports/sysdeps/am33/fpu/fenv_libc.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2000-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on the corresponding file in the mips port. - - 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/>. */ - -#ifndef _FENV_LIBC_H -#define _FENV_LIBC_H 1 - -/* Mask for enabling exceptions and for the CAUSE bits. */ -#define ENABLE_MASK 0x003E0U -#define CAUSE_MASK 0x07C00U -#define ROUND_MASK 0x30000U - -/* Shift for FE_* flags to get up to the ENABLE bits and the CAUSE bits. */ -#define ENABLE_SHIFT 5 -#define CAUSE_SHIFT 10 - -#endif /* _FENV_LIBC_H */ diff --git a/ports/sysdeps/am33/fpu/fesetenv.c b/ports/sysdeps/am33/fpu/fesetenv.c deleted file mode 100644 index 7a09cfb0dc..0000000000 --- a/ports/sysdeps/am33/fpu/fesetenv.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Install given floating-point environment. - Copyright (C) 1998-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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> -#include <shlib-compat.h> - -int -__fesetenv (const fenv_t *envp) -{ - fpu_control_t cw; - - /* We want to clear all EF bits for the default end IEEE. */ - - if (envp == FE_DFL_ENV) - _FPU_SETFCW (_FPU_DEFAULT|FE_ALL_EXCEPT); - else if (envp == FE_NOMASK_ENV) - _FPU_SETFCW (_FPU_IEEE|FE_ALL_EXCEPT); - else - { - fpu_control_t temp; - - _FPU_GETCW (temp); - cw = *envp; - - /* If EF bits are cleared and the user requests them to be set, - we have to fail, because there's no way to do it. */ - if (~temp & cw & FE_ALL_EXCEPT) - return -1; - - /* We clear EF bits by storing a 1 in them, so flip the - FE_ALL_EXCEPT bits. */ - cw = (cw & ~FE_ALL_EXCEPT) | (~cw & FE_ALL_EXCEPT); - _FPU_SETFCW (cw); - } - - /* Success. */ - return 0; -} - -libm_hidden_ver (__fesetenv, fesetenv) -versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2); diff --git a/ports/sysdeps/am33/fpu/fesetround.c b/ports/sysdeps/am33/fpu/fesetround.c deleted file mode 100644 index 882e7dc576..0000000000 --- a/ports/sysdeps/am33/fpu/fesetround.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Set current rounding direction. - Copyright (C) 2004-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - - 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> - -int -fesetround (int round) -{ - /* The only supported rounding mode is to-nearest. Just check - whether we're switching to it. */ - return (round != FE_TONEAREST); -} diff --git a/ports/sysdeps/am33/fpu/feupdateenv.c b/ports/sysdeps/am33/fpu/feupdateenv.c deleted file mode 100644 index 11f9ef8116..0000000000 --- a/ports/sysdeps/am33/fpu/feupdateenv.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Install given floating-point environment and raise exceptions. - Copyright (C) 1998-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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> -#include <shlib-compat.h> - -int -__feupdateenv (const fenv_t *envp) -{ - int temp; - - /* Save current exceptions. */ - _FPU_GETCW (temp); - temp &= FE_ALL_EXCEPT; - - /* Install new environment. */ - fesetenv (envp); - - /* Raise the safed 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 (temp); - - /* Success. */ - return 0; -} - -versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2); diff --git a/ports/sysdeps/am33/fpu/fgetexcptflg.c b/ports/sysdeps/am33/fpu/fgetexcptflg.c deleted file mode 100644 index 8b09e9797d..0000000000 --- a/ports/sysdeps/am33/fpu/fgetexcptflg.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Store current representation for exceptions. - Copyright (C) 1998-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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> -#include <shlib-compat.h> - -int -__fegetexceptflag (fexcept_t *flagp, int excepts) -{ - fexcept_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; -} - -versioned_symbol (libm, __fegetexceptflag, fegetexceptflag, GLIBC_2_2); diff --git a/ports/sysdeps/am33/fpu/fpu_control.h b/ports/sysdeps/am33/fpu/fpu_control.h deleted file mode 100644 index 8b1715f3fd..0000000000 --- a/ports/sysdeps/am33/fpu/fpu_control.h +++ /dev/null @@ -1,73 +0,0 @@ -/* FPU control word bits. AM33/2.0 version. - Copyright (C) 1996-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on the corresponding file in the mips port. - - 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/>. */ - -#ifndef _FPU_CONTROL_H -#define _FPU_CONTROL_H - -/* AM33/2.0 FPU floating point control register bits. - * - * 31-22 -> reserved - * 21-18 -> floating-point condition codes (L, G, E, U) - * 17-16 -> rounding modes (00 is to-nearest; other values are reserved - * 15 -> reserved (read as 0, write with 0) - * 14-10 -> Exception Cause (inValid, divZero, Overflow, Underflow, Inexact) - * 9- 5 -> Exception Enable - * 4- 0 -> Exception Flag, cleared when exception cause is set - */ - -#include <features.h> -#include <fenv.h> - -/* masking of interrupts */ -#define _FPU_MASK_V 0x0200 /* Invalid operation */ -#define _FPU_MASK_Z 0x0100 /* Division by zero */ -#define _FPU_MASK_O 0x0080 /* Overflow */ -#define _FPU_MASK_U 0x0040 /* Underflow */ -#define _FPU_MASK_I 0x0020 /* Inexact operation */ - -/* rounding control */ -#define _FPU_RC_NEAREST 0x0 /* Only available mode */ - -#define _FPU_RESERVED 0xffc08000 /* Reserved bits in fpcr */ - - -/* The fdlibm code requires strict IEEE double precision arithmetic, - and no interrupts for exceptions, rounding to nearest. */ - -#define _FPU_DEFAULT 0x0000001f - -/* IEEE: same as above, but exceptions */ -#define _FPU_IEEE 0x000003ff - -/* Type of the control word. */ -typedef unsigned int fpu_control_t; - -/* Macros for accessing the hardware control word. _FPU_SETCW is - defined such that it won't modify the EF bits, that are cleared - when assigned bits that are set. Use SETFCW to get them actually - reset. */ -#define _FPU_SETFCW(cw) __asm__ ("fmov %0,fpcr" : : "ri" (cw)) -#define _FPU_SETCW(cw) _FPU_SETFCW((cw) & ~FE_ALL_EXCEPT) -#define _FPU_GETCW(cw) __asm__ ("fmov fpcr,%0" : "=r" (cw)) - -/* Default control word set at startup. */ -extern fpu_control_t __fpu_control; - -#endif /* fpu_control.h */ diff --git a/ports/sysdeps/am33/fpu/fraiseexcpt.c b/ports/sysdeps/am33/fpu/fraiseexcpt.c deleted file mode 100644 index b86a51eb8e..0000000000 --- a/ports/sysdeps/am33/fpu/fraiseexcpt.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Raise given exceptions. - Copyright (C) 2000-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the M68K port. - - 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 <math.h> -#include <shlib-compat.h> - -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 - exception and the divide by zero exception are given at the same - time, the overflow/underflow exception follows the divide by zero - exception. */ - - /* First: invalid exception. */ - if (excepts & FE_INVALID) - { - /* One example of an invalid operation is 0 * Infinity. */ - float x = HUGE_VALF, y = 0.0f; - __asm__ __volatile__ ("fmul %1,%0" : "+f" (x) : "f" (y)); - } - - /* Next: division by zero. */ - if (excepts & FE_DIVBYZERO) - { - float x = 1.0f, y = 0.0f; - __asm__ __volatile__ ("fdiv %1,%0" : "+f" (x) : "f" (y)); - } - - /* Next: overflow. */ - if (excepts & FE_OVERFLOW) - { - float x = FLT_MAX; - - __asm__ __volatile__ ("fmul %0,%0" : "+f" (x)); - } - - /* Next: underflow. */ - if (excepts & FE_UNDERFLOW) - { - float x = -FLT_MIN; - - __asm__ __volatile__ ("fmul %0,%0" : "+f" (x)); - } - - /* Last: inexact. */ - if (excepts & FE_INEXACT) - { - float x = 1.0f, y = 3.0f; - __asm__ __volatile__ ("fdiv %1,%0" : "=f" (x) : "f" (y)); - } - - /* Success. */ - return 0; -} - -libm_hidden_ver (__feraiseexcept, feraiseexcept) -versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); diff --git a/ports/sysdeps/am33/fpu/fsetexcptflg.c b/ports/sysdeps/am33/fpu/fsetexcptflg.c deleted file mode 100644 index 7b7ab84082..0000000000 --- a/ports/sysdeps/am33/fpu/fsetexcptflg.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Set floating-point environment exception handling. - Copyright (C) 1998-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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> -#include <shlib-compat.h> - -int -__fesetexceptflag (const fexcept_t *flagp, int excepts) -{ - fpu_control_t cw, temp; - - /* Get the current exceptions. */ - _FPU_GETCW (cw); - - /* Make sure the flags we want restored are legal. */ - excepts &= FE_ALL_EXCEPT; - temp = *flagp & excepts; - - /* If EF bits are clear and the user requests them to be set, - we have to fail, because there's no way to do it. */ - if (~(cw & excepts) & temp) - return -1; - - /* We clear EF bits by storing a 1 in them, so flip the - FE_ALL_EXCEPT bits. */ - temp = (~temp & FE_ALL_EXCEPT); - - /* Now clear the bits called for, and copy them in from flagp. Note that - we ignore all non-flag bits from *flagp, so they don't matter. */ - cw = (cw & ~FE_ALL_EXCEPT) | temp; - - _FPU_SETFCW (cw); - - /* Success. */ - return 0; -} - -versioned_symbol (libm, __fesetexceptflag, fesetexceptflag, GLIBC_2_2); diff --git a/ports/sysdeps/am33/fpu/ftestexcept.c b/ports/sysdeps/am33/fpu/ftestexcept.c deleted file mode 100644 index fc43de5a99..0000000000 --- a/ports/sysdeps/am33/fpu/ftestexcept.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Test exception in current environment. - Copyright (C) 1998-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Alexandre Oliva <aoliva@redhat.com> - based on corresponding file in the MIPS port. - - 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) -{ - int cw; - - /* Get current control word. */ - _FPU_GETCW (cw); - - return cw & excepts & FE_ALL_EXCEPT; -} |