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]

Re: TImode support for x86_64


> On Wed, Oct 10, 2001 at 10:40:56PM +0200, Jan Hubicka wrote:
> > > 	        parts[0] = GEN_INT (l[0] + (((HOST_WIDE_INT)l[1] << 31) << 1));
> > 
> > Hmm, thats the original form, isn't it?
> 
> No, we've added the cast to HOST_WIDE_INT.  Which would indeed
> fix a problem when HOST_WIDE_INT == long long.
Hmm, looking at our x86_64 tree, it is obvious (first time I've managed to fix
the bug correctly). The problem is, that l[0] gets sign extended, so it puts -1
into upper part in some cases.  In the testcase I had it made the parts to
appear reversed if you took uncurefull look enought (approximating
decimal->hexa converison in the mind).

The floating point magic then probably made the testcase pass after reversing
the parts.

Would be OK following?

	      /* Do not use shift by 32 to avoid warning on 32bit systems.  */
	      if (HOST_BITS_PER_WIDE_INT >= 64)
	        parts[0] = GEN_INT ((l[0] & (((HOST_WIDE_INT) 2 << 31) - 1))
				    + ((((HOST_WIDE_INT)l[1]) << 31) << 1));
	      else
	        parts[0] = immed_double_const (l[0], l[1], DImode);

Honza


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