Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kpg80-0006vR-4S for qemu-devel@nongnu.org; Tue, 14 Oct 2008 05:23:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kpg7y-0006ug-2i for qemu-devel@nongnu.org; Tue, 14 Oct 2008 05:23:42 -0400 Received: from [199.232.76.173] (port=52397 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kpg7w-0006uO-Rq for qemu-devel@nongnu.org; Tue, 14 Oct 2008 05:23:41 -0400 Received: from hall.aurel32.net ([88.191.82.174]:54535) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kpg7w-0007wa-92 for qemu-devel@nongnu.org; Tue, 14 Oct 2008 05:23:40 -0400 Received: from volta.aurel32.net ([2002:52e8:2fb:1:21e:8cff:feb0:693b]) by hall.aurel32.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Kpg7v-0007Cl-2q for qemu-devel@nongnu.org; Tue, 14 Oct 2008 11:23:39 +0200 Received: from aurel32 by volta.aurel32.net with local (Exim 4.69) (envelope-from ) id 1Kpg7u-0005Xh-JI for qemu-devel@nongnu.org; Tue, 14 Oct 2008 11:23:38 +0200 Date: Tue, 14 Oct 2008 11:23:38 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [ARM] Problem in a NEON instruction Message-ID: <20081014092338.GA13141@volta.aurel32.net> References: <761ea48b0806100332r16fc2eafxa2e9db5e5afadeb4@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <761ea48b0806100332r16fc2eafxa2e9db5e5afadeb4@mail.gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Tue, Jun 10, 2008 at 12:32:17PM +0200, Laurent Desnogues wrote: > The rshl instruction is faulty. Note I did not check the correctness > of that instruction in general, I only made a change that looked logical. > > > Laurent > --- svn-ref/target-arm/neon_helper.c 2008-06-09 08:52:48.000000000 +0200 > +++ svn/target-arm/neon_helper.c 2008-06-10 12:27:38.000000000 +0200 > @@ -456,7 +456,7 @@ > if (tmp >= sizeof(src1) * 8) { \ > dest = 0; \ > } else if (tmp < -sizeof(src1) * 8) { \ > - dest >>= sizeof(src1) * 8 - 1; \ > + dest = src1 >> (sizeof(src1) * 8 - 1); \ > } else if (tmp == -sizeof(src1) * 8) { \ > dest = src1 >> (tmp - 1); \ > dest++; \ Your patch is indeed correct. It seems there is another mistake (at least compared to the 64-bit version) in this instruction, please find an updated patch below. diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c index 4ee5658..35fbaf5 100644 --- a/target-arm/neon_helper.c +++ b/target-arm/neon_helper.c @@ -456,11 +456,11 @@ uint64_t HELPER(neon_shl_s64)(uint64_t valop, uint64_t shiftop) if (tmp >= sizeof(src1) * 8) { \ dest = 0; \ } else if (tmp < -sizeof(src1) * 8) { \ - dest >>= sizeof(src1) * 8 - 1; \ + dest = src1 >> (sizeof(src1) * 8 - 1); \ } else if (tmp == -sizeof(src1) * 8) { \ dest = src1 >> (tmp - 1); \ dest++; \ - src2 >>= 1; \ + dest >>= 1; \ } else if (tmp < 0) { \ dest = (src1 + (1 << (-1 - tmp))) >> -tmp; \ } else { \ -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net