This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


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

Re: [rfa] Add a name field to ``struct floatformat''


Andrew Cagney wrote:
> 
> Hello,
> 
> The attached adds a name field to ``struct floatformat''.  It would be
> going into both the binutils+gdb and gcc repositories.  Since GDB likes
> to change its floatingpoint format on the fly, being about to print the
> format's name out (for debugging) is very helpful.
> 
> Any problems?  (This code was once GDB's anyway :-).
> 
>         Andrew

I'll try again....
libiberty/ChangeLog:
Tue May 30 16:45:25 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* floatformat.c: Add name to each floatformat field.

include/ChangeLog:
Tue May 30 16:53:34 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* floatformat.h (struct floatformat): Add field name.

Index: libiberty/floatformat.c
===================================================================
RCS file: /cvs/src/src/libiberty/floatformat.c,v
retrieving revision 1.2
diff -p -r1.2 floatformat.c
*** floatformat.c	1999/08/03 16:00:39	1.2
--- floatformat.c	2000/05/30 06:50:09
***************
*** 1,5 ****
  /* IEEE floating point support routines, for GDB, the GNU Debugger.
!    Copyright (C) 1991, 1994, 1999 Free Software Foundation, Inc.
  
  This file is part of GDB.
  
--- 1,5 ----
  /* IEEE floating point support routines, for GDB, the GNU Debugger.
!    Copyright (C) 1991, 1994, 1999-2000 Free Software Foundation, Inc.
  
  This file is part of GDB.
  
*************** extern char *memset ();
*** 36,54 ****
  /* floatformats for IEEE single and double, big and little endian.  */
  const struct floatformat floatformat_ieee_single_big =
  {
!   floatformat_big, 32, 0, 1, 8, 127, 255, 9, 23, floatformat_intbit_no
  };
  const struct floatformat floatformat_ieee_single_little =
  {
!   floatformat_little, 32, 0, 1, 8, 127, 255, 9, 23, floatformat_intbit_no
  };
  const struct floatformat floatformat_ieee_double_big =
  {
!   floatformat_big, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no
  };
  const struct floatformat floatformat_ieee_double_little =
  {
!   floatformat_little, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no
  };
  
  /* floatformat for IEEE double, little endian byte order, with big endian word
--- 36,62 ----
  /* floatformats for IEEE single and double, big and little endian.  */
  const struct floatformat floatformat_ieee_single_big =
  {
!   floatformat_big, 32, 0, 1, 8, 127, 255, 9, 23,
!   floatformat_intbit_no,
!   "floatformat_ieee_single_big"
  };
  const struct floatformat floatformat_ieee_single_little =
  {
!   floatformat_little, 32, 0, 1, 8, 127, 255, 9, 23,
!   floatformat_intbit_no,
!   "floatformat_ieee_single_little"
  };
  const struct floatformat floatformat_ieee_double_big =
  {
!   floatformat_big, 64, 0, 1, 11, 1023, 2047, 12, 52,
!   floatformat_intbit_no,
!   "floatformat_ieee_double_big"
  };
  const struct floatformat floatformat_ieee_double_little =
  {
!   floatformat_little, 64, 0, 1, 11, 1023, 2047, 12, 52,
!   floatformat_intbit_no,
!   "floatformat_ieee_double_little"
  };
  
  /* floatformat for IEEE double, little endian byte order, with big endian word
*************** const struct floatformat floatformat_iee
*** 56,79 ****
  
  const struct floatformat floatformat_ieee_double_littlebyte_bigword =
  {
!   floatformat_littlebyte_bigword, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no
  };
  
  const struct floatformat floatformat_i387_ext =
  {
    floatformat_little, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
!   floatformat_intbit_yes
  };
  const struct floatformat floatformat_m68881_ext =
  {
    /* Note that the bits from 16 to 31 are unused.  */
!   floatformat_big, 96, 0, 1, 15, 0x3fff, 0x7fff, 32, 64, floatformat_intbit_yes
  };
  const struct floatformat floatformat_i960_ext =
  {
    /* Note that the bits from 0 to 15 are unused.  */
    floatformat_little, 96, 16, 17, 15, 0x3fff, 0x7fff, 32, 64,
!   floatformat_intbit_yes
  };
  const struct floatformat floatformat_m88110_ext =
  {
--- 64,93 ----
  
  const struct floatformat floatformat_ieee_double_littlebyte_bigword =
  {
!   floatformat_littlebyte_bigword, 64, 0, 1, 11, 1023, 2047, 12, 52,
!   floatformat_intbit_no,
!   "floatformat_ieee_double_little"
  };
  
  const struct floatformat floatformat_i387_ext =
  {
    floatformat_little, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
!   floatformat_intbit_yes,
!   "floatformat_i387_ext"
  };
  const struct floatformat floatformat_m68881_ext =
  {
    /* Note that the bits from 16 to 31 are unused.  */
!   floatformat_big, 96, 0, 1, 15, 0x3fff, 0x7fff, 32, 64,
!   floatformat_intbit_yes,
!   "floatformat_m68881_ext"
  };
  const struct floatformat floatformat_i960_ext =
  {
    /* Note that the bits from 0 to 15 are unused.  */
    floatformat_little, 96, 16, 17, 15, 0x3fff, 0x7fff, 32, 64,
!   floatformat_intbit_yes,
!   "floatformat_i960_ext"
  };
  const struct floatformat floatformat_m88110_ext =
  {
*************** const struct floatformat floatformat_m88
*** 81,97 ****
    /* Harris uses raw format 128 bytes long, but the number is just an ieee
       double, and the last 64 bits are wasted. */
    floatformat_big,128, 0, 1, 11,  0x3ff,  0x7ff, 12, 52,
!   floatformat_intbit_no
  #else
    floatformat_big, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
!   floatformat_intbit_yes
  #endif /* HARRIS_FLOAT_FORMAT */
  };
  const struct floatformat floatformat_arm_ext =
  {
    /* Bits 1 to 16 are unused.  */
    floatformat_big, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64,
!   floatformat_intbit_yes
  };
  
  static unsigned long get_field PARAMS ((unsigned char *,
--- 95,114 ----
    /* Harris uses raw format 128 bytes long, but the number is just an ieee
       double, and the last 64 bits are wasted. */
    floatformat_big,128, 0, 1, 11,  0x3ff,  0x7ff, 12, 52,
!   floatformat_intbit_no,
!   "floatformat_m88110_ext(harris)"
  #else
    floatformat_big, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
!   floatformat_intbit_yes,
!   "floatformat_m88110_ext"
  #endif /* HARRIS_FLOAT_FORMAT */
  };
  const struct floatformat floatformat_arm_ext =
  {
    /* Bits 1 to 16 are unused.  */
    floatformat_big, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64,
!   floatformat_intbit_yes,
!   "floatformat_arm_ext"
  };
  
  static unsigned long get_field PARAMS ((unsigned char *,
Index: include/floatformat.h
===================================================================
RCS file: /cvs/src/src/include/floatformat.h,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 floatformat.h
*** floatformat.h	1999/05/03 07:29:01	1.1.1.1
--- floatformat.h	2000/05/30 06:50:09
***************
*** 1,5 ****
  /* IEEE floating point support declarations, for GDB, the GNU Debugger.
!    Copyright (C) 1991 Free Software Foundation, Inc.
  
  This file is part of GDB.
  
--- 1,5 ----
  /* IEEE floating point support declarations, for GDB, the GNU Debugger.
!    Copyright (C) 1991, 2000 Free Software Foundation, Inc.
  
  This file is part of GDB.
  
*************** struct floatformat
*** 73,78 ****
--- 73,81 ----
  
    /* Is the integer bit explicit or implicit?  */
    enum floatformat_intbit intbit;
+ 
+   /* Internal name for debugging. */
+   const char *name;
  };
  
  /* floatformats for IEEE single and double, big and little endian.  */

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