This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 8/13] AArch64: Cleanup fenv implementation


Call libc_feholdexcept_aarch64 from math_private.h rather than duplicating functionality.

ChangeLog:
2014-10-23  Wilco Dijkstra  <wdijkstr@arm.com>

	* sysdeps/aarch64/fpu/feholdexcpt.c (feholdexcept):
	Call libc_feholdexcept_aarch64.

---
 sysdeps/aarch64/fpu/feholdexcpt.c | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

diff --git a/sysdeps/aarch64/fpu/feholdexcpt.c b/sysdeps/aarch64/fpu/feholdexcpt.c
index 5f67a7c..3b898d0 100644
--- a/sysdeps/aarch64/fpu/feholdexcpt.c
+++ b/sysdeps/aarch64/fpu/feholdexcpt.c
@@ -16,35 +16,12 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <fenv.h>
-#include <fpu_control.h>
+#include <math_private.h>
 
 int
 feholdexcept (fenv_t *envp)
 {
-  fpu_control_t fpcr;
-  fpu_control_t fpcr_new;
-  fpu_fpsr_t fpsr;
-  fpu_fpsr_t fpsr_new;
-
-  _FPU_GETCW (fpcr);
-  envp->__fpcr = fpcr;
-
-  _FPU_GETFPSR (fpsr);
-  envp->__fpsr = fpsr;
-
-  /* Now set all exceptions to non-stop.  */
-  fpcr_new = fpcr & ~(FE_ALL_EXCEPT << FE_EXCEPT_SHIFT);
-
-  /* And clear all exception flags.  */
-  fpsr_new = fpsr & ~FE_ALL_EXCEPT;
-
-  if (fpsr != fpsr_new)
-    _FPU_SETFPSR (fpsr_new);
-
-  if (fpcr != fpcr_new)
-    _FPU_SETCW (fpcr_new);
-
+  libc_feholdexcept_aarch64 (envp);
   return 0;
 }
 libm_hidden_def (feholdexcept)
-- 
1.9.1




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]