From: Peter Maydell <peter.maydell@linaro.org>
To: Xiangyu Hu <xiangyu.a.hu@gmail.com>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] softfloat: roundAndPackFloat16 should return FPInfinity and FPMaxNormal based on overflow_to_inf.
Date: Thu, 12 Feb 2015 06:32:09 +0000 [thread overview]
Message-ID: <CAFEAcA8Jxf9rfCoPxbC1KwxJHyKjgrL6dGmS2L+1soFAzWAnPw@mail.gmail.com> (raw)
In-Reply-To: <CAHPvpuRkQnT1e4diARsNqNBA1DotzPNS1=PLho2ndXiaf9zzGQ@mail.gmail.com>
On 12 February 2015 at 06:25, Xiangyu Hu <xiangyu.a.hu@gmail.com> wrote:
> On Wed, Feb 11, 2015 at 5:23 AM, Peter Maydell <peter.maydell@linaro.org>
> wrote:
>>
>> On 9 February 2015 at 14:56, Xiangyu Hu <libhu.so@gmail.com> wrote:
>> > Flag overflow_to_inf is specified by ARM manual to decide if
>> > FPInfinity(sign) or FPMaxNormal(sign) is returned. Current
>> > codepath fails to check it.
>> > Fixed by adding overflow_to_inf flag to return infinity when it's
>> > true and maxnormal otherwise.
>>
>> I agree that this is wrong, but I think we want to fix it by
>> making roundAndPackFloat16 work more similarly to the
>> roundAndPackFloat32 and 64 functions...
>
>
> Yes. Actually, a lot of single/double_to_half instructions would lead to
> inconsistent errors
> when calling roundAndPackFloat16. This fix on FPMaxNormal/FPInfinity
> handling
> only recover some of them. Failure to justify "round_up" flag described in
> the manual
> exposed other bugs.
I'm not surprised there are other bugs lurking here.
> I had another implementation that completely followed manual's FPRound(),
> which
> brought no failed cases at all.
I'd prefer to fix the bugs we have rather than totally
reimplement, though (especially since the ARM ARM pseudocode
tends to assume things like infinite-precision floating
point types; it's not always a great model to copy).
> I wonder where current algrithm of roundAndPackFloat16 comes from?
It was added ages ago as part of supporting the ARM 16-bit
fp types; upstream softfloat doesn't have any 16-bit fp
support.
-- PMM
next prev parent reply other threads:[~2015-02-12 6:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-09 14:56 [Qemu-devel] [PATCH] softfloat: roundAndPackFloat16 should return FPInfinity and FPMaxNormal based on overflow_to_inf Xiangyu Hu
2015-02-11 13:23 ` Peter Maydell
2015-02-12 6:25 ` Xiangyu Hu
2015-02-12 6:32 ` Peter Maydell [this message]
2015-02-12 6:29 ` Xiangyu Hu
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=CAFEAcA8Jxf9rfCoPxbC1KwxJHyKjgrL6dGmS2L+1soFAzWAnPw@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=xiangyu.a.hu@gmail.com \
/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).