public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch/rfc] Add host's floatformat
@ 2004-05-01 12:53 Andrew Cagney
  2004-05-01 13:25 ` DJ Delorie
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Andrew Cagney @ 2004-05-01 12:53 UTC (permalink / raw)
  To: binutils, gdb-patches, dj

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

Hello,

This patch adds the host's floatformat (when known) to floatformat.[hc]. 
  It lets us wack of a heap of bogus code in GDB's configury.

DJ, any comments?  I'll need to double commit.

Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 3139 bytes --]

2004-04-30  Andrew Cagney  <cagney@redhat.com>

	* configure.ac: Define HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT, and
	HOST_LONG_DOUBLE_FORMAT.
	* configure, config.in: Re-generate.
	* floatformat.c (floatformat_float, floatformat_double)
	(floatformat_long_double): 

Index: include/ChangeLog
2004-04-30  Andrew Cagney  <cagney@redhat.com>

	* floatformat.h (floatformat_float, floatformat_double)
	(floatformat_long_double): Declare.

Index: libiberty/configure.ac
===================================================================
RCS file: /cvs/src/src/libiberty/configure.ac,v
retrieving revision 1.6
diff -p -u -r1.6 configure.ac
--- libiberty/configure.ac	26 Apr 2004 18:23:59 -0000	1.6
+++ libiberty/configure.ac	1 May 2004 12:46:58 -0000
@@ -520,6 +520,28 @@ case "${host}" in
 esac
 AC_SUBST(pexecute)
 
+# Figure out which floatformat to use.
+case "${host}" in
+i[34567]86-*-*)
+	host_float_format="&floatformat_ieee_single_little"
+	host_double_format="&floatformat_ieee_double_little"
+	host_long_double_format="&floatformat_i387_ext"
+	;;
+hppa*-*-linux*)
+	host_float_format="&floatformat_ieee_single_big"
+	host_double_format="&floatformat_ieee_double_big"
+	host_long_double_format="&floatformat_ieee_double_big"
+	;;
+*)
+	host_float_format=0
+	host_double_format=0
+	host_long_double_format=0
+	;;
+esac
+AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT,$host_float_format,[Host float floatformat])
+AC_DEFINE_UNQUOTED(HOST_DOUBLE_FORMAT,$host_double_format,[Host double floatformat])
+AC_DEFINE_UNQUOTED(HOST_LONG_DOUBLE_FORMAT,$host_long_double_format,[Host long double floatformat])
+
 libiberty_AC_FUNC_STRNCMP
 
 # Install a library built with a cross compiler in $(tooldir) rather
Index: libiberty/floatformat.c
===================================================================
RCS file: /cvs/src/src/libiberty/floatformat.c,v
retrieving revision 1.12
diff -p -u -r1.12 floatformat.c
--- libiberty/floatformat.c	3 Dec 2003 19:03:29 -0000	1.12
+++ libiberty/floatformat.c	1 May 2004 12:46:58 -0000
@@ -548,6 +548,10 @@ floatformat_is_valid (fmt, from)
   return fmt->is_valid (fmt, from);
 }
 
+/* If non-NULL, the host's floatformat.  */
+const struct floatformat *const floatformat_float = HOST_FLOAT_FORMAT;
+const struct floatformat *const floatformat_double = HOST_DOUBLE_FORMAT;
+const struct floatformat *const floatformat_long_double = HOST_LONG_DOUBLE_FORMAT;
 
 #ifdef IEEE_DEBUG
 
Index: include/floatformat.h
===================================================================
RCS file: /cvs/src/src/include/floatformat.h,v
retrieving revision 1.9
diff -p -u -r1.9 floatformat.h
--- include/floatformat.h	22 Sep 2003 17:41:02 -0000	1.9
+++ include/floatformat.h	1 May 2004 12:47:00 -0000
@@ -130,4 +130,9 @@ floatformat_from_double PARAMS ((const s
 extern int
 floatformat_is_valid PARAMS ((const struct floatformat *fmt, const char *from));
 
+/* If non-NULL, the host's floatformat.  */
+extern const struct floatformat *const floatformat_float;
+extern const struct floatformat *const floatformat_double;
+extern const struct floatformat *const floatformat_long_double;
+
 #endif	/* defined (FLOATFORMAT_H) */

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2004-07-26 21:12 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-01 12:53 [patch/rfc] Add host's floatformat Andrew Cagney
2004-05-01 13:25 ` DJ Delorie
2004-05-01 14:27   ` Andrew Cagney
2004-05-01 14:06 ` Andreas Schwab
2004-05-01 14:34 ` Mark Kettenis
2004-05-01 15:00   ` Andrew Cagney
2004-05-01 17:20 ` Andrew Cagney
2004-05-02 10:04   ` Mark Kettenis
2004-05-02 20:49   ` DJ Delorie
2004-05-02 20:49   ` DJ Delorie
2004-05-03 19:11     ` Andrew Cagney
2004-05-03 22:11       ` DJ Delorie
2004-05-03 22:29         ` Zack Weinberg
2004-05-03 22:34           ` DJ Delorie
2004-07-26 21:12             ` Andrew Cagney
2004-05-03 22:37         ` Andrew Cagney
2004-05-03 22:44           ` DJ Delorie
2004-05-03 23:21             ` Andrew Cagney
2004-05-03 23:48               ` DJ Delorie
2004-05-03 23:58                 ` Zack Weinberg
2004-05-04 14:11                   ` Andrew Cagney
2004-05-05 16:32                 ` Andrew Cagney
2004-05-05 17:05                   ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).