This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] zap some floatformat_*_double()


Hello,

The attatched replaces several uses of floatformat_{to,from}_double with 
floatformat_{to,from}_doublest.  There are still a few uses but they are 
more tricky (they are also all i386 specific, and in one case it looks 
like the target should just be made obsolete).

In doing this, I came across the comment (valprint.c):

   /* FIXME: kettenis/2001-01-20: The following code makes too much
      assumptions about the host and target floating point format.  */

Since there is now a doublest.[hc], perhaphs it should gain a 
fput_doublest_filtered() function?

Any way, I'm checking in the attached as an obvious fix.

	Andrew
2001-08-11  Andrew Cagney  <ac131313@redhat.com>

	* config/i386/tm-symmetry.h (REGISTER_CONVERT_TO_VIRTUAL): Make
	val a DOUBLEST.  Use floatformat_to_doublest.
	(REGISTER_CONVERT_TO_RAW): Ditto.  Use foatformat_from_doublest.
	* config/m88k/tm-m88k.h (REGISTER_CONVERT_TO_VIRTUAL): Ditto.
	(REGISTER_CONVERT_TO_RAW): Ditto.

Index: config/i386/tm-symmetry.h
===================================================================
RCS file: /cvs/src/src/gdb/config/i386/tm-symmetry.h,v
retrieving revision 1.5
diff -p -r1.5 tm-symmetry.h
*** tm-symmetry.h	2001/08/01 18:39:25	1.5
--- tm-symmetry.h	2001/08/12 03:02:48
*************** switch (regno) { \
*** 268,275 ****
  #undef REGISTER_CONVERT_TO_VIRTUAL
  #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
  { \
!   double val; \
!   floatformat_to_double (&floatformat_i387_ext, (FROM), &val); \
    store_floating ((TO), TYPE_LENGTH (TYPE), val); \
  }
  
--- 268,275 ----
  #undef REGISTER_CONVERT_TO_VIRTUAL
  #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
  { \
!   DOUBLEST val; \
!   floatformat_to_doublest (&floatformat_i387_ext, (FROM), &val); \
    store_floating ((TO), TYPE_LENGTH (TYPE), val); \
  }
  
*************** switch (regno) { \
*** 279,286 ****
  #undef REGISTER_CONVERT_TO_RAW
  #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
  { \
!   double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
!   floatformat_from_double (&floatformat_i387_ext, &val, (TO)); \
  }
  
  /* Return the GDB type object for the "standard" data type
--- 279,286 ----
  #undef REGISTER_CONVERT_TO_RAW
  #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
  { \
!   DOUBLEST val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
!   floatformat_from_doublest (&floatformat_i387_ext, &val, (TO)); \
  }
  
  /* Return the GDB type object for the "standard" data type
Index: config/m88k/tm-m88k.h
===================================================================
RCS file: /cvs/src/src/gdb/config/m88k/tm-m88k.h,v
retrieving revision 1.7
diff -p -r1.7 tm-m88k.h
*** tm-m88k.h	2001/08/01 18:39:27	1.7
--- tm-m88k.h	2001/08/12 03:02:50
*************** if (!target_is_m88110) \
*** 392,399 ****
  
  #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
  { \
!   double val; \
!   floatformat_to_double (&floatformat_m88110_ext, (FROM), &val); \
    store_floating ((TO), TYPE_LENGTH (TYPE), val); \
  }
  
--- 392,399 ----
  
  #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
  { \
!   DOUBLEST val; \
!   floatformat_to_doublest (&floatformat_m88110_ext, (FROM), &val); \
    store_floating ((TO), TYPE_LENGTH (TYPE), val); \
  }
  
*************** if (!target_is_m88110) \
*** 402,409 ****
  
  #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO)	\
  { \
!   double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
!   floatformat_from_double (&floatformat_m88110_ext, &val, (TO)); \
  }
  
  /* Return the GDB type object for the "standard" data type
--- 402,409 ----
  
  #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO)	\
  { \
!   DOUBLEST val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
!   floatformat_from_doublest (&floatformat_m88110_ext, &val, (TO)); \
  }
  
  /* Return the GDB type object for the "standard" data type

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]