2004-07-29 Andrew Cagney <cagney@gnu.org>
authorAndrew Cagney <cagney@redhat.com>
Thu, 29 Jul 2004 19:33:22 +0000 (19:33 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 29 Jul 2004 19:33:22 +0000 (19:33 +0000)
* config/pa/xm-linux.h: Do not include "floatformat.h".
(HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
(HOST_LONG_DOUBLE_FORMAT): Delete macros.
* config/i386/xm-i386.h: Do not include "floatformat.h".
(HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
(HOST_LONG_DOUBLE_FORMAT): Delete macros.
* doublest.c (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
(HOST_LONG_DOUBLE_FORMAT): Delete macros.  Use
GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT and
GDB_HOST_LONG_DOUBLE_FORMAT instead.
* configure.in (GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT)
(GDB_HOST_LONG_DOUBLE_FORMAT): Define.
* configure, config.in: Regenerate.
* configure.host (gdb_host_float_format, gdb_host_double_format)
(gdb_host_long_double_format): Set according to the host.

gdb/ChangeLog
gdb/config.in
gdb/config/i386/xm-i386.h
gdb/config/pa/xm-linux.h
gdb/configure
gdb/configure.host
gdb/configure.in
gdb/doublest.c

index 8269d72def5ce9f25af4e623bc70a7134653f7ee..c71f2e9b7cf25fc858c5be302d39ce3fc38388cd 100644 (file)
@@ -1,3 +1,21 @@
+2004-07-29  Andrew Cagney  <cagney@gnu.org>
+
+       * config/pa/xm-linux.h: Do not include "floatformat.h".
+       (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
+       (HOST_LONG_DOUBLE_FORMAT): Delete macros.
+       * config/i386/xm-i386.h: Do not include "floatformat.h".
+       (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT) 
+       (HOST_LONG_DOUBLE_FORMAT): Delete macros.
+       * doublest.c (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
+       (HOST_LONG_DOUBLE_FORMAT): Delete macros.  Use
+       GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT and
+       GDB_HOST_LONG_DOUBLE_FORMAT instead.
+       * configure.in (GDB_HOST_FLOAT_FORMAT, GDB_HOST_DOUBLE_FORMAT)
+       (GDB_HOST_LONG_DOUBLE_FORMAT): Define.
+       * configure, config.in: Regenerate.     
+       * configure.host (gdb_host_float_format, gdb_host_double_format)
+       (gdb_host_long_double_format): Set according to the host.
+       
 2004-07-29  Andrew Cagney  <cagney@gnu.org>
 
        * Makefile.in (CONFIG_CLEAN): Delete duplicate definition.
index 7da90384fb83c0a2777d8b35ac2f18a91dae1a2d..933f3a02310ce8ee17465b8c6fd4224f3fe363e1 100644 (file)
 /* Define if we can use the tkill syscall. */
 #undef HAVE_TKILL_SYSCALL
 
+/* Host float floatformat */
+#undef GDB_HOST_FLOAT_FORMAT
+
+/* Host double floatformat */
+#undef GDB_HOST_DOUBLE_FORMAT
+
+/* Host long double floatformat */
+#undef GDB_HOST_LONG_DOUBLE_FORMAT
+
 /* Define to the default OS ABI for this configuration. */
 #undef GDB_OSABI_DEFAULT
 
index de29b26599822290c743f135afb0e66091d3fedf..e4ba146862103e3b248e3a2f90066e9ba2eec076 100644 (file)
 #ifndef XM_I386_H
 #define XM_I386_H
 
-#include "floatformat.h"
-
-#define HOST_FLOAT_FORMAT &floatformat_ieee_single_little
-#define HOST_DOUBLE_FORMAT &floatformat_ieee_double_little
-#define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
-
 #endif /* xm-i386.h */
index ceb6ed2cae53da2a5dd3d5f04e10cdee01975973..81847bed7bab20fab0a1059f8981bef24f5d292b 100644 (file)
 #ifndef XM_HPPA_LINUX_H
 #define XM_HPPA_LINUX_H
 
-#include "floatformat.h"
-
-#define HOST_FLOAT_FORMAT &floatformat_ieee_single_big
-#define HOST_DOUBLE_FORMAT &floatformat_ieee_double_big
-#define HOST_LONG_DOUBLE_FORMAT &floatformat_ieee_double_big
-
 #endif /* xm-linux.h */
index 8b7d2a94fca30dcd53e49acc9f2c22c446437c44..d56de71b03652e8c0790bb1f2eb4316710fd8470 100755 (executable)
 
 
 
+# List of host floatformats.
+cat >> confdefs.h <<EOF
+#define GDB_HOST_FLOAT_FORMAT $gdb_host_float_format
+EOF
+
+cat >> confdefs.h <<EOF
+#define GDB_HOST_DOUBLE_FORMAT $gdb_host_double_format
+EOF
+
+cat >> confdefs.h <<EOF
+#define GDB_HOST_LONG_DOUBLE_FORMAT $gdb_host_long_double_format
+EOF
+
+
 # target_subdir is used by the testsuite to find the target libraries.
 target_subdir=
 if test "${host}" != "${target}"; then
@@ -10636,7 +10650,7 @@ fi
 # We only build gdbserver automatically if host and target are the same.
 if test "x$target" = "x$host"; then
   echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6
-echo "configure:10640: checking whether gdbserver is supported on this host" >&5
+echo "configure:10654: checking whether gdbserver is supported on this host" >&5
   if test "x$build_gdbserver" = xyes; then
     configdirs="$configdirs gdbserver"
     echo "$ac_t""yes" 1>&6
 
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:10704: checking for Cygwin environment" >&5
+echo "configure:10718: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10709 "configure"
+#line 10723 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -10716,7 +10730,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:10720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -10733,19 +10747,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:10737: checking for mingw32 environment" >&5
+echo "configure:10751: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10742 "configure"
+#line 10756 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:10749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -10764,7 +10778,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:10768: checking for executable suffix" >&5
+echo "configure:10782: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10774,10 +10788,10 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:10778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:10792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
-      *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;;
+      *.c | *.o | *.obj | *.ilk | *.pdb) ;;
       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
       esac
     done
@@ -10816,7 +10830,7 @@ fi
 
 
   echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:10820: checking for iconv" >&5
+echo "configure:10834: checking for iconv" >&5
 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10824,7 +10838,7 @@ else
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
     cat > conftest.$ac_ext <<EOF
-#line 10828 "configure"
+#line 10842 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -10834,7 +10848,7 @@ iconv_t cd = iconv_open("","");
        iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:10838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_func_iconv=yes
 else
@@ -10846,7 +10860,7 @@ rm -f conftest*
       am_save_LIBS="$LIBS"
       LIBS="$LIBS -liconv"
       cat > conftest.$ac_ext <<EOF
-#line 10850 "configure"
+#line 10864 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -10856,7 +10870,7 @@ iconv_t cd = iconv_open("","");
          iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:10860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_lib_iconv=yes
         am_cv_func_iconv=yes
@@ -10877,13 +10891,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
 EOF
 
     echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:10881: checking for iconv declaration" >&5
+echo "configure:10895: checking for iconv declaration" >&5
     if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
       cat > conftest.$ac_ext <<EOF
-#line 10887 "configure"
+#line 10901 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -10902,7 +10916,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:10906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_proto_iconv_arg1=""
 else
index a2a8d5d36a05ab7df7895c8c0f41967eaa0990cb..71436bf8912d05e0779df083e5b4a7546fe2fc81 100644 (file)
@@ -2,8 +2,11 @@
 # invoked from the autoconf generated configure script.
 
 # This file sets the following shell variables:
-#  gdb_host_cpu                generic name of host's CPU
-#  gdb_host            name of GDB host definition to use
+#  gdb_host_cpu                        generic name of host's CPU
+#  gdb_host                    name of GDB host definition to use
+#  gdb_host_float_format       host's float floatformat, or 0
+#  gdb_host_double_format      host's double floatformat, or 0
+#  gdb_host_long_double_format host's long double floatformat, or 0
 
 # Map host cpu into the config cpu subdirectory name.
 # The default is $host_cpu.
@@ -145,3 +148,26 @@ x86_64-*-openbsd*) gdb_host=obsd64 ;;
 m32r*-*-linux*)          gdb_host=linux ;;
 
 esac
+
+
+
+# Map the host/cpu onto the floatformat correspondong to C's "float",
+# "double" and "long double" types.
+
+case "${host}" in
+i[34567]86-*-*)
+       gdb_host_float_format="&floatformat_ieee_single_little"
+       gdb_host_double_format="&floatformat_ieee_double_little"
+       gdb_host_long_double_format="&floatformat_i387_ext"
+       ;;
+hppa*-*-linux*)
+       gdb_host_float_format="&floatformat_ieee_single_big"
+       gdb_host_double_format="&floatformat_ieee_double_big"
+       gdb_host_long_double_format="&floatformat_ieee_double_big"
+       ;;
+*)
+       gdb_host_float_format=0
+       gdb_host_double_format=0
+       gdb_host_long_double_format=0
+       ;;
+esac
index ef5f17a73c0ad230c644dbc10e84b8551005677c..f5f3e98c90acb8cd32b775caf555bfd0426d7aa9 100644 (file)
@@ -1300,6 +1300,11 @@ AC_SUBST(CONFIG_CLEAN)
 AC_SUBST(CONFIG_INSTALL)
 AC_SUBST(CONFIG_UNINSTALL)
 
