From: Aurelien Jarno <aurelien@aurel32.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Christophe Lyon <christophe.lyon@st.com>,
qemu-devel@nongnu.org, g@hall.aurel32.net
Subject: Re: [Qemu-devel] [PATCH 2/4] softfloat: add float32_set_sign(), float32_infinity, float64_half, float64_256 and float64_512.
Date: Sun, 20 Feb 2011 23:20:33 +0100 [thread overview]
Message-ID: <20110220222033.GP4580@hall.aurel32.net> (raw)
In-Reply-To: <AANLkTi=agwV+zDfsdjDo=3b12n9QpDO_XURYQnum=5K=@mail.gmail.com>
On Sun, Feb 20, 2011 at 10:09:46PM +0000, Peter Maydell wrote:
> On 20 February 2011 21:52, Aurelien Jarno <aurelien@aurel32.net> wrote:
> > On Fri, Feb 18, 2011 at 03:49:15PM +0100, Christophe Lyon wrote:
>
> >> +#define float64_half make_float64(0x3fe0000000000000LL)
> >> +#define float64_256 make_float64(0x4070000000000000LL)
> >> +#define float64_512 make_float64(0x4080000000000000LL)
> >>
> >> /*----------------------------------------------------------------------------
> >> | The pattern for a default generated double-precision NaN.
> >
> > While it's probably a good idea to define the commonly used values in
> > softfloat.h, I don't think we should have all the values used by the
> > different targets here. Infinity, one, half, two probably have their
> > place here, I don't think it's the case of 256 and 512. It should be
> > better to defined them at the target level.
>
> Are you happy with targets just doing make_float*() on a
> bit pattern? I guess that's the most straightforward thing,
Yes, I think it is the way to go.
> although at the moment the target-arm code seems to prefer
> float32 three = int32_to_float32(3, s);
> I don't care very much personally as long as we're not doing
> a runtime division to get a constant 0.5 :-)
Doing that at runtime is clearly not a good solution.
> Incidentally, if you're up for some target-mips cleanup:
> target-mips/op_helper.c:#define FLOAT_ONE32 make_float32(0x3f8 << 20)
>
> could be using float32_one instead. (ditto for float64).
Yes, one is a really common value among target, and in my opinion we
should keep it in softfloat.h. I have a local patch that does this
cleanup and also moves the constant 2 to softfloat.h. I'll submit it one
day with other mips softfloat cleanup.
> > Also for consistency, I
> > think it's better to define these value for all float size, or at least
> > for all the common ones (32, 64, maybe 16).
>
> I wouldn't bother with 16, only ARM uses that and only for
> conversions to other formats.
>
That's true, so let's do it float 32 and 64.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2011-02-20 22:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-18 14:49 [Qemu-devel] [PATCH v4 0/4] ARM: fix Neon VRECPE and VRSQRTE instructions Christophe Lyon
2011-02-18 14:49 ` [Qemu-devel] [PATCH 1/4] softfloat: move all default NaN definitions to softfloat.h Christophe Lyon
2011-02-20 21:49 ` Aurelien Jarno
2011-02-18 14:49 ` [Qemu-devel] [PATCH 2/4] softfloat: add float32_set_sign(), float32_infinity, float64_half, float64_256 and float64_512 Christophe Lyon
2011-02-20 21:52 ` Aurelien Jarno
2011-02-20 22:09 ` Peter Maydell
2011-02-20 22:20 ` Aurelien Jarno [this message]
2011-02-21 9:59 ` Christophe Lyon
2011-02-18 14:49 ` [Qemu-devel] [PATCH 3/4] target-arm: fix support for VRECPE Christophe Lyon
2011-02-18 14:49 ` [Qemu-devel] [PATCH 4/4] target-arm: fix support for VRSQRTE Christophe Lyon
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=20110220222033.GP4580@hall.aurel32.net \
--to=aurelien@aurel32.net \
--cc=christophe.lyon@st.com \
--cc=g@hall.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.