IP Library Granted Patent US 8,024,555
Granted Patent B2
US 8,024,555 · App. 11/957,343 · Granted Sep 20, 2011

Condition code flag emulation for program code conversion

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,024,555
App. No.
11/957,343
Granted
Sep 20, 2011
Kind
B2
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.

Claims (26)

1. Computer software resident on a tangible computer readable storage medium and operable when executed by a computer to perform program code conversion comprising the steps of:

(a) establishing one or more abstract registers, each corresponding to a unique flag parameter (operand) used by a flag-affecting instruction which selectively modifies a flag;

(b) generating an intermediate representation (IR) tree for a selected instruction sequence, said selected instruction sequence followed by a flag-using instruction which uses said flag, said IR tree depending from the one or more of said abstract registers;

(c) responding to a first flag-affecting instruction in said selected instruction sequence to cause a flag parameter abstract register to refer to said IR tree generated at step (b); and

(d) resolving, in response to detecting said flag-using instruction, a status of said flag with respect to said flag parameter abstract register.

2. Computer software resident on a tangible computer readable storage medium and operable when executed by a computer to perform program code conversion the steps of:

generating a first intermediate representation for a sequence of instructions, said sequence of instructions including a plurality of flag-affecting instructions which selectively modify a flag followed by a flag-using instruction which uses the flag;

storing a reference to nodes of the first intermediate representation representing operands of an identified flag-affecting instruction of said sequence of instructions;

generating a second intermediate representation for condition code flag emulation in response to detecting said flag-using instruction; and

resolving, in response to detecting said flag-using instruction, a status of said flag with respect to said stored reference and said first and second intermediate representations.

3. The software of claim 2 further operable to generate an intermediate representation in a basic block mode and to save flag parameters and a flag-affecting instruction type across a basic block boundary.

4. The software of claim 3 wherein the flag-affecting instruction type is saved within the translator.

5. The software of claim 4 wherein the flag parameters are saved in flag parameter abstract registers.

6. The software of claim 5 wherein said flag parameter abstract registers reside in a global register store.

7. The software of claim 6 further including the steps of responding to the case where a flag parameter is still alive in a subject register at the end of a basic block by recording identity of said subject register rather than saving a duplicate value.

8. Computer software resident on a tangible computer readable storage medium and operable when executed by a computer to perform program code conversion comprising the steps of:

translating a sequence of instructions, said sequence of instructions including a plurality of flag-affecting instructions which selectively modify a flag followed by a flag-using instruction which uses said flag;

recording parameters of said plurality of flag-affecting instructions including an instruction type parameter and one or more operand parameters;

deferring a condition code flag translation until said flag-using instruction is encountered and;

resolving, in response to detecting said flag-using instruction, a status of said flag with respect to said recorded parameters of said plurality of flag-affecting instructions.

9. The software of claim 8 wherein said computer further resolves a flag value based on the instruction type parameter and the one or more operand parameters.

10. Computer software resident on a tangible computer readable storage medium and operable when executed by a computer to perform program code conversion comprising the steps of:

translating a sequence of instructions, said sequence of instructions including a plurality of flag-affecting instructions which selectively modify a sticky flag followed by a flag-using instruction which uses said sticky flag;

recording parameters of said plurality of flag-affecting instructions including an instruction type parameter and one or more operand parameters;

deferring a condition code flag translation until said flag-using instruction is encountered, further including a step of using a stack of flag-affecting instructions in emulation of said sticky flag; and

resolving, in response to detecting said flag-using instruction, a status of said sticky flag with respect to said recorded parameters of said plurality of flag-affecting instructions and said stack of flag-affecting instructions.

Assignments (4)
CORRECTIVE ASSIGNMENT TO CORRECT THE ASSIGNEE NAME PREVIOUSLY RECORDED ON REEL 022928 FRAME 0190. ASSIGNOR(S) HEREBY CONFIRMS THE RECEIVING PARTY. Recorded Aug 26, 2013
From: IBM UNITED KINGDOM LIMITED
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 031085/0824 →
CORRECTIVE ASSIGNMENT TO CORRECT THE NAME OF RECEIVING PARTY(IES) PREVIOUSLY RECORDED ON REEL 022928 FRAME 0190. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT OF ASSIGNORS INTEREST. Recorded Jun 20, 2011
From: IBM UNITED KINGDOM LIMITED
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 026466/0068 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 7, 2009
From: IBM UNITED KINGDOM LIMITED
To: IBM CORPORATION
Reel/Frame 022928/0190 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 16, 2009
From: TRANSITIVE LIMITED
To: IBM UNITED KINGDOM LIMITED
Reel/Frame 022824/0715 →