summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilco <wdijkstr@arm.com>2014-06-03 08:10:39 +0000
committerWill Newton <will.newton@linaro.org>2014-07-03 15:29:50 +0100
commit70353495be0a3551b1a20c3fd07b46796fedaed2 (patch)
tree38d2c598a5a1e7ddb029ddb0aef29217bcd7542c
parentef035484ce2954ce359e1e662c089e0410b95f42 (diff)
Switch from FE_TOWARDZERO to _FPU_FPCR_RM_MASK
-rw-r--r--libc/ports/ChangeLog.aarch64.linaro7
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/get-rounding-mode.h2
-rw-r--r--libc/ports/sysdeps/aarch64/fpu/math_private.h10
3 files changed, 13 insertions, 6 deletions
diff --git a/libc/ports/ChangeLog.aarch64.linaro b/libc/ports/ChangeLog.aarch64.linaro
index 8484008ce..d33ffca2d 100644
--- a/libc/ports/ChangeLog.aarch64.linaro
+++ b/libc/ports/ChangeLog.aarch64.linaro
@@ -1,5 +1,12 @@
2014-06-03 Wilco <wdijkstr@arm.com>
+ * sysdeps/aarch64/fpu/math_private.h (libc_fesetround_aarch64)
+ (libc_feholdexcept_setround_aarch64) (libc_feholdsetround_aarch64)
+ (libc_feresetround_aarch64) (libc_feholdsetround_aarch64_ctx):
+ Use _FPU_FPCR_RM_MASK for rounding mask rather than FE_TOWARDZERO.
+ * sysdeps/aarch64/fpu/get-rounding-mode.h (get_rounding_mode):
+ Likewise.
+
* sysdeps/aarch64/fpu/math_private.h
(libc_feholdexcept_aarch64) (libc_feholdexcept_setround_aarch64)
(libc_fetestexcept_aarch64) (libc_fesetenv_aarch64)
diff --git a/libc/ports/sysdeps/aarch64/fpu/get-rounding-mode.h b/libc/ports/sysdeps/aarch64/fpu/get-rounding-mode.h
index 5c1615d04..425b50ec5 100644
--- a/libc/ports/sysdeps/aarch64/fpu/get-rounding-mode.h
+++ b/libc/ports/sysdeps/aarch64/fpu/get-rounding-mode.h
@@ -32,7 +32,7 @@ get_rounding_mode (void)
fpu_control_t fpcr;
_FPU_GETCW (fpcr);
- return fpcr & FE_TOWARDZERO;
+ return fpcr & _FPU_FPCR_RM_MASK;
}
#endif /* get-rounding-mode.h */
diff --git a/libc/ports/sysdeps/aarch64/fpu/math_private.h b/libc/ports/sysdeps/aarch64/fpu/math_private.h
index a3f466be2..023c9d05a 100644
--- a/libc/ports/sysdeps/aarch64/fpu/math_private.h
+++ b/libc/ports/sysdeps/aarch64/fpu/math_private.h
@@ -58,7 +58,7 @@ libc_fesetround_aarch64 (int round)
_FPU_GETCW (fpcr);
/* Check whether rounding modes are different. */
- round = (fpcr ^ round) & FE_TOWARDZERO;
+ round = (fpcr ^ round) & _FPU_FPCR_RM_MASK;
/* Set new rounding mode if different. */
if (__glibc_unlikely (round != 0))
@@ -84,7 +84,7 @@ libc_feholdexcept_setround_aarch64 (fenv_t *envp, int round)
/* Clear exception flags, set all exceptions to non-stop,
and set new rounding mode. */
- new_fpcr = fpcr & ~((FE_ALL_EXCEPT << FE_EXCEPT_SHIFT) | FE_TOWARDZERO);
+ new_fpcr = fpcr & ~((FE_ALL_EXCEPT << FE_EXCEPT_SHIFT) | _FPU_FPCR_RM_MASK);
new_fpcr |= round;
new_fpsr = fpsr & ~FE_ALL_EXCEPT;
@@ -190,7 +190,7 @@ libc_feholdsetround_aarch64 (fenv_t *envp, int round)
envp->__fpsr = fpsr;
/* Check whether rounding modes are different. */
- round = (fpcr ^ round) & FE_TOWARDZERO;
+ round = (fpcr ^ round) & _FPU_FPCR_RM_MASK;
/* Set new rounding mode if different. */
if (__glibc_unlikely (round != 0))
@@ -210,7 +210,7 @@ libc_feresetround_aarch64 (fenv_t *envp)
_FPU_GETCW (fpcr);
/* Check whether rounding modes are different. */
- round = (envp->__fpcr ^ fpcr) & FE_TOWARDZERO;
+ round = (envp->__fpcr ^ fpcr) & _FPU_FPCR_RM_MASK;
/* Restore the rounding mode if it was changed. */
if (__glibc_unlikely (round != 0))
@@ -236,7 +236,7 @@ libc_feholdsetround_aarch64_ctx (struct rm_ctx *ctx, int r)
ctx->env.__fpsr = fpsr;
/* Check whether rounding modes are different. */
- round = (fpcr ^ r) & FE_TOWARDZERO;
+ round = (fpcr ^ r) & _FPU_FPCR_RM_MASK;
ctx->updated_status = round != 0;
/* Set the rounding mode if changed. */