From: Aurelien Jarno <aurelien@aurel32.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 11/20] target-i386: fix helper_flbd_ST0() wrt softfloat
Date: Wed, 20 Apr 2011 11:37:17 +0200 [thread overview]
Message-ID: <20110420093717.GF6388@volta.aurel32.net> (raw)
In-Reply-To: <BANLkTi=u27kQ27=1Q0EVK5cUfvGKPNTqPg@mail.gmail.com>
On Tue, Apr 19, 2011 at 06:06:57PM +0100, Peter Maydell wrote:
> On 18 April 2011 22:00, Aurelien Jarno <aurelien@aurel32.net> wrote:
> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > ---
> > target-i386/op_helper.c | 7 ++++---
> > 1 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)
> > v = ldub(ptr + i);
> > val = (val * 100) + ((v >> 4) * 10) + (v & 0xf);
> > }
> > - tmp = val;
> > - if (ldub(ptr + 9) & 0x80)
> > - tmp = -tmp;
> > + if (ldub(ptr + 9) & 0x80) {
> > + val = -val;
> > + }
> > + tmp = int64_to_floatx(val, &env->fp_status);
> > fpush();
> > ST0 = tmp;
> > }
>
> This doesn't do the right thing for -0 (should generate -0,
> not +0). I think:
>
> tmp = 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.
>
Good catch, this solution works. Thanks.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2011-04-20 9:52 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-18 20:59 [Qemu-devel] [PATCH 00/20] target-i386 conversion to softfloat Aurelien Jarno
2011-04-18 20:59 ` [Qemu-devel] [PATCH 01/20] softfloat: fix floatx80 handling of NaN Aurelien Jarno
2011-04-19 10:53 ` Peter Maydell
2011-04-20 9:02 ` Aurelien Jarno
2011-04-18 20:59 ` [Qemu-devel] [PATCH 02/20] softfloat: fix floatx80_is_infinity() Aurelien Jarno
2011-04-19 10:55 ` Peter Maydell
2011-04-18 20:59 ` [Qemu-devel] [PATCH 03/20] softfloat: add floatx80 constants Aurelien Jarno
2011-04-19 11:07 ` Peter Maydell
2011-04-20 9:05 ` Aurelien Jarno
2011-04-18 20:59 ` [Qemu-devel] [PATCH 04/20] softfloat: add pi constants Aurelien Jarno
2011-04-19 11:10 ` Peter Maydell
2011-04-20 9:05 ` Aurelien Jarno
2011-04-18 20:59 ` [Qemu-devel] [PATCH 05/20] softfloat-native: add a few constant values Aurelien Jarno
2011-04-19 11:12 ` Peter Maydell
2011-04-18 20:59 ` [Qemu-devel] [PATCH 06/20] softfloat: add floatx80_compare*() functions Aurelien Jarno
2011-04-19 11:16 ` Peter Maydell
2011-04-18 20:59 ` [Qemu-devel] [PATCH 07/20] softfloat: fix float*_scalnb() corner cases Aurelien Jarno
2011-04-19 11:57 ` Peter Maydell
2011-04-20 9:21 ` Aurelien Jarno
2011-04-18 21:00 ` [Qemu-devel] [PATCH 08/20] softfloat-native: fix float*_scalbn() functions Aurelien Jarno
2011-04-19 12:35 ` Peter Maydell
2011-04-18 21:00 ` [Qemu-devel] [PATCH 09/20] softfloat-native: add float*_is_any_nan() functions Aurelien Jarno
2011-04-19 12:42 ` Peter Maydell
2011-04-20 9:22 ` Aurelien Jarno
2011-04-18 21:00 ` [Qemu-devel] [PATCH 10/20] target-i386: fix helper_fscale() wrt softfloat Aurelien Jarno
2011-04-19 16:57 ` Peter Maydell
2011-04-18 21:00 ` [Qemu-devel] [PATCH 11/20] target-i386: fix helper_flbd_ST0() " Aurelien Jarno
2011-04-19 17:06 ` Peter Maydell
2011-04-20 9:37 ` Aurelien Jarno [this message]
2011-04-18 21:00 ` [Qemu-devel] [PATCH 12/20] target-i386: fix helper_fxtract() " Aurelien Jarno
2011-04-19 17:46 ` Peter Maydell
2011-04-18 21:00 ` [Qemu-devel] [PATCH 13/20] target-i386: fix helper_fdiv() " Aurelien Jarno
2011-04-19 17:11 ` Peter Maydell
2011-04-20 9:37 ` Aurelien Jarno
2011-04-18 21:00 ` [Qemu-devel] [PATCH 14/20] target-i386: fix helper_fsqrt() " Aurelien Jarno
2011-04-19 17:13 ` Peter Maydell
2011-04-18 21:00 ` [Qemu-devel] [PATCH 15/20] target-i386: replace approx_rsqrt and approx_rcp by softfloat ops Aurelien Jarno
2011-04-19 17:20 ` Peter Maydell
2011-04-18 21:00 ` [Qemu-devel] [PATCH 16/20] target-i386: add CPU86_LDouble <-> double conversion functions Aurelien Jarno
2011-04-19 17:31 ` Peter Maydell
2011-04-18 21:00 ` [Qemu-devel] [PATCH 17/20] target-i386: fix logarithmic and trigonometric helpers wrt softfloat Aurelien Jarno
2011-04-19 17:37 ` Peter Maydell
2011-04-20 9:41 ` Aurelien Jarno
2011-04-18 21:00 ` [Qemu-devel] [PATCH 18/20] target-i386: fix helper_fprem() and helper_fprem1() " Aurelien Jarno
2011-04-19 17:41 ` Peter Maydell
2011-04-18 21:00 ` [Qemu-devel] [PATCH 19/20] target-i386: fix constants " Aurelien Jarno
2011-04-19 17:26 ` Peter Maydell
2011-04-18 21:00 ` [Qemu-devel] [PATCH 20/20] target-i386: switch to softfloat Aurelien Jarno
2011-04-19 17:28 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110420093717.GF6388@volta.aurel32.net \
--to=aurelien@aurel32.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).