assembler error in XFree86 snapshot

Bruce A. Mah bmah at FreeBSD.org
Fri May 9 13:46:56 PDT 2003


If memory serves me right, Eric Anholt wrote:
> On Wed, 2003-05-07 at 15:11, Thomas Moestl wrote:
> > On Mon, 2003/04/07 at 17:33:32 -0700, Kris Kennaway wrote:
> > > On Thu, Jan 16, 2003 at 09:17:28PM +0100, Thomas Moestl wrote:
> > > > This is a arguably a gcc bug. All (13-bit) immediate operands are
> > > > sign-extended, even those to instructions which operate on unsigned
> > > > values, so umul can handle a range of very small and a range of very
> > > > large operands. gcc correctly recognizes that it can use an immediate
> > > > here; however, it chooses to output it as an unsigned number and does
> > > > not sign-extended it from 32 to 64 bit.
> > > > 
> > > > All sign extensions for instructions are made to the full 64 bit
> > > > however (even if umul only happens to use 32 of those), so when the
> > > > assembler checks whether a value is representable as an immediate, it
> > > > will check that the 64-bit sign extension of the immediate creates
> > > > the desired value (in sparc64 mode), i.e. it doesn't ignore the upper
> > > > 32 bits even if a particular instruction does not use them.
> > > > 
> > > > One solution is to generate negative literals for immediates if we
> > > > mean them to be sign-extended (which gcc does already for some other
> > > > instructions). The attached patch implements this, I'm not sure it
> > > > uses the best possible way to do this though, and it also needs a bit
> > > > more testing.
> > > 
> > > *Ping*
> > > 
> > > Someone needs to take this up with the gcc developers so it can get fixed.
> > 
> > Sorry, I didn't have time to get this done for 5.2. The attached patch
> > should work around the bug however; Eric, could you please add it to
> > XFree86-4-libraries, until the problem is resolved in gcc or gas, so
> > that there can be a package for the release?
> > 
> > Thanks,
> > 	- Thomas
> 
> Done.  Thanks for the patch.

Does this patch fix the "gcc sparc64 problems" item on the 5.1 TODO
list?  (i.e. can I cross it off as completed?)

http://www.freebsd.org/releases/5.1R/todo.html

Thanks!

Bruce.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-sparc64/attachments/20030509/962144dc/attachment.bin


More information about the freebsd-sparc64 mailing list