From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Leon Alrae <leon.alrae@imgtec.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Aurelien Jarno <aurelien@aurel32.net>,
Thomas Schwinge <thomas@codesourcery.com>
Subject: Re: [Qemu-devel] [PATCH v2 3/7] softfloat: Convert `*_default_nan' variables into inline functions
Date: Sat, 31 Jan 2015 14:58:46 +0000 (GMT) [thread overview]
Message-ID: <alpine.LFD.2.11.1501311359500.28301@eddie.linux-mips.org> (raw)
In-Reply-To: <CAFEAcA812HZJX7yBffpkQcKTpJeeHartwYWfjtkLn8YQGbULYA@mail.gmail.com>
On Sat, 31 Jan 2015, Peter Maydell wrote:
> >> > Hmm, so perhaps my idea for a later improvement:
> >> >
> >> >> Eventually we might want to move the new inline functions into a
> >> >> separate header to be included from softfloat.h instead of softfloat.c,
> >> >> but let's make changes one step at a time.
> >> >
> >> > will actually have to be made right away. I suspect GCC is more liberal
> >> > here due to its convoluted extern/static/inline semantics history.
> >> > Sigh...
> >>
> >> I would suggest just using "static inline", as we do elsewhere
> >> for little utility functions.
> >
> > Yes, that's exactly what they'd have to be moved into a separate header
> > for.
>
> Why do they need to be moved into a different header to do this?
> I must be missing something...
This is because fpu/softfloat-specialize.h is an implementation header
private to SoftFloat and therefore such inline definitions won't be seen
by users outside SoftFloat, such as target-mips/msa_helper.c. And IMO
they shouldn't be moved into include/fpu/softfloat.h itself as this header
contains generic stuff and is supposed to have no TARGET_foo stuff, as
observed by current usage and inferred from comments in fpu/softfloat.c.
So ultimately I think the newly converted `*_default_nan' inline
functions will need to go into include/fpu/softfloat-public-specialize.h
or suchlike, which will be pulled from include/fpu/softfloat.h for general
availability.
Overall I think the whole arrangement in fpu/softfloat-specialize.h has a
potential to being cleaned up by removing all the chains of #ifdef's and
splitting the conditional bits into separate headers matching the current
variants. E.g. the presence of this construct:
#if defined(TARGET_SPARC)
const float64 float64_default_nan = const_float64(LIT64( 0x7FFFFFFFFFFFFFFF ));
#elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA)
const float64 float64_default_nan = const_float64(LIT64( 0x7FF8000000000000 ));
#elif SNAN_BIT_IS_ONE
const float64 float64_default_nan = const_float64(LIT64( 0x7FF7FFFFFFFFFFFF ));
#else
const float64 float64_default_nan = const_float64(LIT64( 0xFFF8000000000000 ));
#endif
asks for 4 independent headers defining the 4 bit pattern styles used by
targets for symbolic FP data, one each -- perhaps even pulled indirectly
via target headers rather than copying the chain of #ifdef's above around
#include's from wherever they'll be pulled.
Please correct me if I am wrong, but it appears to me possible right away
by removing fpu/softfloat-specialize.h and instead creating individual
target-*/softfloat-specialize.h headers that'll pull the right variant
each target requires from a pool of templates made available in fpu/.
Then include/fpu/softfloat.h could do the same for the public stuff (i.e.
these NaN bits concerned here) placed similarly in include/fpu/.
FWIW,
Maciej
next prev parent reply other threads:[~2015-01-31 14:58 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-09 1:54 [Qemu-devel] [PATCH 0/7] MIPS: IEEE 754-2008 features support Maciej W. Rozycki
2014-12-09 1:54 ` [Qemu-devel] [PATCH 1/7] softfloat: Fix sNaN handling in FP conversion operations Maciej W. Rozycki
2015-01-29 14:51 ` Leon Alrae
2015-02-05 16:37 ` Peter Maydell
2015-02-05 16:38 ` Peter Maydell
2015-02-06 14:37 ` Maciej W. Rozycki
2015-02-06 14:45 ` Peter Maydell
2015-02-06 19:35 ` Maciej W. Rozycki
2015-02-08 12:12 ` Maciej W. Rozycki
2014-12-09 1:54 ` [Qemu-devel] [PATCH 2/7] softfloat: Simplify `floatx80ToCommonNaN' function Maciej W. Rozycki
2015-01-28 16:15 ` Leon Alrae
2014-12-09 1:55 ` [Qemu-devel] [PATCH 3/7] softfloat: Convert `*_default_nan' variables into inline functions Maciej W. Rozycki
2014-12-12 19:34 ` [Qemu-devel] [PATCH v2 " Maciej W. Rozycki
2015-01-30 14:09 ` Leon Alrae
2015-01-30 16:02 ` Maciej W. Rozycki
2015-01-30 16:55 ` Peter Maydell
2015-01-31 11:56 ` Maciej W. Rozycki
2015-01-31 12:52 ` Peter Maydell
2015-01-31 14:58 ` Maciej W. Rozycki [this message]
2015-02-03 15:43 ` Richard Henderson
2014-12-09 1:55 ` [Qemu-devel] [PATCH 4/7] softfloat: Add SoftFloat status parameter to `*_nan' functions Maciej W. Rozycki
2014-12-09 1:55 ` [Qemu-devel] [PATCH 5/7] softfloat: Rework `*_is_*_nan' functions Maciej W. Rozycki
2014-12-12 19:35 ` [Qemu-devel] [PATCH v2 " Maciej W. Rozycki
2015-02-05 16:42 ` Peter Maydell
2014-12-09 1:55 ` [Qemu-devel] [PATCH 6/7] softfloat: Add SoftFloat status `nan2008_mode' flag Maciej W. Rozycki
2014-12-12 19:35 ` [Qemu-devel] [PATCH v2 " Maciej W. Rozycki
2015-02-05 17:00 ` Peter Maydell
2015-02-05 19:07 ` Maciej W. Rozycki
2014-12-09 1:56 ` [Qemu-devel] [PATCH 7/7] target-mips: Add IEEE 754-2008 features support Maciej W. Rozycki
2015-02-09 17:10 ` Leon Alrae
2015-02-09 20:55 ` Maciej W. Rozycki
2015-02-10 10:44 ` Leon Alrae
2015-02-10 14:30 ` Maciej W. Rozycki
2015-02-10 17:21 ` Leon Alrae
2015-02-17 13:55 ` Maciej W. Rozycki
2014-12-09 9:20 ` [Qemu-devel] [PATCH 0/7] MIPS: " Peter Maydell
2014-12-09 12:28 ` Maciej W. Rozycki
2014-12-09 12:41 ` Peter Maydell
2014-12-09 18:16 ` Maciej W. Rozycki
2015-01-30 11:59 ` Peter Maydell
2015-01-30 13:47 ` Maciej W. Rozycki
[not found] ` <54CE9614.2060805@codesourcery.com>
2015-02-03 16:28 ` Thomas Schwinge
2015-02-03 22:30 ` Maciej W. Rozycki
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=alpine.LFD.2.11.1501311359500.28301@eddie.linux-mips.org \
--to=macro@linux-mips.org \
--cc=aurelien@aurel32.net \
--cc=leon.alrae@imgtec.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thomas@codesourcery.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).