From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ne6mb-0002zW-Q3 for qemu-devel@nongnu.org; Sun, 07 Feb 2010 08:02:39 -0500 Received: from [199.232.76.173] (port=45294 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ne6mZ-0002wa-Cb for qemu-devel@nongnu.org; Sun, 07 Feb 2010 08:02:35 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ne6mX-0006zp-D3 for qemu-devel@nongnu.org; Sun, 07 Feb 2010 08:02:34 -0500 Received: from mail-pz0-f187.google.com ([209.85.222.187]:56569) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ne6mW-0006zS-U0 for qemu-devel@nongnu.org; Sun, 07 Feb 2010 08:02:33 -0500 Received: by pzk17 with SMTP id 17so1282823pzk.4 for ; Sun, 07 Feb 2010 05:02:31 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <761ea48b1002070454j365537an16ef9a767ab8c199@mail.gmail.com> References: <1265385151-11024-1-git-send-email-riku.voipio@iki.fi> <1265385151-11024-5-git-send-email-riku.voipio@iki.fi> <761ea48b1002070454j365537an16ef9a767ab8c199@mail.gmail.com> Date: Sun, 7 Feb 2010 14:02:31 +0100 Message-ID: <761ea48b1002070502yaf00e06x9630b3fea7e5c106@mail.gmail.com> Subject: Re: [Qemu-devel] [PATCH 4/4] target-arm: neon fix From: Laurent Desnogues Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio Cc: qemu-devel@nongnu.org On Sun, Feb 7, 2010 at 1:54 PM, Laurent Desnogues wrote: > On Fri, Feb 5, 2010 at 4:52 PM, Riku Voipio wrote: >> From: Juha Riihim=E4ki >> >> add an extra check in "two registers and a shift" to ensure element >> size decoding logic cannot fail. >> >> Signed-off-by: Juha Riihim=E4ki >> Signed-off-by: Riku Voipio >> --- >> =A0target-arm/translate.c | =A0 =A03 ++- >> =A01 files changed, 2 insertions(+), 1 deletions(-) >> >> diff --git a/target-arm/translate.c b/target-arm/translate.c >> index 743b846..8bba034 100644 >> --- a/target-arm/translate.c >> +++ b/target-arm/translate.c >> @@ -4567,8 +4567,9 @@ static int disas_neon_data_insn(CPUState * env, Di= sasContext *s, uint32_t insn) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 size =3D 3; >> =A0 =A0 =A0 =A0 =A0 =A0 } else { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 size =3D 2; >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0while (size && (insn & (1 << (size + 19= ))) =3D=3D 0) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0while (size && (insn & (1 << (size + 19= ))) =3D=3D 0) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 size--; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> =A0 =A0 =A0 =A0 =A0 =A0 } >> =A0 =A0 =A0 =A0 =A0 =A0 shift =3D (insn >> 16) & ((1 << (3 + size)) - 1)= ; >> =A0 =A0 =A0 =A0 =A0 =A0 /* To avoid excessive dumplication of ops we imp= lement shift > > I think there's a patch ordering problem that makes > the comment and the change not agree :-) BTW I don't think adding the check for size is needed here. The encoding at that point looks like this: 3322222222221111111111 10987654321098765432109876543210 1111001_1___1______________1____ 1111001_1__1_______________1____ 1111001_1_1________________1____ so it will stop for size =3D=3D 0 given that bit 19 will have to be set. Laurent