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]

sign-extending smaller modes



I don't know why BITS_PER_WORD was being used; it doesn't always
correspond to the size of the type being converted, and isn't used in
any of the other logic in those areas.

There also seems to be a bit of redundancy between these two
functions, but I didn't do anything about that.


2000-04-12  DJ Delorie  <dj@cygnus.com>

	* varasm.c (immed_double_const): sign-extend modes smaller
	than the default machine mode also
	* explow.c (trunc_int_for_mode): ditto

Index: explow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/explow.c,v
retrieving revision 1.45
diff -p -3 -r1.45 explow.c
*** explow.c	2000/04/01 00:09:21	1.45
--- explow.c	2000/04/12 15:15:22
*************** trunc_int_for_mode (c, mode)
*** 70,77 ****
       represented as a 64 bit value -1, and not as 0x00000000ffffffff.
       The later confuses the sparc backend.  */
  
!   if (BITS_PER_WORD < HOST_BITS_PER_WIDE_INT
!       && BITS_PER_WORD == width
        && (c & ((HOST_WIDE_INT) 1 << (width - 1))))
      c |= ((HOST_WIDE_INT) (-1) << width);
  
--- 70,76 ----
       represented as a 64 bit value -1, and not as 0x00000000ffffffff.
       The later confuses the sparc backend.  */
  
!   if (width < HOST_BITS_PER_WIDE_INT
        && (c & ((HOST_WIDE_INT) 1 << (width - 1))))
      c |= ((HOST_WIDE_INT) (-1) << width);
  
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/varasm.c,v
retrieving revision 1.110
diff -p -3 -r1.110 varasm.c
*** varasm.c	2000/03/25 18:34:05	1.110
--- varasm.c	2000/04/12 15:15:23
*************** immed_double_const (i0, i1, mode)
*** 2077,2083 ****
  	 represented as a 64 bit value -1, and not as 0x00000000ffffffff.
  	 The later confuses the sparc backend.  */
  
!       if (BITS_PER_WORD < HOST_BITS_PER_WIDE_INT && BITS_PER_WORD == width
  	  && (i0 & ((HOST_WIDE_INT) 1 << (width - 1))))
  	i0 |= ((HOST_WIDE_INT) (-1) << width);
  
--- 2077,2083 ----
  	 represented as a 64 bit value -1, and not as 0x00000000ffffffff.
  	 The later confuses the sparc backend.  */
  
!       if (width < HOST_BITS_PER_WIDE_INT
  	  && (i0 & ((HOST_WIDE_INT) 1 << (width - 1))))
  	i0 |= ((HOST_WIDE_INT) (-1) << width);
  

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