Port-vax archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Libgcc and missing complex support routines
On Sat, Sep 19, 2009 at 10:57:40AM +0200, Martin Husemann wrote:
> AFAICT recalc will never be true on vax anyway, since it would only happen
> if isnan() had been true before - so maybe we should just #ifndef $SOMETHING
> that whole code block, and re-enable the functions?
This patch seems to work...
Martin
Index: gnu/lib/libgcc4/Makefile.inc
===================================================================
RCS file: /cvsroot/src/gnu/lib/libgcc4/Makefile.inc,v
retrieving revision 1.13
diff -c -u -p -r1.13 Makefile.inc
--- gnu/lib/libgcc4/Makefile.inc 18 Sep 2008 12:20:19 -0000 1.13
+++ gnu/lib/libgcc4/Makefile.inc 19 Sep 2009 12:58:55 -0000
@@ -27,10 +27,8 @@ LIB2FUNCS_ALL= _muldi3 _negdi2 _lshrdi3
_popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2 \
_powixf2 _powitf2 \
-.if ${MACHINE_ARCH} != "vax"
LIB2FUNCS_ALL+= \
_mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 _divxc3 _divtc3
-.endif
LIB2FUNCS_SHORT:=${LIB2FUNCS_ALL}
LIB2_DIVMOD_FUNCS:=${G_LIB2_DIVMOD_FUNCS}
Index: gnu/dist/gcc4/gcc/libgcc2.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/gcc4/gcc/libgcc2.c,v
retrieving revision 1.1.1.3
diff -c -u -p -r1.1.1.3 libgcc2.c
--- gnu/dist/gcc4/gcc/libgcc2.c 11 Jan 2007 02:35:28 -0000 1.1.1.3
+++ gnu/dist/gcc4/gcc/libgcc2.c 19 Sep 2009 12:58:55 -0000
@@ -1618,7 +1618,9 @@ NAME (TYPE x, int m)
#define isfinite(x) __builtin_expect (!isnan((x) - (x)), 1)
#define isinf(x) __builtin_expect (!isnan(x) & !isfinite(x), 0)
+#if MODE_HAS_INFINITIES
#define INFINITY CONCAT2(__builtin_inf, CEXT) ()
+#endif
#define I 1i
/* Helpers to make the following code slightly less gross. */
@@ -1626,7 +1628,9 @@ NAME (TYPE x, int m)
#define FABS CONCAT2(__builtin_fabs, CEXT)
/* Verify that MTYPE matches up with CEXT. */
+#ifdef INFINITY
extern void *compile_type_assert[sizeof(INFINITY) == sizeof(MTYPE) ? 1 : -1];
+#endif
/* Ensure that we've lost any extra precision. */
#if NOTRUNC
@@ -1656,6 +1660,7 @@ CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b,
x = ac - bd;
y = ad + bc;
+#ifdef INFINITY
if (isnan (x) && isnan (y))
{
/* Recover infinities that computed as NaN + iNaN. */
@@ -1697,6 +1702,7 @@ CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b,
y = INFINITY * (a * d + b * c);
}
}
+#endif
return x + I * y;
}
@@ -1731,6 +1737,7 @@ CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b,
/* Recover infinities and zeros that computed as NaN+iNaN; the only cases
are nonzero/zero, infinite/finite, and finite/infinite. */
+#ifdef INFINITY
if (isnan (x) && isnan (y))
{
if (c == 0.0 && d == 0.0 && (!isnan (a) || !isnan (b)))
@@ -1753,11 +1760,12 @@ CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b,
y = 0.0 * (b * c - a * d);
}
}
+#endif
return x + I * y;
}
#endif /* complex divide */
-
+#undef INFINITY
#endif /* all complex float routines */
/* From here on down, the routines use normal data types. */
Home |
Main Index |
Thread Index |
Old Index