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.
+
+2014-06-24 Wilco <wdijkstr@arm.com>
+
* sysdeps/arm/fsetexcptflg.c (fesetexceptflag): Remove unused include.
2014-06-24 Wilco <wdijkstr@arm.com>
_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
/* 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);
}
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
_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))
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))
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);
}
}
#define _FPU_MASK_UM 0x00000800 /* underflow */
#define _FPU_MASK_PM 0x00001000 /* inexact */
-#define _FPU_MASK_NZCV 0xF0000000 /* NZCV flags */
-
+#define _FPU_MASK_NZCV 0xf0000000 /* NZCV flags */
+#define _FPU_MASK_RM 0x00c00000 /* rounding mode */
#define _FPU_MASK_EXCEPT 0x00001f1f /* all exception flags */
/* Some bits in the FPSCR are not yet defined. They must be preserved when