From owner-freebsd-sparc64@FreeBSD.ORG Fri May 9 13:46:56 2003 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 56E5C37B401; Fri, 9 May 2003 13:46:56 -0700 (PDT) Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9EF2F43FE3; Fri, 9 May 2003 13:46:55 -0700 (PDT) (envelope-from bmah@employees.org) Received: from bmah.dyndns.org (12-240-204-110.client.attbi.com[12.240.204.110]) by attbi.com (rwcrmhc51) with ESMTP id <2003050920465505100bv4kee>; Fri, 9 May 2003 20:46:55 +0000 Received: from intruder.bmah.org (localhost [127.0.0.1]) by bmah.dyndns.org (8.12.9/8.12.9) with ESMTP id h49Kksrh011106; Fri, 9 May 2003 13:46:54 -0700 (PDT) (envelope-from bmah@intruder.bmah.org) Received: (from bmah@localhost) by intruder.bmah.org (8.12.9/8.12.9/Submit) id h49KkrfI011105; Fri, 9 May 2003 13:46:53 -0700 (PDT) (envelope-from bmah) Date: Fri, 9 May 2003 13:46:53 -0700 From: "Bruce A. Mah" To: Eric Anholt Message-ID: <20030509204653.GA11053@intruder.bmah.org> References: <20030116072448.GA29468@rot13.obsecurity.org> <20030116201728.GA279@crow.dom2ip.de> <20030408003332.GA60864@rot13.obsecurity.org> <20030507221133.GA678@crow.dom2ip.de> <1052347524.1070.10.camel@leguin> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <1052347524.1070.10.camel@leguin> User-Agent: Mutt/1.4.1i X-Image-Url: http://www.employees.org/~bmah/Images/bmah-cisco-small.gif X-url: http://www.employees.org/~bmah/ cc: Thomas Moestl cc: Kris Kennaway cc: sparc64@FreeBSD.org Subject: Re: assembler error in XFree86 snapshot X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2003 20:46:56 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 immedia= te > > > > here; however, it chooses to output it as an unsigned number and do= es > > > > not sign-extended it from 32 to 64 bit. > > > >=20 > > > > 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 upp= er > > > > 32 bits even if a particular instruction does not use them. > > > >=20 > > > > 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 b= it > > > > more testing. > > >=20 > > > *Ping* > > >=20 > > > Someone needs to take this up with the gcc developers so it can get f= ixed. > >=20 > > 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? > >=20 > > Thanks, > > - Thomas >=20 > 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. --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE+vBO92MoxcVugUsMRApSCAJ96enmD51T5d0gql7Bb/ar54nZ44ACfbXBV mHm0/56I7frfEqN6aY6pL+4= =FI7O -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf--