diff mbox

[8/13] AArch64: Cleanup fenv implementation

Message ID 001201cfeee7$b7cb8c20$2762a460$@com
State New
Headers show

Commit Message

Wilco Oct. 23, 2014, 5:35 p.m. UTC
Call libc_feholdexcept_aarch64 from math_private.h rather than duplicating functionality.

ChangeLog:
2014-10-23  Wilco Dijkstra  <wdijkstr@arm.com>

	* sysdeps/aarch64/fpu/feholdexcpt.c (feholdexcept):
	Call libc_feholdexcept_aarch64.

---
 sysdeps/aarch64/fpu/feholdexcpt.c | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

Comments

Marcus Shawcroft Oct. 24, 2014, 9:12 a.m. UTC | #1
On 23 October 2014 18:35, Wilco Dijkstra <wdijkstr@arm.com> wrote:
> Call libc_feholdexcept_aarch64 from math_private.h rather than duplicating functionality.
>
> ChangeLog:
> 2014-10-23  Wilco Dijkstra  <wdijkstr@arm.com>
>
>         * sysdeps/aarch64/fpu/feholdexcpt.c (feholdexcept):
>         Call libc_feholdexcept_aarch64.
>
> ---
>  sysdeps/aarch64/fpu/feholdexcpt.c | 27 ++-------------------------
>  1 file changed, 2 insertions(+), 25 deletions(-)
>
> diff --git a/sysdeps/aarch64/fpu/feholdexcpt.c b/sysdeps/aarch64/fpu/feholdexcpt.c
> index 5f67a7c..3b898d0 100644
> --- a/sysdeps/aarch64/fpu/feholdexcpt.c
> +++ b/sysdeps/aarch64/fpu/feholdexcpt.c
> @@ -16,35 +16,12 @@
>     License along with the GNU C Library; if not, see
>     <http://www.gnu.org/licenses/>.  */
>
> -#include <fenv.h>

Don't remove this header.  It provides the prototype for feholdexcept().
Otherwise OK. /Marcus
diff mbox

Patch

diff --git a/sysdeps/aarch64/fpu/feholdexcpt.c b/sysdeps/aarch64/fpu/feholdexcpt.c
index 5f67a7c..3b898d0 100644
--- a/sysdeps/aarch64/fpu/feholdexcpt.c
+++ b/sysdeps/aarch64/fpu/feholdexcpt.c
@@ -16,35 +16,12 @@ 
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <fenv.h>
-#include <fpu_control.h>
+#include <math_private.h>
 
 int
 feholdexcept (fenv_t *envp)
 {
-  fpu_control_t fpcr;
-  fpu_control_t fpcr_new;
-  fpu_fpsr_t fpsr;
-  fpu_fpsr_t fpsr_new;
-
-  _FPU_GETCW (fpcr);
-  envp->__fpcr = fpcr;
-
-  _FPU_GETFPSR (fpsr);
-  envp->__fpsr = fpsr;
-
-  /* Now set all exceptions to non-stop.  */
-  fpcr_new = fpcr & ~(FE_ALL_EXCEPT << FE_EXCEPT_SHIFT);
-
-  /* And clear all exception flags.  */
-  fpsr_new = fpsr & ~FE_ALL_EXCEPT;
-
-  if (fpsr != fpsr_new)
-    _FPU_SETFPSR (fpsr_new);
-
-  if (fpcr != fpcr_new)
-    _FPU_SETCW (fpcr_new);
-
+  libc_feholdexcept_aarch64 (envp);
   return 0;
 }
 libm_hidden_def (feholdexcept)