guss-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[guss-hackers] dynamic binary translation


From: Johan Rydberg
Subject: [guss-hackers] dynamic binary translation
Date: Sun, 1 Jun 2003 19:44:36 +0200


Hi,

Me and Jeroen has decided to rewrite the simulator engine and
turn it into a dynamic binary translation (DBT).  This does not
mean that all the work I have put into the current verion of GUSS
will be lost.  Code can and will be re-used.

The common approach for a DBT engine is to translate the simulated
code in units of basic blocks.  A basic block is a chunk of code
that is terminated by a cti (control transfer instruction) instruction
(cond or non-cond).  This normally results is very short basic block
(common length is 4-8 insns).

Another approach is to translate until a non-cti insn is encountered.
This make it possible to make inner basic block optimizations such as
common subexpression elimination and loop optimizations.  But it
introduces several complications.

A problem with a DBT engine is to know what to translate into native
code.  Large parts of a program is only executed once, so it might be
a waste of host cycles to translate that code into native code.
A better way is to use a some what fast interpreter for these parts
and just translate sections that is frequently executed.

Another problem is to make the engine as portable as possible.  It
is just stupid to have to adjust all targets when porting to a new
host.  A better idea is to translate the simulated instructions into
micro instructions, pretty much as a modern CISC processor does.
Optimization can then be done on these micro instruction.  This is
the way Valgrind [1] does it. Comments and questions are most welcome.

Best Regards,
Johan.

Some papers on dynamic binary translation:

 Fast Machine-Adaptable Dynamic Binary Translation
 (Workshop on Binary Translation 2001)
 http://www.complang.tuwien.ac.at/schani/papers/bintrans.ps.gz

 Embra: Fast and Flexible Machine Simulation.
 ftp://www-flash.stanford.edu/pub/hive/SIGMetrics96-embra.ps
 http://www-flash.stanford.edu/Embra/

 QEMU  http://savannah.nongnu.org/projects/qemu

 The design and implementation of Valgrind
 http://developer.kde.org/~sewardj/docs-1.9.5/mc_techdocs.html

References:

 [1] http://developer.kde.org/~sewardj/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]