ce426f
commit 693096cc7b397a709f075865993027c14c06d3e5
ce426f
Author: Wilco <wdijkstr@arm.com>
ce426f
Date:   Tue Jun 3 08:10:39 2014 +0000
ce426f
ce426f
    [AArch64] Switch from FE_TOWARDZERO to _FPU_FPCR_RM_MASK
ce426f
ce426f
diff --git a/ports/sysdeps/aarch64/fpu/get-rounding-mode.h b/ports/sysdeps/aarch64/fpu/get-rounding-mode.h
ce426f
index 5c1615d..425b50e 100644
ce426f
--- a/ports/sysdeps/aarch64/fpu/get-rounding-mode.h
ce426f
+++ b/ports/sysdeps/aarch64/fpu/get-rounding-mode.h
ce426f
@@ -32,7 +32,7 @@ get_rounding_mode (void)
ce426f
   fpu_control_t fpcr;
ce426f
 
ce426f
   _FPU_GETCW (fpcr);
ce426f
-  return fpcr & FE_TOWARDZERO;
ce426f
+  return fpcr & _FPU_FPCR_RM_MASK;
ce426f
 }
ce426f
 
ce426f
 #endif /* get-rounding-mode.h */
ce426f
diff --git a/ports/sysdeps/aarch64/fpu/math_private.h b/ports/sysdeps/aarch64/fpu/math_private.h
ce426f
index a3f466b..023c9d0 100644
ce426f
--- a/ports/sysdeps/aarch64/fpu/math_private.h
ce426f
+++ b/ports/sysdeps/aarch64/fpu/math_private.h
ce426f
@@ -58,7 +58,7 @@ libc_fesetround_aarch64 (int round)
ce426f
   _FPU_GETCW (fpcr);
ce426f
 
ce426f
   /* Check whether rounding modes are different.  */
ce426f
-  round = (fpcr ^ round) & FE_TOWARDZERO;
ce426f
+  round = (fpcr ^ round) & _FPU_FPCR_RM_MASK;
ce426f
 
ce426f
   /* Set new rounding mode if different.  */
ce426f
   if (__glibc_unlikely (round != 0))
ce426f
@@ -84,7 +84,7 @@ libc_feholdexcept_setround_aarch64 (fenv_t *envp, int round)
ce426f
 
ce426f
   /* Clear exception flags, set all exceptions to non-stop,
ce426f
      and set new rounding mode.  */
ce426f
-  new_fpcr = fpcr & ~((FE_ALL_EXCEPT << FE_EXCEPT_SHIFT) | FE_TOWARDZERO);
ce426f
+  new_fpcr = fpcr & ~((FE_ALL_EXCEPT << FE_EXCEPT_SHIFT) | _FPU_FPCR_RM_MASK);
ce426f
   new_fpcr |= round;
ce426f
   new_fpsr = fpsr & ~FE_ALL_EXCEPT;
ce426f
 
ce426f
@@ -190,7 +190,7 @@ libc_feholdsetround_aarch64 (fenv_t *envp, int round)
ce426f
   envp->__fpsr = fpsr;
ce426f
 
ce426f
   /* Check whether rounding modes are different.  */
ce426f
-  round = (fpcr ^ round) & FE_TOWARDZERO;
ce426f
+  round = (fpcr ^ round) & _FPU_FPCR_RM_MASK;
ce426f
 
ce426f
   /* Set new rounding mode if different.  */
ce426f
   if (__glibc_unlikely (round != 0))
ce426f
@@ -210,7 +210,7 @@ libc_feresetround_aarch64 (fenv_t *envp)
ce426f
   _FPU_GETCW (fpcr);
ce426f
 
ce426f
   /* Check whether rounding modes are different.  */
ce426f
-  round = (envp->__fpcr ^ fpcr) & FE_TOWARDZERO;
ce426f
+  round = (envp->__fpcr ^ fpcr) & _FPU_FPCR_RM_MASK;
ce426f
 
ce426f
   /* Restore the rounding mode if it was changed.  */
ce426f
   if (__glibc_unlikely (round != 0))
ce426f
@@ -236,7 +236,7 @@ libc_feholdsetround_aarch64_ctx (struct rm_ctx *ctx, int r)
ce426f
   ctx->env.__fpsr = fpsr;
ce426f
 
ce426f
   /* Check whether rounding modes are different.  */
ce426f
-  round = (fpcr ^ r) & FE_TOWARDZERO;
ce426f
+  round = (fpcr ^ r) & _FPU_FPCR_RM_MASK;
ce426f
   ctx->updated_status = round != 0;
ce426f
 
ce426f
   /* Set the rounding mode if changed.  */