about summary refs log tree commit diff
path: root/math
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-25 19:54:39 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-25 19:54:39 +0000
commite7c3d12bc25e5dae1ca3617097fb3ee867f18855 (patch)
tree3dda7cb9fc5cb3ff170bc70974e20656f3af4e7b /math
parent773bd1e1093b716639a40420f9956182c5f89b07 (diff)
downloadglibc-e7c3d12bc25e5dae1ca3617097fb3ee867f18855.tar.gz
glibc-e7c3d12bc25e5dae1ca3617097fb3ee867f18855.tar.xz
glibc-e7c3d12bc25e5dae1ca3617097fb3ee867f18855.zip
Update.
2001-01-25  Jakub Jelinek  <jakub@redhat.com>

	* math/tgmath.h (__TGMATH_BINARY_FIRST_REAL_ONLY,
	__TGMATH_BINARY_REAL_ONLY, __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY,
	__TGMATH_TERNARY_REAL_ONLY): Use proper arguments to
	__builtin_classify_type, add ##f suffixes where appropriate.
	(__TGMATH_UNARY_REAL_IMAG): Remove extraneous left parenthesis.
	(__TGMATH_BINARY_REAL_IMAG): Likewise, use proper arguments to
	__builtin_classify_type.
	(fma): Fix spelling of first argument.
Diffstat (limited to 'math')
-rw-r--r--math/tgmath.h39
1 files changed, 23 insertions, 16 deletions
diff --git a/math/tgmath.h b/math/tgmath.h
index 50d4d428ee..1f19b14058 100644
--- a/math/tgmath.h
+++ b/math/tgmath.h
@@ -71,7 +71,7 @@
 # define __TGMATH_BINARY_FIRST_REAL_ONLY(Val1, Val2, Fct) \
      (__extension__ ({ __tgmath_real_type (Val1) __tgmres;		      \
 		       if (sizeof (Val1) == sizeof (double)		      \
-			   || __builtin_classify_type (Val) != 8)	      \
+			   || __builtin_classify_type (Val1) != 8)	      \
 			 __tgmres = Fct (Val1, Val2);			      \
 		       else if (sizeof (Val1) == sizeof (float))	      \
 			 __tgmres = Fct##f (Val1, Val2);		      \
@@ -83,28 +83,30 @@
      (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres;	      \
 		       if ((sizeof (Val1) > sizeof (double)		      \
 			    || sizeof (Val2) > sizeof (double))		      \
-			   && __builtin_classify_type (Val) == 8)	      \
+			   && __builtin_classify_type ((Val1) + (Val2)) == 8) \
 			 __tgmres = Fct##l (Val1, Val2);		      \
 		       else if (sizeof (Val1) == sizeof (double)	      \
 				|| sizeof (Val2) == sizeof (double)	      \
-				|| __builtin_classify_type (Val) != 8)	      \
+				|| __builtin_classify_type ((Val1)	      \
+							    + (Val2)) != 8)   \
 			 __tgmres = Fct (Val1, Val2);			      \
 		       else						      \
-			 __tgmres = Fct (Val1, Val2);			      \
+			 __tgmres = Fct##f (Val1, Val2);		      \
 		       __tgmres; }))
 
 # define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \
      (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres;	      \
 		       if ((sizeof (Val1) > sizeof (double)		      \
 			    || sizeof (Val2) > sizeof (double))		      \
-			   && __builtin_classify_type (Val) == 8)	      \
+			   && __builtin_classify_type ((Val1) + (Val2)) == 8) \
 			 __tgmres = Fct##l (Val1, Val2, Val3);		      \
 		       else if (sizeof (Val1) == sizeof (double)	      \
 				|| sizeof (Val2) == sizeof (double)	      \
-				|| __builtin_classify_type (Val) != 8)	      \
+				|| __builtin_classify_type ((Val1)	      \
+							    + (Val2)) != 8)   \
 			 __tgmres = Fct (Val1, Val2, Val3);		      \
 		       else						      \
-			 __tgmres = Fct (Val1, Val2, Val3);		      \
+			 __tgmres = Fct##f (Val1, Val2, Val3);		      \
 		       __tgmres; }))
 
 # define __TGMATH_TERNARY_REAL_ONLY(Val1, Val2, Val3, Fct) \
@@ -112,15 +114,17 @@
 		       if ((sizeof (Val1) > sizeof (double)		      \
 			    || sizeof (Val2) > sizeof (double)		      \
 			    || sizeof (Val3) > sizeof (double))		      \
-			   && __builtin_classify_type (Val) == 8)	      \
+			   && __builtin_classify_type ((Val1) + (Val2)	      \
+						       + (Val3)) == 8)	      \
 			 __tgmres = Fct##l (Val1, Val2, Val3);		      \
 		       else if (sizeof (Val1) == sizeof (double)	      \
 				|| sizeof (Val2) == sizeof (double)	      \
 				|| sizeof (Val3) == sizeof (double)	      \
-				|| __builtin_classify_type (Val) != 8)	      \
+				|| __builtin_classify_type ((Val1) + (Val2)   \
+							    + (Val3)) != 8)   \
 			 __tgmres = Fct (Val1, Val2, Val3);		      \
 		       else						      \
-			 __tgmres = Fct (Val1, Val2, Val3);		      \
+			 __tgmres = Fct##f (Val1, Val2, Val3);		      \
 		       __tgmres; }))
 
 /* XXX This definition has to be changed as soon as the compiler understands
@@ -136,8 +140,8 @@
 			     __tgmres = Cfct##l (Val);			      \
 			 }						      \
 		       else if (sizeof (__real__ (Val)) == sizeof (double)    \
-				|| (__builtin_classify_type (__real__ (Val))  \
-				    != 8)				      \
+				|| __builtin_classify_type (__real__ (Val))   \
+				   != 8)				      \
 			 {						      \
 			   if (sizeof (__real__ (Val)) == sizeof (Val))	      \
 			     __tgmres = Fct (Val);			      \
@@ -172,7 +176,9 @@
      (__extension__ ({ __tgmath_real_type ((Val1) + (Val2)) __tgmres;	      \
 		       if ((sizeof (__real__ (Val1)) > sizeof (double)	      \
 			    || sizeof (__real__ (Val2)) > sizeof (double))    \
-			   && __builtin_classify_type (__real__ (Val)) == 8)  \
+			   && __builtin_classify_type (__real__ (Val1)	      \
+						       + __real__ (Val2))     \
+			      == 8)					      \
 			 {						      \
 			   if (sizeof (__real__ (Val1)) == sizeof (Val1)      \
 			       && sizeof (__real__ (Val2)) == sizeof (Val2))  \
@@ -182,8 +188,9 @@
 			 }						      \
 		       else if (sizeof (__real__ (Val1)) == sizeof (double)   \
 				|| sizeof (__real__ (Val2)) == sizeof(double) \
-				|| (__builtin_classify_type (__real__ (Val))  \
-				    != 8)				      \
+				|| __builtin_classify_type (__real__ (Val1)   \
+							    + __real__ (Val2))\
+				   != 8)				      \
 			 {						      \
 			   if (sizeof (__real__ (Val1)) == sizeof (Val1)      \
 			       && sizeof (__real__ (Val2)) == sizeof (Val2))  \
@@ -388,7 +395,7 @@
 
 
 /* Multiply-add function computed as a ternary operation.  */
-#define fma(Vat1, Val2, Val3) \
+#define fma(Val1, Val2, Val3) \
      __TGMATH_TERNARY_REAL_ONLY (Val1, Val2, Val3, fma)