From: Peter Maydell <peter.maydell@linaro.org>
To: Xin Tong Utoronto <x.tong@utoronto.ca>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] op-helper.c vs helper.c
Date: Mon, 19 Sep 2011 14:49:54 +0100 [thread overview]
Message-ID: <CAFEAcA-ZNPryCJyC3G4fB0SoCG44i1DpMipthovr5EEWQ4=fPQ@mail.gmail.com> (raw)
In-Reply-To: <CAAd4iBkEU-+m=oogp8KReTxq2Z0MMCyHNz9_+YqEWL4Gwd4Uow@mail.gmail.com>
On 19 September 2011 13:06, Xin Tong Utoronto <x.tong@utoronto.ca> wrote:
> There are 2 files on helpers in target-ppc and target-i386 ( op-helper.c
> helper.c), what are their differences ? also, what kind of functions are
> typically emulated using helpers ?
The key difference is that op_helper.c is compiled with compiler
flags and includes header files that give it access to a global
variable 'CPUState *env' which is kept in a fixed CPU register
during execution of translated code. helper.c (and other foo_helper.c
files) are built as regular C files, and so if they need access to the
CPU state it has to be passed into the helper as an explicit parameter.
We're currently trying to cut back on the use of the implicit global,
so new helper functions should probably go in helper.c.
> also, what kind of functions are typically emulated using helpers ?
Anything that seems too hard to do inline :-) tcg/README has a
paragraph at the end giving some rules of thumb.
-- PMM
next prev parent reply other threads:[~2011-09-19 13:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-19 12:06 [Qemu-devel] op-helper.c vs helper.c Xin Tong Utoronto
2011-09-19 12:09 ` Alexander Graf
2011-09-19 13:49 ` Peter Maydell [this message]
2011-09-22 13:09 ` Xin Tong Utoronto
2011-09-22 13:49 ` Peter Maydell
2011-09-24 8:15 ` 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='CAFEAcA-ZNPryCJyC3G4fB0SoCG44i1DpMipthovr5EEWQ4=fPQ@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=x.tong@utoronto.ca \
/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).