Subject: Re: 64-bit ABIs
To: Jason Thorpe <thorpej@wasabisystems.com>
From: Steve Woodford <scw@netbsd.org>
List: tech-userlevel
Date: 04/30/2003 08:53:51
On Tue, 29 Apr 2003, Jason Thorpe wrote:

> On Tuesday, April 29, 2003, at 04:40  PM, Bill Studenmund wrote:
>
> > I think RENAME is really the way we want to go. It's how we've handled
> > this in the past, it is the most direct way to fix the problem, and
> > it's
> > how we're going to deal with syscall changes in the future. :-)
>
> I'm not sure it really matters that much.  On e.g. sh5, the other half
> of the sign-extended value is going to be ignored, right?  Or is the
> issue "which half"?

Unfortunately the sign-extendion is not ignored under certain
circumstances.

For example, one bug I fixed recently involved bswap32(). My initial
implementation of the inline asm did not sign-extend the uint32_t result.

The compiler assumed the result was correctly sign-extended, as it
subsequently compared it with an unsigned 32-bit value it had just loaded
from memory. This load automatically sign-extends 32-64 bits. On sh5,
comparisons are always 64-bits wide, so the subsequent compare failed to
DTRT.

Cheers, Steve