Efficiently emulating computer architecture condition code settings without executing branch instructions
AssigneeInternational Business Machines Corporation
InventorsReid T. Copeland, Patrick R. Doyle, Charles B. Hall, Andrew Johnson, Ali I. Sheikh
Life of this patent
Estimating the term…
Abstract
Emulation of source machine instructions is provided in which target machine CPU condition codes are employed to produce emulated condition code settings without the use, encoding or generation of branching instructions.
Claims20
A computer program product for emulating computer instructions from a source machine to produce sequences of instructions on a target machine, said computer program product comprising:
- a non-transitory computer readable storage medium readable by a processor and storing instructions for execution by the processor for performing a method comprising:
- obtaining by the target machine a computer instruction from the source machine, said source machine having a different architecture from said target machine;
- and
- generating a sequence of target machine instructions which together operate to derive an encoding for a target machine condition code for the computer instruction, wherein the sequence of target machine instructions provides distinguishing information to distinguish between a plurality of possible outcomes for the target machine condition code, and directly calculates the target machine condition code without using branch instructions, the directly calculating comprising:
- determining an intermediate condition code value, the intermediate condition code value being a provisional value for the target machine condition code and subject to change based on the distinguishing information;
- and
- determining, based on the intermediate condition code value and based on the distinguishing information, the target machine condition code, wherein at least part of said distinguishing information is separate from the intermediate condition code value.
A computer system for emulating computer instructions from a source machine to produce sequences of instructions on a target machine, the computer system comprising:
- a memory;
- and
- a processor in communication with the memory, wherein the computer system is capable of performing a method, the method comprising:
- obtaining by the target machine a computer instruction from the source machine, said source machine having a different architecture from said target machine;
- and
- generating a sequence of target machine instructions which together operate to derive an encoding for a target machine condition code for the computer instruction, wherein the sequence of target machine instructions provides distinguishing information to distinguish between a plurality of possible outcomes for the target machine condition code, and directly calculates the target machine condition code without using branch instructions, the directly calculating comprising:
- determining an intermediate condition code value, the intermediate condition code value being a provisional value for the target machine condition code and subject to change based on the distinguishing information;
- and
- determining, based on the intermediate condition code value and based on the distinguishing information, the target machine condition code, wherein at least part of said distinguishing information is separate from the intermediate condition code value.
A method for emulating computer instructions from a source machine to produce sequences of instructions on a target machine, said method comprising:
- obtaining by the target machine a computer instruction from the source machine, said source machine having a different architecture from said target machine;
- and
- generating a sequence of target machine instructions which together operate to derive an encoding for a target machine condition code for the computer instruction, wherein the sequence of target machine instructions provides distinguishing information to distinguish between a plurality of possible outcomes for the target machine condition code, and directly calculates the target machine condition code without using branch instructions, the directly calculating comprising:
- determining an intermediate condition code value, the intermediate condition code value being a provisional value for the target machine condition code and subject to change based on the distinguishing information;
- and
- determining, based on the intermediate condition code value and based on the distinguishing information, the target machine condition code, wherein at least part of said distinguishing information is separate from the intermediate condition code value.
Dependencies are inferred from the claim text.