Condition code flag emulation for program code conversion
AssigneeTransitive Limited
InventorsJohn H. SANDHAM, Geraint NORTH
Life of this patent
Estimating the term…
Abstract
An emulator allows subject code written for a subject processor having subject processor registers and condition code flags to run in a non-compatible computing environment. The emulator identifies and records parameters of instructions in the subject code that affect status of the subject condition code flags. Then, when an instruction in the subject code is encountered, such as a branch or jump, that uses the flag status to make a decision, the flag status is resolved from the recorded instruction parameters. Advantageously, emulation overhead is substantially reduced.
Claims11
Computer software resident on a tangible medium and operable when executed by a computer to perform the steps of:
- (a) establishing one or more second abstract registers, each corresponding to a unique flag parameter (operand);
- (b) generating an intermediate representation (IR) tree for a selected instruction sequence, said tree depending from one or more of said abstract registers;
- and
- (c) responding to a first flag-affecting instruction in said sequence to cause a flag parameter abstract register to refer to said IR generated at step (b).
Computer software resident on a tangible medium and operable when executed by a computer to perform the steps of:
- generating intermediate representation for a sequence of instructions, said sequence including a plurality of flag-affecting instructions which selectively modify a flag followed by a flag-using instruction which uses the flag;
- and
- generating intermediate representation for condition code flag emulation in response to detecting said flag-using instruction.
Computer software resident on a tangible medium and operable when executed by a computer to perform the steps of:
- translating a sequence of instructions, said sequence including a plurality of flag-affecting instructions followed by a flag-using instruction;
- recording parameters of said plurality of flag-affecting instructions;
- and
- deferring condition code flag translation until said flag-using instruction is encountered.
Computer software resident on a tangible medium and operable when executed by a computer to perform the steps of:
- translating a sequence of instructions, said sequence including a plurality of flag-affecting instructions followed by a flag-using instruction;
- recording parameters of said plurality of flag-affecting instructions;
- and
- deferring condition code flag translation until said flag-using instruction is encountered, further including the step of using a stack of flag affecting instructions in emulation of sticky flags.
Dependencies are inferred from the claim text.