Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc/rfa(DavidT?)] Move DOUBLEST to doublest.{h,c}
@ 2001-07-16  8:18 Andrew Cagney
  2001-07-29 12:34 ` Andrew Cagney
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Cagney @ 2001-07-16  8:18 UTC (permalink / raw)
  To: gdb-patches

Hello,

(As they say, always have a plan B.  Plan A, reclaim floatformat, failed 
:-).

The attached patch moves all the floating point conversion routines to a 
single place - doublest.[hc].  It doesn't modify the actual code.  It 
updates all the missing include dependencies that I could find.  All the 
  buildable targets listed in the MAINTAINERS file still build.

Look OK?  I note this carves a chunk out of both utils.c and findvar.c

What's next?

I've a follow on patch to introduce two new functions 
extract_floatformat() and store_floatformat().  All th magic currently 
found in extract_floating() and store_floating() would be moved to these 
new functions.  All current calls to floatformat_from_doublest() and 
floatformat_to_doublest() would be replaced by those functions.  The net 
effect would be that all floating point conversions would go through a 
single path and always use the most exact mechanism available.

I've also a second patch to tweek the actual conversion code so that it 
isn't as lossy (use ULONGEST instead of unsigned long).

If anyone ever gets inspired they could then extend doublest.[hc] to 
implement portable floating point (using either gcc/real.c or 
sim/common/sim-fpu.[hc].

	Andrew
From ac131313@cygnus.com Mon Jul 16 08:20:00 2001
From: Andrew Cagney <ac131313@cygnus.com>
To: Orjan Friberg <orjan.friberg@axis.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: New port: CRIS architecture (2nd try)
Date: Mon, 16 Jul 2001 08:20:00 -0000
Message-id: <3B530624.50407@cygnus.com>
References: <3A2BAEF0.A4641A0C@axis.com> <3B4D8EF5.B02D2FA4@axis.com> <3B4FB0AB.1020106@cygnus.com> <3B52B011.5AEE83C7@axis.com>
X-SW-Source: 2001-07/msg00374.html
Content-length: 227

> Andrew Cagney wrote:
> 
>> 
>> Yes, fine, thanks.  Don't forget the NEWS file.
>> 
> 
> 
> Committed; thanks.  Patch for the NEWS file below.
> 
> Ok to commit?


Yes looks good (anyone can change the NEWS file).

	Andrew




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

* Re: [rfc/rfa(DavidT?)] Move DOUBLEST to doublest.{h,c}
  2001-07-16  8:18 [rfc/rfa(DavidT?)] Move DOUBLEST to doublest.{h,c} Andrew Cagney
@ 2001-07-29 12:34 ` Andrew Cagney
  2001-07-30  7:09   ` Mark Kettenis
  2001-08-01 11:42   ` Andrew Cagney
  0 siblings, 2 replies; 9+ messages in thread
From: Andrew Cagney @ 2001-07-29 12:34 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

FYI,

I've not received any comments so I guess everyone decided this change 
was pretty obvous :-) (?) Since the 5.1 branch has gone through, I'll be 
committing this to the trunk shortly.

	Andrew

