about summary refs log tree commit diff
path: root/sysdeps/arm/fenv_private.h
diff options
context:
space:
mode:
authorWilco <wdijkstr@arm.com>2014-06-24 15:02:51 +0000
committerWilco <wdijkstr@arm.com>2014-06-24 15:02:51 +0000
commitb5570d92d6bb6ba9c25ac6ed77ba170dd7f4acd3 (patch)
tree002d08b3bfb4c12e49b736b68a3646591b6d498f /sysdeps/arm/fenv_private.h
parent947bdca24d1ada7e83cf266213dba02c99d035a5 (diff)
downloadglibc-b5570d92d6bb6ba9c25ac6ed77ba170dd7f4acd3.tar.gz
glibc-b5570d92d6bb6ba9c25ac6ed77ba170dd7f4acd3.tar.xz
glibc-b5570d92d6bb6ba9c25ac6ed77ba170dd7f4acd3.zip
Add _FPU_MASK_RM and use it instead of FE_TOWARDZERO.
2014-06-24  Wilco  <wdijkstr@arm.com>

	* sysdeps/arm/fpu_control.h (_FPU_MASK_RM): Define.
	* sysdeps/arm/fenv_private.h (libc_fesetround_vfp)
	(libc_feholdexcept_setround_vfp) (libc_feholdsetround_vfp)
	(libc_feresetround_vfp) (libc_feholdsetround_vfp_ctx)
	(libc_feresetround_vfp_ctx): Use _FPU_MASK_RM.
	* sysdeps/arm/fesetround.c (fesetround): Use _FPU_MASK_RM.
	* sysdeps/arm/get-rounding-mode.h (get_rounding_mode):
	Use _FPU_MASK_RM.
Diffstat (limited to 'sysdeps/arm/fenv_private.h')
-rw-r--r--sysdeps/arm/fenv_private.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/sysdeps/arm/fenv_private.h b/sysdeps/arm/fenv_private.h
index bff8acd62d..743df18c35 100644
--- a/sysdeps/arm/fenv_private.h
+++ b/sysdeps/arm/fenv_private.h
@@ -43,8 +43,8 @@ libc_fesetround_vfp (int round)
   _FPU_GETCW (fpscr);
 
   /* Set new rounding mode if different.  */
-  if (__glibc_unlikely ((fpscr & FE_TOWARDZERO) != round))
-    _FPU_SETCW ((fpscr & ~FE_TOWARDZERO) | round);
+  if (__glibc_unlikely ((fpscr & _FPU_MASK_RM) != round))
+    _FPU_SETCW ((fpscr & ~_FPU_MASK_RM) | round);
 }
 
 static __always_inline void
@@ -57,7 +57,7 @@ libc_feholdexcept_setround_vfp (fenv_t *envp, int round)
 
   /* Clear exception flags, set all exceptions to non-stop,
      and set new rounding mode.  */
-  fpscr &= ~(_FPU_MASK_EXCEPT | FE_TOWARDZERO);
+  fpscr &= ~(_FPU_MASK_EXCEPT | _FPU_MASK_RM);
   _FPU_SETCW (fpscr | round);
 }
 
@@ -70,8 +70,8 @@ libc_feholdsetround_vfp (fenv_t *envp, int round)
   envp->__cw = fpscr;
 
   /* Set new rounding mode if different.  */
-  if (__glibc_unlikely ((fpscr & FE_TOWARDZERO) != round))
-    _FPU_SETCW ((fpscr & ~FE_TOWARDZERO) | round);
+  if (__glibc_unlikely ((fpscr & _FPU_MASK_RM) != round))
+    _FPU_SETCW ((fpscr & ~_FPU_MASK_RM) | round);
 }
 
 static __always_inline void
@@ -82,7 +82,7 @@ libc_feresetround_vfp (fenv_t *envp)
   _FPU_GETCW (fpscr);
 
   /* Check whether rounding modes are different.  */
-  round = (envp->__cw ^ fpscr) & FE_TOWARDZERO;
+  round = (envp->__cw ^ fpscr) & _FPU_MASK_RM;
 
   /* Restore the rounding mode if it was changed.  */
   if (__glibc_unlikely (round != 0))
@@ -150,7 +150,7 @@ libc_feholdsetround_vfp_ctx (struct rm_ctx *ctx, int r)
   ctx->env.__cw = fpscr;
 
   /* Check whether rounding modes are different.  */
-  round = (fpscr ^ r) & FE_TOWARDZERO;
+  round = (fpscr ^ r) & _FPU_MASK_RM;
 
   /* Set the rounding mode if changed.  */
   if (__glibc_unlikely (round != 0))
@@ -169,7 +169,7 @@ libc_feresetround_vfp_ctx (struct rm_ctx *ctx)
       fpu_control_t fpscr;
 
       _FPU_GETCW (fpscr);
-      fpscr = (fpscr & ~FE_TOWARDZERO) | (ctx->env.__cw & FE_TOWARDZERO);
+      fpscr = (fpscr & ~_FPU_MASK_RM) | (ctx->env.__cw & _FPU_MASK_RM);
       _FPU_SETCW (fpscr);
     }
 }