gnats-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to gnats/libiberty/floatformat.c


From: Milan Zamazal
Subject: Changes to gnats/libiberty/floatformat.c
Date: Mon, 10 Dec 2001 18:04:20 -0500

Index: gnats/libiberty/floatformat.c
diff -c gnats/libiberty/floatformat.c:1.2 gnats/libiberty/floatformat.c:1.3
*** gnats/libiberty/floatformat.c:1.2   Tue Oct 26 03:10:16 1999
--- gnats/libiberty/floatformat.c       Mon Dec 10 18:03:26 2001
***************
*** 1,5 ****
  /* IEEE floating point support routines, for GDB, the GNU Debugger.
!    Copyright (C) 1991, 1994 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.
  
***************
*** 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
***************
*** 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 =
  {
***************
*** 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 *,
***************
*** 128,134 ****
      --cur_byte;
  
    /* Move towards the most significant part of the field.  */
!   while (cur_bitshift < len)
      {
        if (len - cur_bitshift < FLOATFORMAT_CHAR_BIT)
        /* This is the last byte; zero out the bits which are not part of
--- 145,151 ----
      --cur_byte;
  
    /* Move towards the most significant part of the field.  */
!   while ((unsigned int) cur_bitshift < len)
      {
        if (len - cur_bitshift < FLOATFORMAT_CHAR_BIT)
        /* This is the last byte; zero out the bits which are not part of
***************
*** 179,185 ****
    mant_off = fmt->man_start;
    dto = 0.0;
  
!   special_exponent = exponent == 0 || exponent == fmt->exp_nan;
  
    /* Don't bias zero's, denorms or NaNs.  */
    if (!special_exponent)
--- 196,202 ----
    mant_off = fmt->man_start;
    dto = 0.0;
  
!   special_exponent = exponent == 0 || (unsigned long) exponent == 
fmt->exp_nan;
  
    /* Don't bias zero's, denorms or NaNs.  */
    if (!special_exponent)
***************
*** 255,261 ****
      --cur_byte;
  
    /* Move towards the most significant part of the field.  */
!   while (cur_bitshift < len)
      {
        if (len - cur_bitshift < FLOATFORMAT_CHAR_BIT)
        {
--- 272,278 ----
      --cur_byte;
  
    /* Move towards the most significant part of the field.  */
!   while ((unsigned int) cur_bitshift < len)
      {
        if (len - cur_bitshift < FLOATFORMAT_CHAR_BIT)
        {
***************
*** 335,341 ****
         If we are discarding a zero, we should be (but are not) creating
         a denormalized number which means adjusting the exponent
         (I think).  */
!       if (mant_bits_left == fmt->man_len
          && fmt->intbit == floatformat_intbit_no)
        {
          mant_long &= 0x7fffffff;
--- 352,358 ----
         If we are discarding a zero, we should be (but are not) creating
         a denormalized number which means adjusting the exponent
         (I think).  */
!       if ((unsigned int) mant_bits_left == fmt->man_len
          && fmt->intbit == floatformat_intbit_no)
        {
          mant_long &= 0x7fffffff;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]