Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch > #1688

Re: Beyond binary compatibility

From torbenm@diku.dk (Torben Ægidius Mogensen)
Newsgroups comp.arch
Subject Re: Beyond binary compatibility
References <ab5bb675-b6cb-4e96-867f-22ebd2b6d11e@glegroupsg2000goo.googlegroups.com>
Date 2011-05-19 12:49 +0200
Message-ID <7zsjsbartp.fsf@ask.diku.dk> (permalink)
Organization SunSITE.dk - Supporting Open source

Show all headers | View raw


"Paul A. Clayton" <paaronclayton@gmail.com> writes:

> It seems that there are some areas of incompatibility which 
> are easier to handle than others.  E.g., an ISA with the 
> same semantics as another would be easier to automatically 
> translate, especially if the instructions are the same 
> size. [...]
>
> There might be some advantage to being able to translate in 
> place at the granularity of instructions in the old ISA.

This is what Intel did in the transition from 8080 to 8086: 8086 was not
binary compatible, but you could do an instruction-by-instructions
translation that didn't expand the code size, so you could preserve
addresses.

In any case, it is in most cases not too difficult to find the branch
targets by analysing code, so translation that doesn't preserve
addresses is usually O.K.  And in the cases where this isn't enough, you
can construct a table that translates old addresses to new addresses and
use this at runtime for computed and indirect jumps.  This, obviously,
requires that you don't combine two or more instructions in the old code
to one instruction in the new code, reorder instructions, and so on.
This might reduce the efficiency of the translated code, but probably
not by a lot.

Instead of keeping a table, you can do the normal branch-target
ananlysis and translate all branches to known target normally but also
keep a (hashed) table that maps the known old branch targets to new
addresses.  If there is an indirect jump, you look up in this table.  If
you get a hit, you jump, but otherwise you translate a basic block
starting at the previously-unknown branch target and add this to the
code.

	Torben

Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Beyond binary compatibility "Paul A. Clayton" <paaronclayton@gmail.com> - 2011-05-19 02:47 -0700
  Re: Beyond binary compatibility torbenm@diku.dk (Torben Ægidius Mogensen) - 2011-05-19 12:49 +0200
    Re: Beyond binary compatibility Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-05-19 18:33 +0200
      Re: Beyond binary compatibility "robertwessel2@yahoo.com" <robertwessel2@yahoo.com> - 2011-05-19 10:50 -0700
  Re: Beyond binary compatibility MitchAlsup <MitchAlsup@aol.com> - 2011-05-19 09:40 -0700

csiph-web