This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix ia64 long double test cases


These failures were exposed by the 12-20 assemble_real changes.

Previously, ASM_OUTPUT_LONG_DOUBLE didn't examine word 3 of the
result of REAL_VALUE_TO_TARGET_LONG_DOUBLE, it just hard-coded a
zero.  In actuality, REAL_VALUE_TO_TARGET_LONG_DOUBLE has been
returning garbage in word 3.  Which isn't good at all.

Tested on ia64-linux.


r~


        * real.c (etoe113, toe113): Ifndef INTEL_EXTENDED_IEEE_FORMAT.
        (endian): Clear word 3 for INTEL_EXTENDED_IEEE_FORMAT.
        (etartdouble): Invoke etoe64 for INTEL_EXTENDED_IEEE_FORMAT.
        * real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Don't special case
        INTEL_EXTENDED_IEEE_FORMAT.

Index: real.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/real.c,v
retrieving revision 1.56
diff -c -p -d -r1.56 real.c
*** real.c	2001/12/16 13:58:06	1.56
--- real.c	2001/12/28 09:19:55
*************** static void e64toe	PARAMS ((UEMUSHORT *,
*** 425,432 ****
--- 425,434 ----
  static void e113toe	PARAMS ((UEMUSHORT *, UEMUSHORT *));
  #endif
  static void e24toe	PARAMS ((UEMUSHORT *, UEMUSHORT *));
+ #if (INTEL_EXTENDED_IEEE_FORMAT == 0)
  static void etoe113	PARAMS ((UEMUSHORT *, UEMUSHORT *));
  static void toe113	PARAMS ((UEMUSHORT *, UEMUSHORT *));
+ #endif
  static void etoe64	PARAMS ((UEMUSHORT *, UEMUSHORT *));
  static void toe64	PARAMS ((UEMUSHORT *, UEMUSHORT *));
  static void etoe53	PARAMS ((UEMUSHORT *, UEMUSHORT *));
*************** endian (e, x, mode)
*** 524,530 ****
--- 526,535 ----
  	  t = (unsigned long) e[7] & 0xffff;
  	  t |= th << 16;
  	  x[3] = (long) t;
+ #else
+ 	  x[3] = 0;
  #endif
+ 	  /* FALLTHRU */
  
  	case XFmode:
  	  /* Swap halfwords in the third long.  */
*************** endian (e, x, mode)
*** 532,538 ****
  	  t = (unsigned long) e[5] & 0xffff;
  	  t |= th << 16;
  	  x[2] = (long) t;
! 	  /* fall into the double case */
  
  	case DFmode:
  	  /* Swap halfwords in the second word.  */
--- 537,543 ----
  	  t = (unsigned long) e[5] & 0xffff;
  	  t |= th << 16;
  	  x[2] = (long) t;
! 	  /* FALLTHRU */
  
  	case DFmode:
  	  /* Swap halfwords in the second word.  */
*************** endian (e, x, mode)
*** 540,546 ****
  	  t = (unsigned long) e[3] & 0xffff;
  	  t |= th << 16;
  	  x[1] = (long) t;
! 	  /* fall into the float case */
  
  	case SFmode:
  	case HFmode:
--- 545,551 ----
  	  t = (unsigned long) e[3] & 0xffff;
  	  t |= th << 16;
  	  x[1] = (long) t;
! 	  /* FALLTHRU */
  
  	case SFmode:
  	case HFmode:
*************** endian (e, x, mode)
*** 568,574 ****
--- 573,582 ----
  	  t = (unsigned long) e[6] & 0xffff;
  	  t |= th << 16;
  	  x[3] = (long) t;
+ #else
+ 	  x[3] = 0;
  #endif
+ 	  /* FALLTHRU */
  
  	case XFmode:
  	  /* Pack the third long.
*************** endian (e, x, mode)
*** 578,584 ****
  	  t = (unsigned long) e[4] & 0xffff;
  	  t |= th << 16;
  	  x[2] = (long) t;
! 	  /* fall into the double case */
  
  	case DFmode:
  	  /* Pack the second long */
--- 586,592 ----
  	  t = (unsigned long) e[4] & 0xffff;
  	  t |= th << 16;
  	  x[2] = (long) t;
! 	  /* FALLTHRU */
  
  	case DFmode:
  	  /* Pack the second long */
*************** endian (e, x, mode)
*** 586,592 ****
  	  t = (unsigned long) e[2] & 0xffff;
  	  t |= th << 16;
  	  x[1] = (long) t;
! 	  /* fall into the float case */
  
  	case SFmode:
  	case HFmode:
--- 594,600 ----
  	  t = (unsigned long) e[2] & 0xffff;
  	  t |= th << 16;
  	  x[1] = (long) t;
! 	  /* FALLTHRU */
  
  	case SFmode:
  	case HFmode:
*************** etartdouble (r, l)
*** 1256,1262 ****
--- 1264,1274 ----
    UEMUSHORT e[NE];
  
    GET_REAL (&r, e);
+ #if INTEL_EXTENDED_IEEE_FORMAT == 0
    etoe113 (e, e);
+ #else
+   etoe64 (e, e);
+ #endif
    endian (e, l, TFmode);
  }
  
*************** e24toe (pe, y)
*** 3535,3540 ****
--- 3547,3553 ----
  #endif /* not IBM */
  }
  
+ #if (INTEL_EXTENDED_IEEE_FORMAT == 0)
  /* Convert e-type X to IEEE 128-bit long double format E.  */
  
  static void
*************** toe113 (a, b)
*** 3627,3632 ****
--- 3640,3646 ----
  	*q-- = *p++;
      }
  }
+ #endif
  
  /* Convert e-type X to IEEE double extended format E.  */
  
*************** read_expnt:
*** 5515,5523 ****
--- 5529,5539 ----
      case 64:
        toe64 (yy, y);
        break;
+ #if (INTEL_EXTENDED_IEEE_FORMAT == 0)
      case 113:
        toe113 (yy, y);
        break;
+ #endif
      case NBITS:
        emovo (yy, y);
        break;
Index: real.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/real.h,v
retrieving revision 1.33
diff -c -p -d -r1.33 real.h
*** real.h	2001/10/11 12:43:42	1.33
--- real.h	2001/12/28 09:19:55
*************** extern REAL_VALUE_TYPE ereal_from_double
*** 208,222 ****
    ereal_from_uint (&d, lo, hi, mode)
  
  /* IN is a REAL_VALUE_TYPE.  OUT is an array of longs.  */
- #if (INTEL_EXTENDED_IEEE_FORMAT != 0) && (MAX_LONG_DOUBLE_TYPE_SIZE == 128)
- #define REAL_VALUE_TO_TARGET_LONG_DOUBLE(IN, OUT) (etarldouble ((IN), (OUT)))
- #else
  #define REAL_VALUE_TO_TARGET_LONG_DOUBLE(IN, OUT) 		\
     (LONG_DOUBLE_TYPE_SIZE == 64 ? etardouble ((IN), (OUT))	\
      : LONG_DOUBLE_TYPE_SIZE == 96 ? etarldouble ((IN), (OUT))	\
      : LONG_DOUBLE_TYPE_SIZE == 128 ? etartdouble ((IN), (OUT))  \
      : abort())
- #endif
  #define REAL_VALUE_TO_TARGET_DOUBLE(IN, OUT) (etardouble ((IN), (OUT)))
  
  /* IN is a REAL_VALUE_TYPE.  OUT is a long.  */
--- 208,218 ----


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