about summary refs log tree commit diff
path: root/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-05-27 21:02:14 -0700
committerDavid S. Miller <davem@davemloft.net>2012-05-27 21:11:42 -0700
commitd66ef399f5a9e1656fe8e435a8fa655cf271b676 (patch)
treefa8fa1a3d009ccbac649f4587ede51c4e2d0b871 /sysdeps/sparc/sparc32/soft-fp/sfp-machine.h
parent04fb54b50745587b5bfb7baff66ac9f69ac92db9 (diff)
downloadglibc-d66ef399f5a9e1656fe8e435a8fa655cf271b676.tar.gz
glibc-d66ef399f5a9e1656fe8e435a8fa655cf271b676.tar.xz
glibc-d66ef399f5a9e1656fe8e435a8fa655cf271b676.zip
Fix underflow reporting and tie up loose ends in sparc soft-fp.
	* sysdeps/sparc/sparc32/soft-fp/q_util.c (___Q_numbers): Delete.
	(___Q_zero): New.
	(__Q_simulate_exceptions): Return void.  Change to simulate
	exceptions by writing into the %fsr.
	* sysdeps/sparc/sparc64/soft-fp/qp_util.c
	(__Qp_handle_exceptions): Likewise.
	(numbers): Delete.
	* sysdeps/sparc/sparc64/soft-fp/Versions: Remove entry for
	__Qp_handle_exceptions.
	* sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist: Remove
	__Qp_handle_exceptions.
	* sysdeps/sparc/sparc32/soft-fp/sfp-machine.h (_FP_DECL_EX): Mark
	as unused and give dummy FP_RND_NEAREST initializer.
	(FP_INHIBIT_RESULTS): Define.
	(___Q_simulate_exceptions): Update declaration.
	(FP_HANDLE_EXCEPTIONS): Use ___Q_zero and tidy inline asm
	formatting.
	* sysdeps/sparc/sparc64/soft-fp/sfp-machine.h (_FP_DECL_EX): Mark
	as unused and give dummy FP_RND_NEAREST initializer.
	(__Qp_handle_exceptions): Update declaration.
	(FP_HANDLE_EXCEPTIONS, QP_NO_EXCEPTIONS): Tidy inline asm
	formatting.
Diffstat (limited to 'sysdeps/sparc/sparc32/soft-fp/sfp-machine.h')
-rw-r--r--sysdeps/sparc/sparc32/soft-fp/sfp-machine.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h b/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h
index 8cdc7c2677..4314082f70 100644
--- a/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h
+++ b/sysdeps/sparc/sparc32/soft-fp/sfp-machine.h
@@ -184,15 +184,18 @@
 #define FP_EX_DIVZERO		(1 << 1)
 #define FP_EX_INEXACT		(1 << 0)
 
-#define _FP_DECL_EX	fpu_control_t _fcw
+#define _FP_DECL_EX \
+  fpu_control_t _fcw __attribute__ ((unused)) = (FP_RND_NEAREST << 30)
 
 #define FP_INIT_ROUNDMODE					\
 do {								\
   _FPU_GETCW(_fcw);						\
 } while (0)
 
+#define FP_INHIBIT_RESULTS ((_fcw >> 23) & _fex)
+
 /* Simulate exceptions using double arithmetics. */
-extern double ___Q_simulate_exceptions(int exc);
+extern void ___Q_simulate_exceptions(int exc);
 
 #define FP_HANDLE_EXCEPTIONS					\
 do {								\
@@ -201,11 +204,10 @@ do {								\
       /* This is the common case, so we do it inline.		\
        * We need to clear cexc bits if any.			\
        */							\
-      extern unsigned long long ___Q_numbers[];			\
-      __asm__ __volatile__("\
-      	ldd [%0], %%f30\n\
-      	faddd %%f30, %%f30, %%f30\
-      	" : : "r" (___Q_numbers) : "f30");			\
+      extern unsigned long long ___Q_zero;			\
+      __asm__ __volatile__("ldd [%0], %%f30\n\t"		\
+			   "faddd %%f30, %%f30, %%f30"		\
+			   : : "r" (&___Q_zero) : "f30");	\
     }								\
   else								\
     ___Q_simulate_exceptions (_fex);			        \