OSDN Git Service

PR libfortran/21950
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jun 2005 08:40:35 +0000 (08:40 +0000)
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jun 2005 08:40:35 +0000 (08:40 +0000)
* 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

libgfortran/ChangeLog
libgfortran/c99_protos.h
libgfortran/config.h.in
libgfortran/configure
libgfortran/configure.ac
libgfortran/intrinsics/c99_functions.c

index 6a8905c..6419706 100644 (file)
@@ -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.
        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.
index 521f205..4deb25c 100644 (file)
@@ -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
index f1a5628..aaf663e 100644 (file)
 /* libm includes roundf */
 #undef HAVE_ROUNDF
 
+/* libm includes scalbn */
+#undef HAVE_SCALBN
+
 /* libm includes scalbnf */
 #undef HAVE_SCALBNF
 
index 1bb87b8..aaaf9f6 100755 (executable)
@@ -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
index efda280..c4c70fb 100644 (file)
@@ -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])])
index 6296904..dfdb71e 100644 (file)
@@ -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)