Browse Prior Art Database

Method and Apparatus for Determining Branch Addresses in Programs Generated by Binary Translation

IP.com Disclosure Number: IPCOM000123466D
Original Publication Date: 1998-Dec-01
Included in the Prior Art Database: 2005-Apr-04

Publishing Venue

IBM

Related People

Gschwind, MK: AUTHOR

Abstract

This disclosure cannot be viewed on InfoGate due to the length of the text. If you are interested in receiving this disclosure PLEASE ORDER IT THROUGH INFOGATE.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 27% of the total text.

Method and Apparatus for Determining Branch Addresses in Programs
Generated by Binary Translation

   This disclosure cannot be viewed on InfoGate due to the
length of the text.  If you are interested in receiving this
disclosure PLEASE ORDER IT THROUGH INFOGATE.

   Problem solved by this invention

   Binary translation allows to maintain compatibility
across different architectures while still executing at native
speeds.  To this end, the original program is treated as input to a
binary translator which analyzes the program and generates
equivalent code for the current base architecture.  Binary
translation can either occur as a separate step prior to program
execution, also referred to as 'static binary compilation', or
binary translation can occur for each code fragment in the original
program as it is executed for the first time during program
execution, also referred to as 'dynamic binary translation' {1}.
Alternatively, special purpose hardware can translate instructions on
the fly either during the instruction decode, instruction fetch or
instruction cache miss phases in program execution.

   Data contained in registers or in memory locations
represent the values of the original program before binary
translation.  This includes addresses of possible branch targets.
Thus, branch target addresses stored in memory or registers refer to
program locations in the original program, not the equivalent entry
points in the binary translated program.  To actually perform a
branch to some address, the binary translated program has to check
whether a suitable entry point in the translated program can be
found, and if so, the address of that location has to be determined.
In dynamic binary translation, this mechanism can also be used to
branch between translation units (such as pages, treegions, or
superblocks) and accounts for changes in the memory mapping and
reclaiming of translations from a dynamic translation cache.  In
static binary translation, it can be used to detect previously
undetected entry points into the code, such as through register
indirect branches.

   In currently available systems, such as Mimic {2},
Accelerator {3}, VEST {4}, FX!32 {5}, and DAISY {6}, checking for an
existing translation and generating a branch address from the branch
target address in the original (emulated) program is performed using
software, commonly by a table lookup.  The table format can either be
a linear mapping table or a compressed table format such as hash
tables.  Both of these approaches have significant problems: linear
lookup tables require significant memory space, whereas using
compressed table formats require a significant computation time to
access such a table.

   This invention addresses problems arising from checking
the existence of a translation for a given code fragment, and
deriving the appropriate address of the translated code fragment
from the original branch target address of the emulated program.  In
particula...