> 2001-07-15  Andrew Cagney  <ac131313@redhat.com>
> * defs.h (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
>  	(HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
>  	(HOST_LONG_DOUBLE_FORMAT, DOUBLEST)
>  	(floatformat_to_doublest, floatformat_from_doublest)
>  	(floatformat_is_negative, floatformat_is_nan)
>  	(floatformat_mantissa, store_floating)
>  	(extract_floating): Move declaration from here.
>  	* doublest.h: To here.  New file.
>  
>  	* utils.c (get_field, floatformat_to_doublest, put_field)
>  	(ldfrexp, floatformat_from_doublest, floatformat_is_negative)
>  	(floatformat_is_nan, floatformat_mantissa)
>  	(FLOATFORMAT_CHAR_BIT): Move from here.
>  	* doublest.c: To here.  New file.
>  
>  	* findvar.c (store_floating, extract_floating): Move from here.
>  	* doublest.c: To here.
>  	
>  	* Makefile.in (SFILES): Add doublest.c.
>  	(COMMON_OBS): Add doublest.o.
>  	(doublest.o): Specify dependencies.
>  	(doublest_h): Define.
>  
>  	* config/m88k/tm-m88k.h: Include "doublest.h".
>  	* config/m68k/tm-m68k.h, config/i960/tm-i960.h: Ditto.
>  	* config/i386/xm-nbsd.h, config/i386/xm-linux.h: Ditto.
>  	* config/i386/xm-i386gnu.h, config/i386/xm-go32.h: Ditto.
>  	* config/i386/xm-fbsd.h, config/i386/tm-symmetry.h: Ditto.
>  	* rs6000-tdep.c, valarith.c: Ditto.
>  	* valprint.c, stabsread.c, sh-tdep.c: Ditto.
>  	* ia64-tdep.c, i387-tdep.c, i386-tdep.c: Ditto.
>  	* values.c, arm-tdep.c, arm-linux-tdep.c: Ditto.
>  	* alpha-tdep.c, ax.h, expression.h: Ditto.
>  
>  	* Makefile.in (arm-tdep.o): Add $(doublest_h).
>  	(i386-tdep.o, i387-tdep.o, ia64-tdep.o): Ditto.
>  	(rs6000-tdep.o, stabsread.o, valarith.o): Ditto.
>  	(values.o, valprint.o, arm-linux-tdep.o): Ditto.
>  	(alpha-tdep.o, ax_h): Ditto.
>  	(expression_h): Add $(doublest_h) and $(symtab_h).
>  
> 



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

* Re: [rfc/rfa(DavidT?)] Move DOUBLEST to doublest.{h,c}
  2001-07-29 12:34 ` Andrew Cagney
@ 2001-07-30  7:09   ` Mark Kettenis
  2001-07-30  7:34     ` Andrew Cagney
  2001-08-01 11:42   ` Andrew Cagney
  1 sibling, 1 reply; 9+ messages in thread
From: Mark Kettenis @ 2001-07-30  7:09 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

Andrew Cagney <ac131313@cygnus.com> writes:

> > 2001-07-15  Andrew Cagney  <ac131313@redhat.com>

> >  	* config/m88k/tm-m88k.h: Include "doublest.h".
> >  	* config/m68k/tm-m68k.h, config/i960/tm-i960.h: Ditto.
> >  	* config/i386/xm-nbsd.h, config/i386/xm-linux.h: Ditto.
> >  	* config/i386/xm-i386gnu.h, config/i386/xm-go32.h: Ditto.
> >  	* config/i386/xm-fbsd.h, config/i386/tm-symmetry.h: Ditto.

Why are you including "doublest.h" from various tm.h and xm.h files?
Most of them don't use DOUBLEST at all, so this seems wrong to me.

Mark


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

* Re: [rfc/rfa(DavidT?)] Move DOUBLEST to doublest.{h,c}
  2001-07-30  7:09   ` Mark Kettenis
@ 2001-07-30  7:34     ` Andrew Cagney
  2001-07-30 14:41       ` Mark Kettenis
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Cagney @ 2001-07-30  7:34 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

>> > * config/m88k/tm-m88k.h: Include "doublest.h".
>> > * config/m68k/tm-m68k.h, config/i960/tm-i960.h: Ditto.
>> > * config/i386/xm-nbsd.h, config/i386/xm-linux.h: Ditto.
>> > * config/i386/xm-i386gnu.h, config/i386/xm-go32.h: Ditto.
>> > * config/i386/xm-fbsd.h, config/i386/tm-symmetry.h: Ditto.
> 
> 
> Why are you including "doublest.h" from various tm.h and xm.h files?
> Most of them don't use DOUBLEST at all, so this seems wrong to me.


Headers such as tm-m88k.h contain macros that refer to functions such as 
store_floating().  I moved those functions to doublest.h.

Yes, ulgh :-)

	Andrew


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

* Re: [rfc/rfa(DavidT?)] Move DOUBLEST to doublest.{h,c}
  2001-07-30  7:34     ` Andrew Cagney
@ 2001-07-30 14:41       ` Mark Kettenis
  2001-07-30 15:34         ` Andrew Cagney
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Kettenis @ 2001-07-30 14:41 UTC (permalink / raw)
  To: ac131313; +Cc: gdb-patches

   Date: Mon, 30 Jul 2001 10:34:36 -0400
   From: Andrew Cagney <ac131313@cygnus.com>

   >> > * config/m88k/tm-m88k.h: Include "doublest.h".
   >> > * config/m68k/tm-m68k.h, config/i960/tm-i960.h: Ditto.
   >> > * config/i386/xm-nbsd.h, config/i386/xm-linux.h: Ditto.
   >> > * config/i386/xm-i386gnu.h, config/i386/xm-go32.h: Ditto.
   >> > * config/i386/xm-fbsd.h, config/i386/tm-symmetry.h: Ditto.
   > 
   > 
   > Why are you including "doublest.h" from various tm.h and xm.h files?
   > Most of them don't use DOUBLEST at all, so this seems wrong to me.

   Headers such as tm-m88k.h contain macros that refer to functions such as 
   store_floating().  I moved those functions to doublest.h.

I see, but how about the i386/xm-*.h files?  I'm asking since I'm
thinking about replacing most of them with a single xm-i386.h with the
following contents:

   /* FIXME: kettenis/2001-07-29: Get rid of HOST_BYTE_ORDER when Andrew
      has erradicated it from the sources.  */
   #define HOST_BYTE_ORDER LITTLE_ENDIAN

   #define HOST_FLOAT_FORMAT &floatformat_ieee_single_little
   #define HOST_DOUBLE_FORMAT &floatformat_ieee_double_little
   #define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext

Mark



   Yes, ulgh :-)

	   Andrew



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

* Re: [rfc/rfa(DavidT?)] Move DOUBLEST to doublest.{h,c}
  2001-07-30 14:41       ` Mark Kettenis
@ 2001-07-30 15:34         ` Andrew Cagney
  2001-07-30 21:50           ` Andrew Cagney
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Cagney @ 2001-07-30 15:34 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

>    Headers such as tm-m88k.h contain macros that refer to functions such as 
>    store_floating().  I moved those functions to doublest.h.
> 
> I see, but how about the i386/xm-*.h files?  I'm asking since I'm
> thinking about replacing most of them with a single xm-i386.h with the
> following contents:


I was only checking for references to the functions I moved.


>    /* FIXME: kettenis/2001-07-29: Get rid of HOST_BYTE_ORDER when Andrew
>       has erradicated it from the sources.  */
>    #define HOST_BYTE_ORDER LITTLE_ENDIAN
> 
>    #define HOST_FLOAT_FORMAT &floatformat_ieee_single_little
>    #define HOST_DOUBLE_FORMAT &floatformat_ieee_double_little
>    #define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext


I'd include "floatformat.h".  Is there an x86 system that doesn't have 
long double?  I've a memory of someone pointing this out when I recently 
  changed the i387 float conversion code.

FYI, I also recently added the below to the doco.  It was an attempt at 
summarising an earlier discussion about an include file policy.

	Andrew

@subsection Include Files

All @file{.c} files should include @file{defs.h} first.

All @file{.c} files should explicitly include the headers for any
declarations they refer to.  They should not rely on files being
included indirectly.

With the exception of the global definitions supplied by @file{defs.h},
a header file should explictily include the header declaring any
@code{typedefs} et.al.@: it refers to.

@code{extern} declarations should never appear in @code{.c} files.

All include files should be wrapped in:

@example
#ifndef INCLUDE_FILE_NAME_H
#define INCLUDE_FILE_NAME_H
header body
#endif
@end example





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

* Re: [rfc/rfa(DavidT?)] Move DOUBLEST to doublest.{h,c}
  2001-07-30 15:34         ` Andrew Cagney
@ 2001-07-30 21:50           ` Andrew Cagney
  2001-07-31 14:37             ` Andrew Cagney
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Cagney @ 2001-07-30 21:50 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Mark Kettenis, gdb-patches

> Headers such as tm-m88k.h contain macros that refer to functions such as    store_floating().  I moved those functions to doublest.h.
> 
> I see, but how about the i386/xm-*.h files?  I'm asking since I'm
> thinking about replacing most of them with a single xm-i386.h with the
> following contents:
> 
> 
> I was only checking for references to the functions I moved.


Hmm, oops no, sorry, not quite...


>    /* FIXME: kettenis/2001-07-29: Get rid of HOST_BYTE_ORDER when Andrew
>       has erradicated it from the sources.  */
>    #define HOST_BYTE_ORDER LITTLE_ENDIAN
> 
>    #define HOST_FLOAT_FORMAT &floatformat_ieee_single_little
>    #define HOST_DOUBLE_FORMAT &floatformat_ieee_double_little
>    #define HOST_LONG_DOUBLE_FORMAT &floatformat_i387_ext
> 
> 
> I'd include "floatformat.h".  Is there an x86 system that doesn't have long double?  I've a memory of someone pointing this out when I recently  changed the i387 float conversion code.


I was incorrectly adding a #include "doublest.h" when the file defined 
(not used) things like HOST_FLOAT_FORMAT.  Further cross checking 
reveals that I also missed a few DOUBLEST references ;-/

I'll revise and repost.

	Andrew


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

* Re: [rfc/rfa(DavidT?)] Move DOUBLEST to doublest.{h,c}
  2001-07-30 21:50           ` Andrew Cagney
@ 2001-07-31 14:37             ` Andrew Cagney
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Cagney @ 2001-07-31 14:37 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

Attatched is a revised version of the doublest.[hc] change.  Assuming 
all my cross builds work, I'll check this in.

	Andrew
From keiths@cygnus.com Tue Jul 31 14:48:00 2001
From: Keith Seitz <keiths@cygnus.com>
To: <gdb-patches@sources.redhat.com>
Subject: [RFA] defs.h _WIN32 defined by Win98, too
Date: Tue, 31 Jul 2001 14:48:00 -0000
Message-id: <Pine.GSO.4.33.0107311445130.28966-100000@makita.cygnus.com>
X-SW-Source: 2001-07/msg00765.html
Content-length: 1246

Hi,

As a result of this change:

2001-06-13  Eli Zaretskii  <eliz@is.elta.co.il>

        * config/i386/xm-go32.h (SLASH_P, ROOTED_P, SLASH_CHAR)
        (SLASH_STRING): Remove unised definitions.
        * config/i386/xm-cygwin.h: Likewise.

Win98 no longer works under cygwin:

(gdb) file gdb.exe
Loading symbols from gdb.exe...done
(gdb) run
`/home/keiths/sources/insight/gdb\gdb.exe' has disappeared; keeping its
symbols.

Starting program: /home/keiths/sources/insight/gdb\gdb.exe
Error creating process /home/keiths/sources/insight/gdb\gdb.exe (error 2)
[often crashes here]

Apparently, Win98 defines _WIN32 somewhere...

ChangeLog
2001-07-31  Keith Seitz  <keiths@redhat.com>

	* defs.h (SLASH_STRING): Only define to "\\" if _WIN32
	is set and we're not on Cygwin. _WIN32 is defined for
	Win98.

Patch
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.57
diff -u -p -r1.57 defs.h
--- defs.h	2001/07/07 17:19:50	1.57
+++ defs.h	2001/07/31 21:45:14
@@ -1408,7 +1408,7 @@ extern int use_windows;
 #endif

 #ifndef SLASH_STRING
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
 #define SLASH_STRING "\\"
 #else
 #define SLASH_STRING "/"



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

* Re: [rfc/rfa(DavidT?)] Move DOUBLEST to doublest.{h,c}
  2001-07-29 12:34 ` Andrew Cagney
  2001-07-30  7:09   ` Mark Kettenis
@ 2001-08-01 11:42   ` Andrew Cagney
  1 sibling, 0 replies; 9+ messages in thread
From: Andrew Cagney @ 2001-08-01 11:42 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

> FYI,
> 
> I've not received any comments so I guess everyone decided this change was pretty obvous [:-)] (?) Since the 5.1 branch has gone through, I'll be committing this to the trunk shortly.
> 
>     Andrew


FYI,

This change is in.

	Andew




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

end of thread, other threads:[~2001-08-01 11:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-16  8:18 [rfc/rfa(DavidT?)] Move DOUBLEST to doublest.{h,c} Andrew Cagney
2001-07-29 12:34 ` Andrew Cagney
2001-07-30  7:09   ` Mark Kettenis
2001-07-30  7:34     ` Andrew Cagney
2001-07-30 14:41       ` Mark Kettenis
2001-07-30 15:34         ` Andrew Cagney
2001-07-30 21:50           ` Andrew Cagney
2001-07-31 14:37             ` Andrew Cagney
2001-08-01 11:42   ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox