summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-15 08:40:35 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-15 08:40:35 +0000
commit97844b15249cfb7e07cee640649b49e989519ecf (patch)
treed38b91436842cc4c2a0381e5ce0996da9a41ebf4 /libgfortran
parentf242c8940a0e7ed03730abff3782eb256d13252f (diff)
downloadgcc-97844b15249cfb7e07cee640649b49e989519ecf.tar.gz
PR libfortran/21950
* intrinsics/c99_functions.c (scalbn): Provide fallback implementation for scalbn. * c99_protos.h: Prototype for scalbn. * configure.ac: Add check for scalbn. * configure: Regenerate. * config.h.in: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100974 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog18
-rw-r--r--libgfortran/c99_protos.h4
-rw-r--r--libgfortran/config.h.in3
-rwxr-xr-xlibgfortran/configure77
-rw-r--r--libgfortran/configure.ac1
-rw-r--r--libgfortran/intrinsics/c99_functions.c8
6 files changed, 107 insertions, 4 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 6a8905c1ee2..64197060bee 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,13 @@
+2005-06-15 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ PR libfortran/21950
+ * intrinsics/c99_functions.c (scalbn): Provide fallback
+ implementation for scalbn.
+ * c99_protos.h: Prototype for scalbn.
+ * configure.ac: Add check for scalbn.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+
2005-06-14 Thomas Koenig <Thomas.Koenig@online.de>
* intrinsics/eoshift0.c: Removed prototype for eoshift0.
@@ -47,10 +57,10 @@
For complex, call internal_pack_c4 if size==8 and
internal_pack_c8 if size==16.
* runtime/in_unpack_generic.c: For real, integer and logical
- call internal_unpack_4 if size==4 and internal_unpack_8 if
- size==8.
- For complex, call internal_unpack_c4 if size==8 and
- internal_unpack_c8 if size==16.
+ call internal_unpack_4 if size==4 and internal_unpack_8 if
+ size==8.
+ For complex, call internal_unpack_c4 if size==8 and
+ internal_unpack_c8 if size==16.
* generated/in_pack_i4.c: Regenerated.
* generated/in_pack_i8.c: Regenerated.
* generated/in_unpack_i4.c: Regenerated.
diff --git a/libgfortran/c99_protos.h b/libgfortran/c99_protos.h
index 521f205399a..4deb25ceed1 100644
--- a/libgfortran/c99_protos.h
+++ b/libgfortran/c99_protos.h
@@ -89,6 +89,10 @@ extern float logf(float);
extern float log10f(float);
#endif
+#ifndef HAVE_SCALBN
+extern double scalbn(double, int);
+#endif
+
#ifndef HAVE_SCALBNF
extern float scalbnf(float, int);
#endif
diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in
index f1a5628a020..aaf663ecd33 100644
--- a/libgfortran/config.h.in
+++ b/libgfortran/config.h.in
@@ -168,6 +168,9 @@
/* libm includes roundf */
#undef HAVE_ROUNDF
+/* libm includes scalbn */
+#undef HAVE_SCALBN
+
/* libm includes scalbnf */
#undef HAVE_SCALBNF
diff --git a/libgfortran/configure b/libgfortran/configure
index 1bb87b8c036..aaaf9f67ea5 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -9401,6 +9401,83 @@ _ACEOF
fi
+echo "$as_me:$LINENO: checking for scalbn in -lm" >&5
+echo $ECHO_N "checking for scalbn in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_scalbn+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char scalbn ();
+int
+main ()
+{
+scalbn ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_m_scalbn=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_scalbn=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_scalbn" >&5
+echo "${ECHO_T}$ac_cv_lib_m_scalbn" >&6
+if test $ac_cv_lib_m_scalbn = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SCALBN 1
+_ACEOF
+
+fi
+
echo "$as_me:$LINENO: checking for sinf in -lm" >&5
echo $ECHO_N "checking for sinf in -lm... $ECHO_C" >&6
if test "${ac_cv_lib_m_sinf+set}" = set; then
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index efda28009d2..c4c70fbc85c 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -201,6 +201,7 @@ AC_CHECK_LIB([m],[powf],[AC_DEFINE([HAVE_POWF],[1],[libm includes powf])])
AC_CHECK_LIB([m],[round],[AC_DEFINE([HAVE_ROUND],[1],[libm includes round])])
AC_CHECK_LIB([m],[roundf],[AC_DEFINE([HAVE_ROUNDF],[1],[libm includes roundf])])
AC_CHECK_LIB([m],[scalbnf],[AC_DEFINE([HAVE_SCALBNF],[1],[libm includes scalbnf])])
+AC_CHECK_LIB([m],[scalbn],[AC_DEFINE([HAVE_SCALBN],[1],[libm includes scalbn])])
AC_CHECK_LIB([m],[sinf],[AC_DEFINE([HAVE_SINF],[1],[libm includes sinf])])
AC_CHECK_LIB([m],[sinhf],[AC_DEFINE([HAVE_SINHF],[1],[libm includes sinhf])])
AC_CHECK_LIB([m],[sqrtf],[AC_DEFINE([HAVE_SQRTF],[1],[libm includes sqrtf])])
diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c
index 6296904b56d..dfdb71e7427 100644
--- a/libgfortran/intrinsics/c99_functions.c
+++ b/libgfortran/intrinsics/c99_functions.c
@@ -154,6 +154,14 @@ log10f(float x)
}
#endif
+#ifndef HAVE_SCALBN
+double
+scalbn(double x, int y)
+{
+ return x * pow(FLT_RADIX, y);
+}
+#endif
+
#ifndef HAVE_SCALBNF
float
scalbnf(float x, int y)