qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: biswaranjan panda <biswaranjan.nitrkl@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] gen_icount_start
Date: Mon, 31 Dec 2012 01:01:06 +0000	[thread overview]
Message-ID: <CAFEAcA-o8-itfAdRAQWex+g5ZPE707P9vswc6bFe6yGHPLf=UQ@mail.gmail.com> (raw)
In-Reply-To: <CADHAf1YKm8njKRRe6p4_ADxMS2Yu+geCvw5DteqbjEvajesFaA@mail.gmail.com>

On 30 December 2012 23:14, biswaranjan panda
<biswaranjan.nitrkl@gmail.com> wrote:
> What I understand is that in gen_icount_start 'icount_arg' keeps a pointer
> to gen_opparam_ptr which is used in gen_icount_end to patch up the value . I
> however didnt understand what the 'horrid hack' is about. Can any one give
> me some idea on this ?

My guess is that it's a hack because it's a layering violation. Functions
that generate TCG (intermediate representation) should do it by calling
the tcg_ functions, and the data structures and variables like
gen_opparam_ptr should be internal to the TCG layer. However here we
rely on knowing implementation details of how the TCG layer actually writes
out the ops and parameters when you call tcg_gen_subi_i32().
A clean design would make the TCG layer provide some kind of API for
writing out code and then fixing up the values afterwards, but on the other
hand if we only have one use case...

-- PMM

  reply	other threads:[~2012-12-31  1:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-30 23:14 [Qemu-devel] gen_icount_start biswaranjan panda
2012-12-31  1:01 ` Peter Maydell [this message]
2013-01-18 20:44   ` biswaranjan panda

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-o8-itfAdRAQWex+g5ZPE707P9vswc6bFe6yGHPLf=UQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=biswaranjan.nitrkl@gmail.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).