All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] gcc as a backend to generate better code
@ 2003-10-15  1:16 Johan Rydberg
  2003-10-15  8:18 ` Fabrice Bellard
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Rydberg @ 2003-10-15  1:16 UTC (permalink / raw)
  To: qemu-devel


The TODO file states the following:

- use gcc as a backend to generate better code (easy to do by using
  op-i386.c operations as local inline functions).

How would this be done, actually?

-- 
Johan Rydberg, Free Software Developer, Sweden
http://rtmk.sf.net | http://www.nongnu.org/guss/

Playing david kitt - saturdays

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] gcc as a backend to generate better code
  2003-10-15  1:16 [Qemu-devel] gcc as a backend to generate better code Johan Rydberg
@ 2003-10-15  8:18 ` Fabrice Bellard
  2003-10-15  8:24   ` Chad Page
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Bellard @ 2003-10-15  8:18 UTC (permalink / raw)
  To: qemu-devel

Johan Rydberg wrote:
> The TODO file states the following:
> 
> - use gcc as a backend to generate better code (easy to do by using
>   op-i386.c operations as local inline functions).
> 
> How would this be done, actually?

The executable is launched at least once with the standard QEMU to 
record translation block statistics, location and code reference (from 
which file it comes, at which offset).

Then an off-line tool is launched to convert recorded translation blocks 
to a .so file using gcc by generating C code from each micro operation.

When QEMU is launched again, it can scan a directory containing .so 
files for all statically compiled programs. Then it can load the 
corresponding .so file and use the translated blocks stored inside.

With this method, only heavily used translations blocks are compiled 
with gcc. The rest is translated with QEMU.

Fabrice.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] gcc as a backend to generate better code
  2003-10-15  8:18 ` Fabrice Bellard
@ 2003-10-15  8:24   ` Chad Page
  0 siblings, 0 replies; 3+ messages in thread
From: Chad Page @ 2003-10-15  8:24 UTC (permalink / raw)
  To: qemu-devel


	Sounds interesting.  Perhaps the off-line tool could be run
directly from qemu to facilitate ease of use.  Then to the end user it
would appear to run faster each time you use it.

	Also if the off-line tool could successfully dissaemble enough of
the program without running it, it could be precompiled before the first
invocation.  It might be too difficult to follow all code paths, though,
but you'ld know that :)

	- Chad


On Wed, 15 Oct 2003, Fabrice Bellard wrote:

> Johan Rydberg wrote:
> > The TODO file states the following:
> > 
> > - use gcc as a backend to generate better code (easy to do by using
> >   op-i386.c operations as local inline functions).
> > 
> > How would this be done, actually?
> 
> The executable is launched at least once with the standard QEMU to 
> record translation block statistics, location and code reference (from 
> which file it comes, at which offset).
> 
> Then an off-line tool is launched to convert recorded translation blocks 
> to a .so file using gcc by generating C code from each micro operation.
> 
> When QEMU is launched again, it can scan a directory containing .so 
> files for all statically compiled programs. Then it can load the 
> corresponding .so file and use the translated blocks stored inside.
> 
> With this method, only heavily used translations blocks are compiled 
> with gcc. The rest is translated with QEMU.
> 
> Fabrice.
> 
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://mail.nongnu.org/mailman/listinfo/qemu-devel
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-15  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-15  1:16 [Qemu-devel] gcc as a backend to generate better code Johan Rydberg
2003-10-15  8:18 ` Fabrice Bellard
2003-10-15  8:24   ` Chad Page

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.