* cross from alpha to arm
@ 1997-10-15 9:15 Stephen Williams
1997-10-15 11:04 ` Richard Henderson
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Williams @ 1997-10-15 9:15 UTC (permalink / raw)
To: egcs
This very simple patch allows egcs to successfully build libgcc for the
arm from a Linux/alpha host. I can't say if it fixes the root of the problem,
but it certainly gets me over the immediate hurdle. This seems to be the
only place left where 64bit host --> 32bit arm is confused.
*** egcs-971008/gcc/config/arm/arm.c Mon Aug 11 08:57:24 1997
--- ../egcs-971008/gcc/config/arm/arm.c Tue Oct 14 18:31:16 1997
***************
*** 407,412 ****
--- 407,416 ----
{
unsigned HOST_WIDE_INT mask = ~0xFF;
+ #if HOST_BITS_PER_WIDE_INT > 32
+ if (i & 0xffffffff00000000LL) return FALSE;
+ #endif
+
/* Fast return for 0 and powers of 2 */
if ((i & (i - 1)) == 0)
return TRUE;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cross from alpha to arm
1997-10-15 9:15 cross from alpha to arm Stephen Williams
@ 1997-10-15 11:04 ` Richard Henderson
1997-10-15 14:33 ` Stephen Williams
1997-10-15 20:16 ` Richard Earnshaw
0 siblings, 2 replies; 4+ messages in thread
From: Richard Henderson @ 1997-10-15 11:04 UTC (permalink / raw)
To: Stephen Williams; +Cc: egcs
On Wed, Oct 15, 1997 at 09:15:25AM +0800, Stephen Williams wrote:
> + #if HOST_BITS_PER_WIDE_INT > 32
> + if (i & 0xffffffff00000000LL) return FALSE;
> + #endif
Make this instead
if (i & ~(unsigned HOST_WIDE_INT) 0xffffffff) return FALSE;
The LL will mess up non-gcc 64-bit hosts, and the conditional
will be optimized away on hosts it doesn't matter for.
r~
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cross from alpha to arm
1997-10-15 11:04 ` Richard Henderson
@ 1997-10-15 14:33 ` Stephen Williams
1997-10-15 20:16 ` Richard Earnshaw
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Williams @ 1997-10-15 14:33 UTC (permalink / raw)
To: Richard Henderson; +Cc: egcs
On Wed, Oct 15, 1997 at 09:15:25AM +0800, Stephen Williams wrote:
> + #if HOST_BITS_PER_WIDE_INT > 32
> + if (i & 0xffffffff00000000LL) return FALSE;
> + #endif
rth@dot.cygnus.com said:
> Make this instead
> if (i & ~(unsigned HOST_WIDE_INT) 0xffffffff) return FALSE;
Even better! It tests out just fine. Thanks.
--
Steve Williams
steve@icarus.com
steve@picturel.com
"The woods are lovely, dark and deep. But I have promises to keep,
And lines to code before I sleep, And lines to code before I sleep."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: cross from alpha to arm
1997-10-15 11:04 ` Richard Henderson
1997-10-15 14:33 ` Stephen Williams
@ 1997-10-15 20:16 ` Richard Earnshaw
1 sibling, 0 replies; 4+ messages in thread
From: Richard Earnshaw @ 1997-10-15 20:16 UTC (permalink / raw)
To: Richard Henderson; +Cc: rearnsha
> On Wed, Oct 15, 1997 at 09:15:25AM +0800, Stephen Williams wrote:
> > + #if HOST_BITS_PER_WIDE_INT > 32
> > + if (i & 0xffffffff00000000LL) return FALSE;
> > + #endif
>
> Make this instead
>
> if (i & ~(unsigned HOST_WIDE_INT) 0xffffffff) return FALSE;
>
> The LL will mess up non-gcc 64-bit hosts, and the conditional
> will be optimized away on hosts it doesn't matter for.
>
>
> r~
While this is better, I think you would get better code if you failed
numbers that weren't the equivalent of a sign-extended 32 bit number.
Indeed some of the code in output_move_double currently assumes this
(though this probably needs fixing).
Something like:
{
unsigned HOST_WIDE_INT mask = ~0xFF;
HOST_WIDE_INT j = i >> 31;
if (j != 0 && j != (HOST_WIDE_INT) -1)
return FALSE;
/* Fast return for 0 and powers of 2 */
if ((i & (i - 1)) == 0)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1997-10-15 20:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-15 9:15 cross from alpha to arm Stephen Williams
1997-10-15 11:04 ` Richard Henderson
1997-10-15 14:33 ` Stephen Williams
1997-10-15 20:16 ` Richard Earnshaw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).