Method for translating between source and target code with heterogenous register sets
AssigneeTexas Instruments Incorporated
InventorsAlan L. Davis, Jonathan F. Humphreys, Todd M. Snider, Raj Kanagasabai
Life of this patent
Estimating the term…
Abstract
An interactive translation system (10) includes a front end (40), a back end (42), and a user interface (16). The front end (40) is operable to identify source elements (86) in a source file (24). The back end (42) is operable to generate a translation file having translation elements corresponding to translation of said identified source elements (86) and having an interface (16) for receiving inputs for modifying said translation.
Claims19
A method for translating a code for a source processor to a code for a target processor when the source processor uses a first register that does not exist in the target processor, comprising:
- receiving an active segment of code which includes a loop;
- determining if the code segment is in correct form for performing a loop rotation, and if so;
- performing a loop rotation to eliminate the use of the first register outside of the loop.
An apparatus for translating code for a source processor that uses a first register that does not exist for a target processor, comprising:
- a front end process operable to receive and parse a source code;
- and,
- a back end process coupled to the front end process and operable to:
- receive an active segment of code;
- determine if the code segment is in correct form for performing a loop rotation, and if so;
- apply a loop rotation to eliminate the use of the first register outside of the loop.
A method for translating code for source processor which uses a first register that do not exist in a target processor, comprising:
- receiving an active segment of code;
- determining if the code segment is in correct form for method by:
- determining a first set of successor blocks to the first block;
- determining a first set of predecessor blocks for the first set of successor blocks;
- determining a second set of successor blocks for the first set of predecessor blocks;
- determining a second set of predecessor blocks for the second set of successor blocks;
- comparing the first set of predecessor blocks with the second set of predecessor blocks;
- and,
- determining that the code segment is in proper format when the first set of predecessor blocks matches the second set of predecessor blocks;
- determining if there is a use of the register outside of the loop;
- applying a loop peel followed by a loop rotation if there is no use of the register outside of the loop by:
- removing one instance of the loop to directly outside of the loop;
- decreasing the loop iterations by one;
- and
- eliminating any blank basic blocks and any basic blocks that define a register without a subsequent use;
- and,
- applying a loop rotation to eliminate the use of the register outside of a loop if there is a use of the register outside the loop by:
- removing the first use of a register in a loop and combining it in the same basic block as the first definition of the register;
- and
- removing the last use of the register from outside the loop and combining it with the definition of the register inside a loop.
Dependencies are inferred from the claim text.