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]

soft-fp: remove unused macros


As noted in
<https://sourceware.org/ml/libc-alpha/2013-10/msg00338.html>, the
soft-fp macro _FP_DIV_MEAT_2_gmp is both unused (in glibc, libgcc and
the Linux kernel) and bogus (would never have worked correctly).
Thus, it seems appropriate to remove.  FP_UNSET_EXCEPTION is also
unused in all three places; although the definition is perfectly
valid, there seems to be no point in it (I think that if soft-fp code
tries to set an exception and then later clear it, that indicates
there's something wrong with that code - the same applies to
FP_CLEAR_EXCEPTIONS, but that's still used at present in four sparc32
files that should be able to define FP_NO_EXCEPTIONS and remove all
the present exception-related code).

This patch removes those two unused macros.  Tested for powerpc-nofpu
that there's no change to libc/libm disassembly, and committed.

2013-10-15  Joseph Myers  <joseph@codesourcery.com>

	* soft-fp/op-2.h (_FP_DIV_MEAT_2_gmp): Remove macro.
	* soft-fp/soft-fp.h (FP_UNSET_EXCEPTION): Likewise.

diff --git a/soft-fp/op-2.h b/soft-fp/op-2.h
index 1cbc1fe..0704035 100644
--- a/soft-fp/op-2.h
+++ b/soft-fp/op-2.h
@@ -574,36 +574,6 @@
   while (0)
 
 
-#define _FP_DIV_MEAT_2_gmp(fs, R, X, Y)					\
-  do									\
-    {									\
-      _FP_W_TYPE _x[4], _y[2], _z[4];					\
-      _y[0] = Y##_f0;							\
-      _y[1] = Y##_f1;							\
-      _x[0] = _x[3] = 0;						\
-      if (_FP_FRAC_GE_2(X, Y))						\
-	{								\
-	  _x[1] = (X##_f0 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE)	\
-		   | X##_f1 >> (_FP_W_TYPE_SIZE -			\
-				(_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE))); \
-	  _x[2] = X##_f1 << (_FP_WFRACBITS_##fs-1 - _FP_W_TYPE_SIZE);	\
-	}								\
-      else								\
-	{								\
-	  R##_e--;							\
-	  _x[1] = (X##_f0 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE)	\
-		   | X##_f1 >> (_FP_W_TYPE_SIZE -			\
-				(_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE))); \
-	  _x[2] = X##_f1 << (_FP_WFRACBITS_##fs - _FP_W_TYPE_SIZE);	\
-	}								\
-									\
-      (void) mpn_divrem (_z, 0, _x, 4, _y, 2);				\
-      R##_f1 = _z[1];							\
-      R##_f0 = _z[0] | ((_x[0] | _x[1]) != 0);				\
-    }									\
-  while (0)
-
-
 /*
  * Square root algorithms:
  * We have just one right now, maybe Newton approximation
diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h
index b3f4c30..02a1a27 100644
--- a/soft-fp/soft-fp.h
+++ b/soft-fp/soft-fp.h
@@ -129,9 +129,6 @@
 #define FP_SET_EXCEPTION(ex)				\
   _fex |= (ex)
 
-#define FP_UNSET_EXCEPTION(ex)				\
-  _fex &= ~(ex)
-
 #define FP_CLEAR_EXCEPTIONS				\
   _fex = 0
 

-- 
Joseph S. Myers
joseph@codesourcery.com


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