arrfab / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1302086-9.patch

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