From: Aurelien Jarno <aurelien@aurel32.net>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
patches@linaro.org, Paul Brook <paul@codesourcery.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/7] target-arm: Refactor int-float conversions
Date: Sun, 15 May 2011 00:38:43 +0200 [thread overview]
Message-ID: <20110514223843.GF13600@volta.aurel32.net> (raw)
In-Reply-To: <BANLkTikj2f4rfeRUX_t6hEWz_eOC5SmyxA@mail.gmail.com>
On Sun, May 08, 2011 at 01:32:34PM +0300, Blue Swirl wrote:
> On Fri, May 6, 2011 at 7:38 PM, Paul Brook <paul@codesourcery.com> wrote:
> >> On Fri, May 6, 2011 at 5:09 PM, Paul Brook <paul@codesourcery.com> wrote:
> >> >> The Neon versions of int-float conversions need their own helper
> >> >> routines because they must use the "standard FPSCR" rather than the
> >> >> default one. Refactor the helper functions to make it easy to add the
> >> >> neon versions. While we're touching the code, move the helpers to
> >> >> op_helper.c so that we can use the global env variable rather than
> >> >> passing it as a parameter.
> >> >
> >> > IMO this is going in the wrong direction. We should in aiming for less
> >> > implicit accesses to cpu state, not more.
> >>
> >> Performance wise global env variable is faster and the register is
> >> always available.
> >
> > Not entirely true. Reserving the global env variable has significant cost,
> > especially on hosts with limited register sets (i.e. x86). It's also a rather
> > fragile hack. There's a fairly long history of nasy hacks and things that
> > just don't work in this context. For example you can't reliably include
> > stdio.h from these files, and they often break if you turn optimization off,
> > which makes debugging much harder than it should be.
>
> Even if we don't reserve the register, in many cases a corresponding
> pointer to CPUState will be needed. But there will still be the
> advantage that this temporary pointer can be discarded while the
> globally reserved register is reserved forever.
>
> >> Do you mean that we should aim to get rid of special
> >> status of global env, so that if no op uses it, it could be discarded
> >> to free a register?
> >
> > That's already true for most of qemu. IMO more interesting is being able to
> > tell TCG that helpers don't mess with cpu state in opaque ways. In theory
> > it's already possible to do that manually. However that tends to be somewhat
> > fragile, relying on careful maintenance and code code auditing, with mistakes
> > triggering subtle hard-to-debug failures. Much better to avoid the implicit
> > global interface and make all helper arguments explicit.
>
> OK. This will be a major refactoring, but given the expected
> performance increase, it should be done.
>
We might want to do it from the cleanliness point of view, but i really
doubt we should expect performance increase from this (actually i think
it will be the contrary).
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2011-05-14 22:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-06 12:48 [Qemu-devel] [PATCH 0/7] target-arm: Fix bugs in fp exception flag setting Peter Maydell
2011-05-06 12:48 ` [Qemu-devel] [PATCH 1/7] target-arm: Don't set FP exceptions in recip, recip_sqrt estimate fns Peter Maydell
2011-05-06 12:48 ` [Qemu-devel] [PATCH 2/7] target-arm: Signal InputDenormal for VRECPE, VRSQRTE, VRECPS, VRSQRTS Peter Maydell
2011-05-06 12:48 ` [Qemu-devel] [PATCH 3/7] target-arm: Signal InvalidOp for Neon GE and GT compares of QNaN Peter Maydell
2011-05-06 12:48 ` [Qemu-devel] [PATCH 4/7] target-arm: Refactor int-float conversions Peter Maydell
2011-05-06 14:09 ` Paul Brook
2011-05-06 14:42 ` Peter Maydell
2011-05-06 15:30 ` Blue Swirl
2011-05-06 16:38 ` Paul Brook
2011-05-08 10:32 ` Blue Swirl
2011-05-14 22:38 ` Aurelien Jarno [this message]
2011-05-06 12:48 ` [Qemu-devel] [PATCH 5/7] target-arm: Add separate Neon float-int conversion helpers Peter Maydell
2011-05-06 12:48 ` [Qemu-devel] [PATCH 6/7] softfloat: Add new flag for when denormal result is flushed to zero Peter Maydell
2011-05-06 12:48 ` [Qemu-devel] [PATCH 7/7] target-arm: Signal Underflow when denormal flushed to zero on output Peter Maydell
2011-05-17 18:19 ` [Qemu-devel] [PATCH 0/7] target-arm: Fix bugs in fp exception flag setting 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=20110514223843.GF13600@volta.aurel32.net \
--to=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=patches@linaro.org \
--cc=paul@codesourcery.com \
--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.