+# List of host floatformats.
+AC_DEFINE_UNQUOTED(GDB_HOST_FLOAT_FORMAT,$gdb_host_float_format,[Host float floatformat])
+AC_DEFINE_UNQUOTED(GDB_HOST_DOUBLE_FORMAT,$gdb_host_double_format,[Host double floatformat])
+AC_DEFINE_UNQUOTED(GDB_HOST_LONG_DOUBLE_FORMAT,$gdb_host_long_double_format,[Host long double floatformat])
+
 # target_subdir is used by the testsuite to find the target libraries.
 target_subdir=
 if test "${host}" != "${target}"; then
index 3f283e13ffa55842eba72b08a4515b52fe0ca38e..10f4dfba14cb6a4c060c93f4ae0067cf06abee8f 100644 (file)
@@ -91,10 +91,17 @@ get_field (unsigned char *data, enum floatformat_byteorders order,
     {
       result |= (unsigned long)*(data + cur_byte) << cur_bitshift;
       cur_bitshift += FLOATFORMAT_CHAR_BIT;
-      if (order == floatformat_little || order == floatformat_littlebyte_bigword)
-       ++cur_byte;
-      else
-       --cur_byte;
+      switch (order)
+       {
+       case floatformat_little:
+         ++cur_byte;
+         break;
+       case floatformat_big:
+         --cur_byte;
+         break;
+       case floatformat_littlebyte_bigword:
+         break;
+       }
     }
   if (len < sizeof(result) * FLOATFORMAT_CHAR_BIT)
     /* Mask out bits which are not part of the field */
@@ -554,19 +561,9 @@ floatformat_mantissa (const struct floatformat *fmt, char *val)
    increase precision as necessary.  Otherwise, we call the conversion
    routine and let it do the dirty work.  */
 
-#ifndef HOST_FLOAT_FORMAT
-#define HOST_FLOAT_FORMAT 0
-#endif
-#ifndef HOST_DOUBLE_FORMAT
-#define HOST_DOUBLE_FORMAT 0
-#endif
-#ifndef HOST_LONG_DOUBLE_FORMAT
-#define HOST_LONG_DOUBLE_FORMAT 0
-#endif
-
-static const struct floatformat *host_float_format = HOST_FLOAT_FORMAT;
-static const struct floatformat *host_double_format = HOST_DOUBLE_FORMAT;
-static const struct floatformat *host_long_double_format = HOST_LONG_DOUBLE_FORMAT;
+static const struct floatformat *host_float_format = GDB_HOST_FLOAT_FORMAT;
+static const struct floatformat *host_double_format = GDB_HOST_DOUBLE_FORMAT;
+static const struct floatformat *host_long_double_format = GDB_HOST_LONG_DOUBLE_FORMAT;
 
 void
 floatformat_to_doublest (const struct floatformat *fmt,
This page took 0.043474 seconds and 4 git commands to generate.