qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "André Braga" <meianoite@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Profiling Qemu for speed?
Date: Sun, 17 Apr 2005 23:39:44 -0300	[thread overview]
Message-ID: <2ad73a0504171939154235f5@mail.gmail.com> (raw)
In-Reply-To: <20050418013615.89123.qmail@web51604.mail.yahoo.com>

The problem with table lookups (I'm assuming you're talking about
function pointer vectors) is that they *destroy* spatial locality of
reference that you could otherwise attain by having series of
if-then-else instructions and some clever instruction prefetching
mechanism on modern processors... Not to mention the function call
overhead.


However, for puely aesthetical reasons:
(Disclaimer: I'm not familiar (lack of time, sorry) with what
disas_insn does apart from what is obviously implied by its name, so
maybe the following may make any sense or not...)

If it happens to be the case that disas_insn decodes the instruction
and then proceeds to the native implementation of the opcode in
question, if you used the table lookup only to find the function entry
point and then paste its CONTENT on a code buffer and then concatenate
this with the rest of the translated code, and the whole basic block
would be run from there from that part on (caveat self-modifying
code), then it would really clean up that piece of code. But I suspect
it wouldn't be any faster than the current approach.


-- 
"A year spent in artificial intelligence is enough to make one believe
in God"-Alan J. Perlis


2005/4/17, Nathaniel G H <rice_burners_suck@yahoo.com>:
> Unless someone can show me that GCC produces table-lookups for the
> switches in disas_insn(), there's a good opportunity for increased
> speed by doing this manually. Do you agree with this assessment?
> 
> Please let me know if I'm on the right track. :-)

  parent reply	other threads:[~2005-04-18  3:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-17  5:58 [Qemu-devel] Profiling Qemu for speed? Joe Luser
2005-04-17  8:21 ` John R. Hogerhuis
2005-04-17  8:59   ` Jonas Maebe
2005-04-17 10:27     ` Paul Brook
2005-04-17 10:46       ` Jonas Maebe
2005-04-18  1:36         ` Nathaniel G H
2005-04-18  2:11           ` John R. Hogerhuis
2005-04-18  2:39           ` André Braga [this message]
2005-04-18  4:31             ` Karl Magdsick
2005-04-17 10:36 ` Paul Brook
  -- strict thread matches above, loose matches on Subject: below --
2005-04-18  8:35 Daniel J Guinan
2005-04-18  9:51 ` Ian Rogers
2005-04-18 13:44   ` Daniel Egger
2005-04-18 14:12     ` Christian MICHON
2005-04-18 14:29       ` Ian Rogers
2005-04-18 14:19     ` Ian Rogers
2005-04-18 14:40     ` Paul Brook
2005-04-18 11:24 Daniel J Guinan

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=2ad73a0504171939154235f5@mail.gmail.com \
    --to=meianoite@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).