From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCEOD-0002rt-1S for qemu-devel@nongnu.org; Tue, 19 Apr 2011 13:07:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QCEOA-0006Fb-PT for qemu-devel@nongnu.org; Tue, 19 Apr 2011 13:07:01 -0400 Received: from mail-vx0-f173.google.com ([209.85.220.173]:53223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCEOA-0006FO-N5 for qemu-devel@nongnu.org; Tue, 19 Apr 2011 13:06:58 -0400 Received: by vxb41 with SMTP id 41so5238217vxb.4 for ; Tue, 19 Apr 2011 10:06:58 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1303160412-8107-12-git-send-email-aurelien@aurel32.net> References: <1303160412-8107-1-git-send-email-aurelien@aurel32.net> <1303160412-8107-12-git-send-email-aurelien@aurel32.net> Date: Tue, 19 Apr 2011 18:06:57 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 11/20] target-i386: fix helper_flbd_ST0() wrt softfloat List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org On 18 April 2011 22:00, Aurelien Jarno wrote: > Signed-off-by: Aurelien Jarno > --- > =C2=A0target-i386/op_helper.c | =C2=A0 =C2=A07 ++++--- > =C2=A01 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c > index f614893..7dddd37 100644 > --- a/target-i386/op_helper.c > +++ b/target-i386/op_helper.c > @@ -3920,9 +3920,10 @@ void helper_fbld_ST0(target_ulong ptr) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 v =3D ldub(ptr + i); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 val =3D (val * 100) + ((v >> 4) * 10) + (v & = 0xf); > =C2=A0 =C2=A0 } > - =C2=A0 =C2=A0tmp =3D val; > - =C2=A0 =C2=A0if (ldub(ptr + 9) & 0x80) > - =C2=A0 =C2=A0 =C2=A0 =C2=A0tmp =3D -tmp; > + =C2=A0 =C2=A0if (ldub(ptr + 9) & 0x80) { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0val =3D -val; > + =C2=A0 =C2=A0} > + =C2=A0 =C2=A0tmp =3D int64_to_floatx(val, &env->fp_status); > =C2=A0 =C2=A0 fpush(); > =C2=A0 =C2=A0 ST0 =3D tmp; > =C2=A0} This doesn't do the right thing for -0 (should generate -0, not +0). I think: tmp =3D int64_to_floatx(val, &env->fp_status); if (ldub(ptr + 9) & 0x80) { floatx_chs(tmp); } ought to do the right thing and work for both softfloat and sf-native, but I haven't tested it. -- PMM