summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libgfortran/ChangeLog13
-rw-r--r--libgfortran/generated/rrspacing_r10.c7
-rw-r--r--libgfortran/generated/rrspacing_r16.c7
-rw-r--r--libgfortran/generated/rrspacing_r4.c7
-rw-r--r--libgfortran/generated/rrspacing_r8.c7
-rw-r--r--libgfortran/generated/spacing_r10.c6
-rw-r--r--libgfortran/generated/spacing_r16.c6
-rw-r--r--libgfortran/generated/spacing_r4.c6
-rw-r--r--libgfortran/generated/spacing_r8.c6
-rw-r--r--libgfortran/m4/rrspacing.m47
-rw-r--r--libgfortran/m4/spacing.m46
11 files changed, 68 insertions, 10 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 9adf768d96d..2852bbbaa8f 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,16 @@
+2006-10-13 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * m4/spacing.m4: Use scalbn[f,l] if ldexp[f,l] is unavailable.
+ * m4/rrspacing.m4: Ditto.
+ * generated/spacing_r4.c: Regenerated.
+ * generated/spacing_r8.c: Ditto.
+ * generated/spacing_r10.c: Ditto.
+ * generated/spacing_r16.c: Ditto.
+ * generated/rrspacing_r4.c: Ditto.
+ * generated/rrspacing_r8.c: Ditto.
+ * generated/rrspacing_r10.c: Ditto.
+ * generated/rrspacing_r16.c: Ditto.
+
2006-10-06 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/15441
diff --git a/libgfortran/generated/rrspacing_r10.c b/libgfortran/generated/rrspacing_r10.c
index 315fb1ba26c..2950b71941a 100644
--- a/libgfortran/generated/rrspacing_r10.c
+++ b/libgfortran/generated/rrspacing_r10.c
@@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA. */
#include "libgfortran.h"
-#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FABSL) && defined (HAVE_FREXPL) && defined (HAVE_LDEXPL)
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FABSL) && defined (HAVE_FREXPL)
extern GFC_REAL_10 rrspacing_r10 (GFC_REAL_10 s, int p);
export_proto(rrspacing_r10);
@@ -47,7 +47,12 @@ rrspacing_r10 (GFC_REAL_10 s, int p)
if (x == 0.)
return 0.;
frexpl (s, &e);
+#if defined (HAVE_LDEXPL)
return ldexpl (x, p - e);
+#else
+ return scalbnl (x, p - e);
+#endif
+
}
#endif
diff --git a/libgfortran/generated/rrspacing_r16.c b/libgfortran/generated/rrspacing_r16.c
index d18a9c3fea4..20225d45bae 100644
--- a/libgfortran/generated/rrspacing_r16.c
+++ b/libgfortran/generated/rrspacing_r16.c
@@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA. */
#include "libgfortran.h"
-#if defined (HAVE_GFC_REAL_16) && defined (HAVE_FABSL) && defined (HAVE_FREXPL) && defined (HAVE_LDEXPL)
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_FABSL) && defined (HAVE_FREXPL)
extern GFC_REAL_16 rrspacing_r16 (GFC_REAL_16 s, int p);
export_proto(rrspacing_r16);
@@ -47,7 +47,12 @@ rrspacing_r16 (GFC_REAL_16 s, int p)
if (x == 0.)
return 0.;
frexpl (s, &e);
+#if defined (HAVE_LDEXPL)
return ldexpl (x, p - e);
+#else
+ return scalbnl (x, p - e);
+#endif
+
}
#endif
diff --git a/libgfortran/generated/rrspacing_r4.c b/libgfortran/generated/rrspacing_r4.c
index 0c7d1828e6d..89be40b1a1c 100644
--- a/libgfortran/generated/rrspacing_r4.c
+++ b/libgfortran/generated/rrspacing_r4.c
@@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA. */
#include "libgfortran.h"
-#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FABSF) && defined (HAVE_FREXPF) && defined (HAVE_LDEXPF)
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FABSF) && defined (HAVE_FREXPF)
extern GFC_REAL_4 rrspacing_r4 (GFC_REAL_4 s, int p);
export_proto(rrspacing_r4);
@@ -47,7 +47,12 @@ rrspacing_r4 (GFC_REAL_4 s, int p)
if (x == 0.)
return 0.;
frexpf (s, &e);
+#if defined (HAVE_LDEXPF)
return ldexpf (x, p - e);
+#else
+ return scalbnf (x, p - e);
+#endif
+
}
#endif
diff --git a/libgfortran/generated/rrspacing_r8.c b/libgfortran/generated/rrspacing_r8.c
index 3969f66941c..9dc87381de1 100644
--- a/libgfortran/generated/rrspacing_r8.c
+++ b/libgfortran/generated/rrspacing_r8.c
@@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA. */
#include "libgfortran.h"
-#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FABS) && defined (HAVE_FREXP) && defined (HAVE_LDEXP)
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FABS) && defined (HAVE_FREXP)
extern GFC_REAL_8 rrspacing_r8 (GFC_REAL_8 s, int p);
export_proto(rrspacing_r8);
@@ -47,7 +47,12 @@ rrspacing_r8 (GFC_REAL_8 s, int p)
if (x == 0.)
return 0.;
frexp (s, &e);
+#if defined (HAVE_LDEXP)
return ldexp (x, p - e);
+#else
+ return scalbn (x, p - e);
+#endif
+
}
#endif
diff --git a/libgfortran/generated/spacing_r10.c b/libgfortran/generated/spacing_r10.c
index fd11ab65964..797920c60c3 100644
--- a/libgfortran/generated/spacing_r10.c
+++ b/libgfortran/generated/spacing_r10.c
@@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA. */
#include "libgfortran.h"
-#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FREXPL) && defined (HAVE_LDEXPL)
+#if defined (HAVE_GFC_REAL_10) && defined (HAVE_FREXPL)
extern GFC_REAL_10 spacing_r10 (GFC_REAL_10 s, int p, int emin, GFC_REAL_10 tiny);
export_proto(spacing_r10);
@@ -47,7 +47,11 @@ spacing_r10 (GFC_REAL_10 s, int p, int emin, GFC_REAL_10 tiny)
frexpl (s, &e);
e = e - p;
e = e > emin ? e : emin;
+#if defined (HAVE_LDEXPL)
return ldexpl (1., e);
+#else
+ return scalbnl (1., e);
+#endif
}
#endif
diff --git a/libgfortran/generated/spacing_r16.c b/libgfortran/generated/spacing_r16.c
index 333221a4b2e..c13e9b11882 100644
--- a/libgfortran/generated/spacing_r16.c
+++ b/libgfortran/generated/spacing_r16.c
@@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA. */
#include "libgfortran.h"
-#if defined (HAVE_GFC_REAL_16) && defined (HAVE_FREXPL) && defined (HAVE_LDEXPL)
+#if defined (HAVE_GFC_REAL_16) && defined (HAVE_FREXPL)
extern GFC_REAL_16 spacing_r16 (GFC_REAL_16 s, int p, int emin, GFC_REAL_16 tiny);
export_proto(spacing_r16);
@@ -47,7 +47,11 @@ spacing_r16 (GFC_REAL_16 s, int p, int emin, GFC_REAL_16 tiny)
frexpl (s, &e);
e = e - p;
e = e > emin ? e : emin;
+#if defined (HAVE_LDEXPL)
return ldexpl (1., e);
+#else
+ return scalbnl (1., e);
+#endif
}
#endif
diff --git a/libgfortran/generated/spacing_r4.c b/libgfortran/generated/spacing_r4.c
index 41cc72e9b2d..1e09e1106c4 100644
--- a/libgfortran/generated/spacing_r4.c
+++ b/libgfortran/generated/spacing_r4.c
@@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA. */
#include "libgfortran.h"
-#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF) && defined (HAVE_LDEXPF)
+#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF)
extern GFC_REAL_4 spacing_r4 (GFC_REAL_4 s, int p, int emin, GFC_REAL_4 tiny);
export_proto(spacing_r4);
@@ -47,7 +47,11 @@ spacing_r4 (GFC_REAL_4 s, int p, int emin, GFC_REAL_4 tiny)
frexpf (s, &e);
e = e - p;
e = e > emin ? e : emin;
+#if defined (HAVE_LDEXPF)
return ldexpf (1., e);
+#else
+ return scalbnf (1., e);
+#endif
}
#endif
diff --git a/libgfortran/generated/spacing_r8.c b/libgfortran/generated/spacing_r8.c
index 0f925217e42..cde5d96f1fd 100644
--- a/libgfortran/generated/spacing_r8.c
+++ b/libgfortran/generated/spacing_r8.c
@@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA. */
#include "libgfortran.h"
-#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FREXP) && defined (HAVE_LDEXP)
+#if defined (HAVE_GFC_REAL_8) && defined (HAVE_FREXP)
extern GFC_REAL_8 spacing_r8 (GFC_REAL_8 s, int p, int emin, GFC_REAL_8 tiny);
export_proto(spacing_r8);
@@ -47,7 +47,11 @@ spacing_r8 (GFC_REAL_8 s, int p, int emin, GFC_REAL_8 tiny)
frexp (s, &e);
e = e - p;
e = e > emin ? e : emin;
+#if defined (HAVE_LDEXP)
return ldexp (1., e);
+#else
+ return scalbn (1., e);
+#endif
}
#endif
diff --git a/libgfortran/m4/rrspacing.m4 b/libgfortran/m4/rrspacing.m4
index 6b3ccd55ec1..34ff98eb698 100644
--- a/libgfortran/m4/rrspacing.m4
+++ b/libgfortran/m4/rrspacing.m4
@@ -34,7 +34,7 @@ Boston, MA 02110-1301, USA. */
include(`mtype.m4')dnl
-`#if defined (HAVE_'real_type`) && defined (HAVE_FABS'Q`) && defined (HAVE_FREXP'Q`) && defined (HAVE_LDEXP'Q`)'
+`#if defined (HAVE_'real_type`) && defined (HAVE_FABS'Q`) && defined (HAVE_FREXP'Q`)'
extern real_type rrspacing_r`'kind (real_type s, int p);
export_proto(rrspacing_r`'kind);
@@ -48,7 +48,12 @@ rrspacing_r`'kind (real_type s, int p)
if (x == 0.)
return 0.;
frexp`'q (s, &e);
+`#if defined (HAVE_LDEXP'Q`)'
return ldexp`'q (x, p - e);
+#else
+ return scalbn`'q (x, p - e);
+#endif
+
}
#endif
diff --git a/libgfortran/m4/spacing.m4 b/libgfortran/m4/spacing.m4
index 4aa4e19250f..77b7a38e550 100644
--- a/libgfortran/m4/spacing.m4
+++ b/libgfortran/m4/spacing.m4
@@ -34,7 +34,7 @@ Boston, MA 02110-1301, USA. */
include(`mtype.m4')dnl
-`#if defined (HAVE_'real_type`) && defined (HAVE_FREXP'Q`) && defined (HAVE_LDEXP'Q`)'
+`#if defined (HAVE_'real_type`) && defined (HAVE_FREXP'Q`)'
extern real_type spacing_r`'kind (real_type s, int p, int emin, real_type tiny);
export_proto(spacing_r`'kind);
@@ -48,7 +48,11 @@ spacing_r`'kind (real_type s, int p, int emin, real_type tiny)
frexp`'q (s, &e);
e = e - p;
e = e > emin ? e : emin;
+`#if defined (HAVE_LDEXP'Q`)'
return ldexp`'q (1., e);
+#else
+ return scalbn`'q (1., e);
+#endif
}
#endif