From: Blue Swirl <blauwirbel@gmail.com>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] TCG: AREG0 removal planning
Date: Wed, 11 May 2011 20:25:36 +0300 [thread overview]
Message-ID: <BANLkTikbiunVxp_GWwfuMBxTeQSdq_oY_A@mail.gmail.com> (raw)
In-Reply-To: <201105102228.37340.paul@codesourcery.com>
On Wed, May 11, 2011 at 12:28 AM, Paul Brook <paul@codesourcery.com> wrote:
>> TCG uses a fixed global register (AREG0) to which points to currently
>> used CPUState, also known as 'env'. Using a fixed register has the
>> downsides that the register must be reserved by TCG for generated code
>> and by the compiler for compiling a few critical files (op_helper.c
>> etc.). The latter also means that any calls to C library may be unsafe
>> from those files.
>>
>> Here are my sketches about transition to AREG0-less world.
>> ...
>> Translators/op helpers
>> ...
>> Comments? There are a few blank spots too.
>
> I think a useful, and incremental goal is elimination of global cpu_env state
> in C code (i.e eliminate HELPER_CFLAGS and dyngen-exec.h).
> We already have much of the infrastructure for this - op_helper v.s. helper.c
> and code_gen_prologue for transition in/out of "generated code" state.
>
> In practice generated code probably accesses CPUState often enough that a
> dedicated register isn't a bad idea. My guess is that eliminating it from C
> code gets us almost all of the useful benefit. Removing it from the code
> generator (i.e. TCG_AREG0) may be more pain that it's worth.
I don't think moving the helpers from op_helper.c to helper.c will be
a performance win if AREG0 is not eliminated. The code gets to use one
register more, but AREG0 needs to be moved to a function argument
register in most cases and AREG0 has to be restored. I think the
benefit should come from generated code getting one more available
register.
TCG side doesn't look so difficult, just qemu_ld/st ops and using a
stack frame. Converting translators and helpers is a much bigger job.
> For changes to
> the TCG side we want to consider how we can provide useful aliasing
> information, rather than a naive replacement of TCG_AREG0 with a variable.
What aliasing information?
next prev parent reply other threads:[~2011-05-11 17:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-10 20:54 [Qemu-devel] TCG: AREG0 removal planning Blue Swirl
2011-05-10 21:28 ` Paul Brook
2011-05-11 17:25 ` Blue Swirl [this message]
2011-05-11 18:39 ` Lluís
2011-05-11 19:15 ` Blue Swirl
2011-05-12 15:02 ` Avi Kivity
2011-05-16 16:16 ` Paul Brook
2011-05-16 19:18 ` Blue Swirl
2011-05-10 21:31 ` Stefan Weil
2011-05-10 21:58 ` Richard Henderson
2011-05-10 22:57 ` Paul Brook
2011-05-11 17:35 ` Blue Swirl
2011-05-11 17:32 ` Blue Swirl
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=BANLkTikbiunVxp_GWwfuMBxTeQSdq_oY_A@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=paul@codesourcery.com \
--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).