US20030149963A1 - Condition code flag emulation for program code conversion - Google Patents

Condition code flag emulation for program code conversion Download PDF

Info

Publication number
US20030149963A1
US20030149963A1 US10/314,179 US31417902A US2003149963A1 US 20030149963 A1 US20030149963 A1 US 20030149963A1 US 31417902 A US31417902 A US 31417902A US 2003149963 A1 US2003149963 A1 US 2003149963A1
Authority
US
United States
Prior art keywords
flag
instruction
subject
parameters
affecting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
US10/314,179
Inventor
John Sandham
Geraint North
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
Transitive Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Transitive Ltd filed Critical Transitive Ltd
Priority to US10/361,000 priority Critical patent/US7331040B2/en
Assigned to TRANSITIVE TECHNOLOGIES LIMITED reassignment TRANSITIVE TECHNOLOGIES LIMITED ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: NORTH, GERAINT M., SANDHAM, JOHN
Publication of US20030149963A1 publication Critical patent/US20030149963A1/en
Assigned to TRANSITIVE LIMITED reassignment TRANSITIVE LIMITED CHANGE OF NAME (SEE DOCUMENT FOR DETAILS). Assignors: TRANSITIVE TECHNOLOGIES LIMITED
Priority to US11/957,343 priority patent/US8024555B2/en
Assigned to IBM UNITED KINGDOM LIMITED reassignment IBM UNITED KINGDOM LIMITED ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: TRANSITIVE LIMITED
Assigned to IBM CORPORATION reassignment IBM CORPORATION ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: IBM UNITED KINGDOM LIMITED
Assigned to INTERNATIONAL BUSINESS MACHINES CORPORATION reassignment INTERNATIONAL BUSINESS MACHINES CORPORATION CORRECTIVE ASSIGNMENT TO CORRECT THE ASSIGNEE NAME PREVIOUSLY RECORDED ON REEL 022928 FRAME 0190. ASSIGNOR(S) HEREBY CONFIRMS THE RECEIVING PARTY. Assignors: IBM UNITED KINGDOM LIMITED
Abandoned legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45537Provision of facilities of other operating environments, e.g. WINE

Definitions

  • the present invention relates in general to the field of program code conversion.
  • the invention relates to a method and apparatus for emulation of condition code flags.
  • registers are a small number of high-speed memory locations closely associated with the processor.
  • the registers can be contrasted with general random access memory provided remote from the processor, which is slower but has a much larger capacity.
  • general random access memory provided remote from the processor, which is slower but has a much larger capacity.
  • a modern processor includes of the order of 32 to 144 registers. The limited size and high speed of the registers make them one of the most critical resources in almost all computer architectures.
  • the registers are usually augmented with a set of condition code flags.
  • the condition code flags are set or cleared such as in response to the execution of instructions in the processor and are used to represent the outcome of various operations.
  • the value of one or more of the condition code flags is often used as the basis for a decision during execution of a sequence of instructions. Hence, in the context of program code conversion, it is critical to accurately emulate the condition code flags.
  • processor architectures are inherently highly incompatible. Some processors are strongly reliant on the use of condition code flags, whereas some other processors do not provide any condition code flags at all. For example, it is very expensive to provide an emulator able to convert subject code written for a subject processor which does use condition code flags to run on a target processor without any condition code flags.
  • An aim of the present invention is to provide a method for emulating condition code flags that addresses the problems of the prior art, particularly those problems set out above.
  • a preferred aim of the present invention is to provide a method for emulating condition code flags that is efficient and reduces overall cost of program code conversion.
  • a method for emulating condition code flags during program code conversion comprising the steps of: (a) identifying a flag-affecting instruction in a sequence of subject code instructions; (b) recording parameters of the identified flag-affecting instruction; (c) detecting a flag-usage instruction in the sequence of subject code instructions; and (d) resolving a flag status with respect to the recorded parameters.
  • the step (d) comprises explicitly calculating a flag status by emulating effects of the identified flag-affecting instruction on one or more subject condition code flags.
  • the step (b) comprises setting a flag status indicator to a pending state to indicate that parameters have been recorded
  • the step (d) comprises setting the flag status indicator to a normalised state to indicate that a flag status has been explicitly calculated.
  • step (d) comprises implicitly determining flag status with reference to the recorded parameters.
  • the step (c) comprises determining a flag usage type with reference to a type of the detected flag-usage instruction
  • the step (d) comprises resolving flag status either by explicitly calculating a flag status or by implicitly determining a flag status, according to the determined flag usage type.
  • the step (a) comprises identifying a second flag-identifying instruction in the sequence of subject code instructions, and the step (b) comprises replacing the recorded parameters with parameters of the second flag-affecting instruction.
  • the recorded parameters are replaced as each new flag-affecting instruction is encountered.
  • parameters are recorded for a plurality of instructions.
  • the step (a) comprises identifying a type of flag-affecting instruction as one of a plurality of predetermined types, and the step (b) comprises recording parameters for each type of flag-affecting instruction.
  • the predetermined types include a first type instruction affecting a full set of condition code flags, and a second type instruction affecting a subset of the full set of condition code flags.
  • the step (d) comprises resolving flag status for a full set of condition code flags with respect to the recorded first-type parameters, and resolving flag status with respect to the subset of the condition code flags with respect to the recorded second-type parameters.
  • the step (d) comprises explicitly determining flag status from the recorded first-type parameters, and modifying the explicitly determined flag status from the recorded second-type parameters.
  • the predetermined types include instruction types each affecting a condition code flag set amongst a plurality of condition code flag sets.
  • the recorded parameters include an instruction type parameter and one or more instruction operand parameters.
  • the parameters are recorded in dedicated storage locations, such as predetermined locations in a main memory. The parameters are suitably copied to such location.
  • recording an instruction operand parameter may comprise storing a reference to a location containing an operand.
  • recording an instruction operand parameter comprises determining that an operand remains available unmodified at an original location and storing a reference to the original location as the instruction operand parameter, or else copying the operand from the original location to a dedicated operand parameter storage location.
  • the method comprises providing a plurality of abstract registers representing registers of a subject processor, and supplementing the abstract registers with one or more additional abstract registers each for storing an operand as an instruction operand parameter.
  • a method for emulating condition code flags during program code conversion comprising: selecting a sequence of subject code instructions; identifying a flag-affecting instruction in the sequence of subject code instructions, the flag-affecting instruction specifying an operation that affects subject condition code flags of a subject processor; recording parameters of the identified flag-affecting instruction including an instruction type parameter and one or more operand parameters; detecting a flag-usage instruction in the sequence of subject code instructions, the flag-usage instruction specifying an operation with reference to a flag status of one or more of the subject condition code flags; and in response to detecting a flag-usage instruction, resolving a flag status of one or more of the subject condition code flags with respect to the recorded parameters.
  • the method preferably comprises updating the recorded parameters when a new flag-affecting instruction is encountered in the sequence of subject code instructions.
  • Parameters may be recorded for a plurality of flag-affecting instructions.
  • the plurality of instructions are each associated with differing sets of subject condition code flags.
  • the method comprises resolving flag status by at least one of (a) explicitly calculating a status for one or more subject condition code flags by emulating an effect of the recorded flag-affecting instruction, or (b) implicitly representing the flag-usage instruction using the recorded parameters, or (c) selecting between options (a) and (b) according to a type of the flag-usage instruction.
  • the recorded parameters include at least one instruction operand parameter, and wherein recording the instruction operand parameter comprises at least one of (a) copying an operand to a predetermined storage location, or (b) storing a reference to an original location containing the operand, or (c) selectively performing (a) or (b).
  • an emulator apparatus for use in a target computing environment for emulating a subject processor of a subject computing environment when translating subject code appropriate to the subject computing environment to produce target code appropriate to the target computing environment, the emulator apparatus comprising: means for identifying a flag-affecting instruction in a sequence of subject code instructions; an instruction parameter store for recording parameters of the identified flag-affecting instruction; means for detecting a flag-usage instruction in the sequence of subject code instructions; and means for resolving a flag status with respect to the instruction parameters recorded in the instruction parameter store.
  • the invention also extends to a computing platform embodying the emulator apparatus and/or arranged to perform the methods defined herein.
  • the computing platform may take any suitable form including, for example, a networked computing system, a server computer, a desktop computer, or a portable computing device.
  • the invention also extends to a computer readable recording medium containing program code instructions for performing any of the methods defined herein.
  • FIG. 1 shows an example computing environment including subject and target computing environments
  • FIG. 2 outlines a preferred method for emulating condition code flags
  • FIG. 3 shows two examples of subject program code
  • FIG. 4 shows a preferred emulator
  • FIG. 5 shows an example of subject program code together with recorded instruction parameters
  • FIG. 6 shows program code during translation from a subject environment to a target environment
  • FIG. 7 shows a preferred arrangement for storing instruction parameters
  • FIG. 8 shows an example of subject program code
  • FIG. 9 shows a condition register of condition code flags in an example subject processor
  • FIG. 10 shows a preferred arrangement for storing instruction parameters
  • FIG. 11 shows another preferred arrangement for storing instruction parameters.
  • an example computing environment including a subject computing environment 1 and a target computing environment 2 .
  • subject code 10 is executable natively on a subject processor 12 .
  • the subject processor 12 includes a set of subject registers 14 and a set of subject condition code flags 16 .
  • the subject code 10 may be represented in any suitable language with intermediate layers (e.g. compilers) between the subject code 10 and the subject processor 12 , as will be familiar to the skilled person.
  • the subject processor 12 is a member of the Intel (rtm) ⁇ 86 family of processors, whilst the target processor 22 is a member of the PowerPC (rtm) processor family.
  • the subject processor 12 is a member of the Intel (rtm) ⁇ 86 family of processors
  • the target processor 22 is a member of the PowerPC (rtm) processor family.
  • These two processors are inherently non-compatible. Firstly, these two processors use different instruction sets.
  • an ⁇ 86 processor uses two flags (the auxiliary flag and the parity flag) which are unique to that family and are not provided in the PowerPC (rtm) architecture.
  • an emulator 30 is provided in the target computing environment 2 , in order to run the subject code 10 in that non-compatible environment.
  • the emulator 30 performs a translation process on the subject code 10 and provides a translated target code 20 to the target processor 22 .
  • the emulator 30 performs binary translation, wherein subject code 10 in the form of executable binary code appropriate to the subject processor 12 is translated into executable binary code appropriate to the target processor 22 .
  • Translation can be performed statically, or dynamically. In static translation, an entire program is translated prior to execution of the translated program on the target processor. This involves a significant delay. Therefore, emulators have been developed which dynamically translate small sections of the subject code 10 for execution immediately on the target processor 22 . This is much more efficient, because large sections of the subject code 10 will not be used in practice, or will be used only rarely.
  • the preferred embodiment of the present invention is particularly intended for use with an emulator 30 that performs dynamic binary translation of the subject code 10 into target code 20 executable on the target processor 22 .
  • the subject code 10 provides instructions that directly or indirectly make use of the subject registers 14 and the subject condition code flags 16 . Hence, it is desired to emulate the effects of those instructions, in order to provide an accurate translation of the subject code 10 .
  • the target condition code flags 26 are not directly compatible with the subject condition code flags 16 , emulation of the subject condition code flags 16 in the target computing environment is expensive in terms of both time and resources.
  • condition code flags It is desired to provide emulation of condition code flags in a manner which is cost efficient in the target processor. Further, it is desired that the emulation method can be performed efficiently in many different types of target processor. Ideally, it is desired to allow efficient emulation even in a target processor which does not provide any condition code flags.
  • FIG. 2 shows a first preferred embodiment of a method for emulating condition code flags.
  • step 210 parameters of a flag-setting instruction are recorded. Conveniently, certain instructions are known to affect one or more of the condition code flags, whilst other instructions are known to have no affect on the condition code flags. Hence, when translating a sequence of instructions in the subject code 10 , an instruction which potentially affects flag settings is identified. Parameters of that flag-affecting instruction are then stored, to be available later.
  • step 220 a flag usage is detected. That is, it is known that some instructions in the instruction set of the subject code 10 make use of one or more of the subject condition code flags 16 , such as to make a branch or jump decision based on the value of a condition code flag. At this point, it is desired to know the real values of those flags.
  • Step 230 comprises resolving a value for the condition code flags, at least for the one or more flags where a usage has been detected, from the recorded parameters of the flag-affecting instruction.
  • flag emulation is deferred until the last possible moment. Instruction parameters are recorded for a potentially flag-affecting instruction. Then, when it is necessary to emulate the flag, such as when the flags are used as the basis for a decision, the recorded instruction parameters are used to resolve the necessary flag or flags at that point.
  • the flag-affecting instruction is emulated including explicit emulation of the effect of that instruction on the subject condition code flags. However, since full flag emulation is only performed when a flag-using instruction is encountered, overhead associated with flag emulation is significantly reduced and emulator performance is substantially enhanced.
  • the flag values have been resolved, they remain valid until a new flag-affecting instruction is encountered. At that point, the parameters of the flag-affecting instruction are again recorded, as in step 210 . Conveniently, the emulated condition code flags are marked as either being in a normalised, explicitly calculated state, or else in a pending state to be resolved with reference to a recorded flag-affecting instruction.
  • FIG. 3 shows two example instruction sequences to illustrate the method of FIG. 2.
  • the instruction at line 1 affects the subject condition code flags “z”, “s” and “o”, with the “z” flag subsequently utilised by the conditional branch instruction at line 2.
  • the first instruction (Sub) subtracts the value of register R 2 from the value in register R 1 , and the branch (Bez) is effected if the result is equal to zero.
  • the parameters of the instruction on line 1 are recorded, and are then used to determine the value of the flag “z” for the instruction on line 2.
  • the instruction (Ble) on line 2 branches if the result of the subtraction is less than or equal to zero, this decision being made with reference to the example condition code flags “z”, “s” and “o”.
  • the branch decision in line 2 can be made simply based upon the parameters of the preceding flag-affecting instruction in line 1. That is, the flag value “z” can be determined implicitly based upon the recorded instruction parameters and there is no need to explicitly determine the value of the flag “z”.
  • the step 220 advantageously comprises determining a flag usage, and determining a flag usage type.
  • the step 230 then comprises either explicitly determining flag values, or else implicitly determining flag values from recorded instruction parameters, based upon the determined flag usage type.
  • the example instruction sequences shown in FIG. 3 provide a flag-affecting instruction (Sub) followed immediately by a flag-using instruction (Bez or Ble)
  • a flag-using instruction (Bez or Ble)
  • one or more intervening sterile instructions are present between example lines 1 and 2, which do not affect or use the relevant flag or flags.
  • the emulator 30 of the preferred embodiment is illustrated in more detail, comprising a front end 31 , a core 32 and a back end 33 .
  • the front end 31 is configured specific to the subject processor 12 being emulated.
  • the front end 31 takes a predetermined section of the subject code 10 and provides a block of a generic intermediate representation (an “IR block”).
  • the core 32 optimises each IR block generated by the front end 31 by employing optimisation techniques, such as dead code elimination, which need not be described here in detail.
  • the back end 33 takes optimised IR blocks from the core 32 and produces target code 20 executable by the target processor 22 .
  • the front end 31 divides the subject code 10 into basic blocks, where each basic block is a sequential set of instructions between a first instruction at a unique entry point and a last instruction at a unique exit point (such as a jump, call or branch instruction).
  • the core 32 may select a group block comprising two or more basic blocks which are to be treated together as a single unit. Further, the front end 31 may form iso-blocks representing the same basic block of subject code under different entry conditions.
  • a first predetermined section of the subject code 10 is identified, such as a basic block, and is translated by the emulator 30 running on the target processor 22 in a translation mode.
  • the target processor 22 then executes the corresponding optimised and translated block of target code 20 .
  • the preferred emulator 30 includes a plurality of abstract registers 320 , suitably provided in the core 32 , which represent the physical subject registers 14 that would be used within the subject processor 12 to execute the subject code 10 .
  • the abstract registers define the state of the subject processor 12 being emulated by representing the expected effects of the subject code instructions on the subject processor registers.
  • FIG. 4 also shows a preferred implementation of the flag emulation method, suitable for use in the general emulator architecture described above.
  • a flag-affecting instruction is identified in the subject code 10
  • parameters of that instruction are recorded in an instruction parameter store 200 .
  • the stored instruction parameters include an instruction type 201 , and one or more instruction operands 202 .
  • each instruction can operate on a maximum of two operands, and therefore two operand parameters 202 a , and 202 b are recorded.
  • the instruction type parameter 201 together with the one or more operand parameters 202 provide sufficient information for each of the emulated subject condition code flags 16 to be resolved either explicitly, or implicitly.
  • the one or more operand parameters 202 are suitably represented as one or more abstract registers additional to the emulated set of subject registers 14 . That is, the emulator 30 of target computing environment 2 emulates the set of subject registers 14 , by using abstract registers, and supplements this set of abstract registers with one or more additional registers to store the instruction operand parameters.
  • the operand parameters 202 which are dynamic quantities, are available in the target processor 12 in a high speed memory location and the values of the subject condition code flags 16 are resolvable quickly and cheaply, such as via suitable dynamic target code.
  • the instruction type parameter 201 which is a statically determinable quantity, is suitably stored in a slower or more remote location in the target computing environment 2 , such as in main memory, and is associated with a corresponding section of code such as a basic block.
  • FIG. 5 shows six lines of example subject code. Some of the instructions (Sub) affect the full set of condition code flags o,s,z,a,p & c, whilst other instructions (Inc) affect only a subset of the condition code flags.
  • the third column records the instruction type, whilst the fourth and the final columns record the two operands A & B referenced by that instruction.
  • “Normalised” refers to the normalised status of the flag values
  • “SubLong” refers to an instruction type, namely a long (32 bit) subtraction operation in an example ⁇ 86 processor.
  • EAX, EBX, ECX and EDX are example subject registers.
  • the emulator forms predetermined sections of subject code such as basic blocks, and records entry conditions giving the status of the emulation when passing from one basic block into another. That is, the emulator records entry conditions which are used to define the current status of the emulation at entry into a new basic block. These entry conditions include, for example, the status of each abstract register, and the status of the condition code flags.
  • entry conditions include, for example, the status of each abstract register, and the status of the condition code flags.
  • FIG. 5 the “Inc” instructions in lines 2 and 4 which affect a subset of the flags require the flags to be explicitly determined and the status is shown as normalised.
  • the “Sub” instructions put the flags into the pending state and the parameters of that flag-affecting instruction are recorded. When it comes to the jump “JA” instruction in line 6, the condition code flags are emulated indirectly derived from the recorded parameters of the “Sub” instruction in line 5.
  • FIG. 6 illustrates the preferred emulation method during translation of the subject code into target code
  • first column an example pair of instructions are shown, in this case a compare (Cmp) instruction and a jump if not equal to zero (Jne) instruction.
  • the front end 31 of the emulator 30 determines that these instructions form a basic block.
  • the second column shows the same instructions, set out as standardised intermediate representation in the core 32 .
  • the third column shows the resulting target code produced by the back end 33 .
  • This example shows subject code appropriate to an ⁇ 86 processor being emulated by an MIPS processor.
  • the architecture of a MIPS processor does not provide any target condition code flags.
  • the fourth column of FIG. 6 shows that two lines of target code produced from the intermediate representation can be removed by global dead code elimination during an optimisation phase performed by the emulator. Hence, the two lines of subject code in the first column result in a single line of target code in the third column.
  • the emulation method described herein can be efficiently implemented even for highly non-compatible environments.
  • Flag emulation is not required at all for a large percentage of instructions, i.e. for sterile instructions. Further, in many instances flag status can be derived implicitly from the recorded instruction parameters. Only a small percentage of the instructions in the source code require full normalised emulation of the subject condition code flags. As practical examples, instructions such as subtraction (Sub) or compare (Cmp) or test (Tst) which occur frequently in source code written such as for ⁇ 86 subject processors can be emulated without any need for explicit resolution of the subject condition code flags.
  • Sub subtraction
  • Cmp compare
  • Tst test
  • the last flag-affecting instruction is recorded simply and easily by using additional abstract registers to represent each operand.
  • an additional abstract register is provided for each potential operand.
  • each instruction can act on at most two operands, and therefore two additional operand parameter registers are employed.
  • it is advantageous to record additional instruction parameters as will now, be described below.
  • FIG. 7 shows a preferred implementation for recording multiple sets of instruction parameters.
  • two sets of instruction parameters are provided, namely inst — 1 and inst — 2.
  • FIG. 8 shows four lines of subject code to illustrate the use of the first and second recorded instruction parameters of FIG. 7.
  • the add instruction (add) at line 1 affects the complete flag set
  • the decrement instruction (dec) at line 3 affects only a subset of the flags.
  • the embodiment described above would require an explicit definition of the flags at line 3, by first normalising the flags with reference to the instruction parameters recorded for line 1.
  • FIG. 7 it is now possible to record both instructions, from lines 1 and 3, without needing to normalise the flags at either point.
  • the flag-using jump instruction is encountered at line 4, the values of the condition code flags are resolved explicitly or implicitly from the two sets of stored instruction parameters.
  • FIGS. 9 and 10 illustrate another preferred implementation of the emulation method for use with processors such as the PowerPC (rtm) family which make use of a number of identical flag sets.
  • processors such as the PowerPC (rtm) family which make use of a number of identical flag sets.
  • FIG. 9 shows the condition register used in a typical PowerPC processor using eight 4 -bit condition fields (CF) which each contain four flags, namely less than (LT), greater than (GT), equal to (EQ) and summary overflow (SO).
  • CF condition fields
  • EQ summary overflow
  • condition code flags in the condition register are initiated by compare instructions, which perform a signed or unsigned comparison of two values.
  • instruction parameters are recorded for each of the condition fields.
  • instruction parameters are recorded for each of “n” instructions, such that the last flag-affecting instruction can be recorded for each of the condition fields.
  • the embodiment of FIG. 10 can be combined with the embodiment of FIG. 8, to provide a plurality of recorded instructions for each of the condition fields.
  • FIG. 11 shows a further preferred option to improve efficiency of emulation.
  • the operands of a flag affecting instruction are copied to operand registers so as to be available when it is necessary to resolve the flag status.
  • the operand value is validly recorded, for example, in an emulated subject register. Provided the value in that subject register remains unchanged, then the subject register itself can be used as the source of the value of that operand.
  • FIG. 11 in this example is adapted for the architecture of a PowerPC processor.
  • the first control field denotes whether the operand value has been copied to the dedicated operand register 202 , or else denotes that the second field specifies the location which contains the value of this operand. That is, the second control field is used as a reference to a subject register (i.e. one of the abstract registers held by the emulator) which contains the value of the desired operand parameter.
  • the first control field is a single bit in length, while the second field is five bits in length, which is sufficient to address the available subject registers of this example processor.
  • the recorded operand parameters are only a subset of the operand parameters employed by the flag-affecting instruction. Firstly, when the flag-affecting instruction performs a reversible transformation and the result of the operation is still available when it is desired to resolve flag status, then the result together with a first operand can be used to infer a second operand. Secondly, if the flag-affecting operation has duplicate parameters, then it is sufficient to record just one of those parameters.
  • the emulation method described herein is apt to be recorded on a computer readable recording medium as a computing program for performing the method.
  • the invention also extends to an emulator apparatus, and to a computing platform, for performing the emulation method.
  • the present invention has many advantages as will be apparent from the description above, and as will be apparent to the skilled person through practice of the invention.
  • flag emulation is performed efficiently and cost effectively, even for highly non-compatible subject and target processor environments.

Abstract

An emulator (30) allows subject code (10) written for a subject processor (12) having subject processor registers (14) and condition code flags (16) to run in a non-compatible computing environment (2). The emulator (3) identifies and records parameters of instructions in the subject code (10) that affect status of the subject condition code flags (16). Then, when an instruction in the subject code (10) 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.

Description

  • The present invention relates in general to the field of program code conversion. In particular, the invention relates to a method and apparatus for emulation of condition code flags. [0001]
  • In the field of computer processing, it is often desired to run program code written for a computer processor of a first type (a “subject” processor) on a processor of a second type (a “target” processor). Here, an emulator is used to perform program code translation, such that the subject program is able to run on the target processor. The emulator provides a virtual environment, as if the subject program were running natively on a subject processor, by emulating the subject processor. [0002]
  • Most conventional computer processors comprise a set of registers, which are a small number of high-speed memory locations closely associated with the processor. The registers can be contrasted with general random access memory provided remote from the processor, which is slower but has a much larger capacity. Typically, a modern processor includes of the order of 32 to 144 registers. The limited size and high speed of the registers make them one of the most critical resources in almost all computer architectures. [0003]
  • The registers are usually augmented with a set of condition code flags. The condition code flags are set or cleared such as in response to the execution of instructions in the processor and are used to represent the outcome of various operations. The value of one or more of the condition code flags is often used as the basis for a decision during execution of a sequence of instructions. Hence, in the context of program code conversion, it is critical to accurately emulate the condition code flags. [0004]
  • Whilst there tends to be some overlap between the set of condition code flags of a subject processor and the set of condition code flags of a target processor, in almost all cases there is not an exact correspondence between the two sets of flags. Therefore, accurately emulating the subject condition code flags can be an expensive operation. The degree to which flag emulation impacts upon the efficiency of the conversion process varies according to compatibility of the subject processor architecture with the target processor architecture, but in general the emulation of subject condition code flags amounts to a significant proportion of overall performance. [0005]
  • A further problem arises in that some processor architectures are inherently highly incompatible. Some processors are strongly reliant on the use of condition code flags, whereas some other processors do not provide any condition code flags at all. For example, it is very expensive to provide an emulator able to convert subject code written for a subject processor which does use condition code flags to run on a target processor without any condition code flags. [0006]
  • An aim of the present invention is to provide a method for emulating condition code flags that addresses the problems of the prior art, particularly those problems set out above. [0007]
  • A preferred aim of the present invention is to provide a method for emulating condition code flags that is efficient and reduces overall cost of program code conversion. [0008]
  • According to a first aspect of the present invention there is provided a method for emulating condition code flags during program code conversion, comprising the steps of: (a) identifying a flag-affecting instruction in a sequence of subject code instructions; (b) recording parameters of the identified flag-affecting instruction; (c) detecting a flag-usage instruction in the sequence of subject code instructions; and (d) resolving a flag status with respect to the recorded parameters. [0009]
  • In a first preferred embodiment, preferably the step (d) comprises explicitly calculating a flag status by emulating effects of the identified flag-affecting instruction on one or more subject condition code flags. Preferably, the step (b) comprises setting a flag status indicator to a pending state to indicate that parameters have been recorded, and the step (d) comprises setting the flag status indicator to a normalised state to indicate that a flag status has been explicitly calculated. [0010]
  • In a second preferred embodiment, preferably the step (d) comprises implicitly determining flag status with reference to the recorded parameters. [0011]
  • The first and second preferred embodiments can be used in combination. Preferably, the step (c) comprises determining a flag usage type with reference to a type of the detected flag-usage instruction, and the step (d) comprises resolving flag status either by explicitly calculating a flag status or by implicitly determining a flag status, according to the determined flag usage type. [0012]
  • Preferably, the step (a) comprises identifying a second flag-identifying instruction in the sequence of subject code instructions, and the step (b) comprises replacing the recorded parameters with parameters of the second flag-affecting instruction. Here, the recorded parameters are replaced as each new flag-affecting instruction is encountered. Alternatively, parameters are recorded for a plurality of instructions. [0013]
  • Preferably, the step (a) comprises identifying a type of flag-affecting instruction as one of a plurality of predetermined types, and the step (b) comprises recording parameters for each type of flag-affecting instruction. [0014]
  • In one embodiment, preferably, the predetermined types include a first type instruction affecting a full set of condition code flags, and a second type instruction affecting a subset of the full set of condition code flags. Preferably, the step (d) comprises resolving flag status for a full set of condition code flags with respect to the recorded first-type parameters, and resolving flag status with respect to the subset of the condition code flags with respect to the recorded second-type parameters. Preferably, the step (d) comprises explicitly determining flag status from the recorded first-type parameters, and modifying the explicitly determined flag status from the recorded second-type parameters. [0015]
  • In a second embodiment, preferably the predetermined types include instruction types each affecting a condition code flag set amongst a plurality of condition code flag sets. [0016]
  • Preferably, the recorded parameters include an instruction type parameter and one or more instruction operand parameters. In one embodiment, the parameters are recorded in dedicated storage locations, such as predetermined locations in a main memory. The parameters are suitably copied to such location. However, recording an instruction operand parameter may comprise storing a reference to a location containing an operand. Here, recording an instruction operand parameter comprises determining that an operand remains available unmodified at an original location and storing a reference to the original location as the instruction operand parameter, or else copying the operand from the original location to a dedicated operand parameter storage location. Preferably, the method comprises providing a plurality of abstract registers representing registers of a subject processor, and supplementing the abstract registers with one or more additional abstract registers each for storing an operand as an instruction operand parameter. [0017]
  • According to a second aspect of the present invention there is provided a method for emulating condition code flags during program code conversion, comprising: selecting a sequence of subject code instructions; identifying a flag-affecting instruction in the sequence of subject code instructions, the flag-affecting instruction specifying an operation that affects subject condition code flags of a subject processor; recording parameters of the identified flag-affecting instruction including an instruction type parameter and one or more operand parameters; detecting a flag-usage instruction in the sequence of subject code instructions, the flag-usage instruction specifying an operation with reference to a flag status of one or more of the subject condition code flags; and in response to detecting a flag-usage instruction, resolving a flag status of one or more of the subject condition code flags with respect to the recorded parameters. [0018]
  • The method preferably comprises updating the recorded parameters when a new flag-affecting instruction is encountered in the sequence of subject code instructions. Parameters may be recorded for a plurality of flag-affecting instructions. In one embodiment the plurality of instructions are each associated with differing sets of subject condition code flags. [0019]
  • Preferably, the method comprises resolving flag status by at least one of (a) explicitly calculating a status for one or more subject condition code flags by emulating an effect of the recorded flag-affecting instruction, or (b) implicitly representing the flag-usage instruction using the recorded parameters, or (c) selecting between options (a) and (b) according to a type of the flag-usage instruction. [0020]
  • Preferably, the recorded parameters include at least one instruction operand parameter, and wherein recording the instruction operand parameter comprises at least one of (a) copying an operand to a predetermined storage location, or (b) storing a reference to an original location containing the operand, or (c) selectively performing (a) or (b). [0021]
  • According to a third aspect of the present invention there is provided an emulator apparatus for use in a target computing environment for emulating a subject processor of a subject computing environment when translating subject code appropriate to the subject computing environment to produce target code appropriate to the target computing environment, the emulator apparatus comprising: means for identifying a flag-affecting instruction in a sequence of subject code instructions; an instruction parameter store for recording parameters of the identified flag-affecting instruction; means for detecting a flag-usage instruction in the sequence of subject code instructions; and means for resolving a flag status with respect to the instruction parameters recorded in the instruction parameter store. [0022]
  • The invention also extends to a computing platform embodying the emulator apparatus and/or arranged to perform the methods defined herein. The computing platform may take any suitable form including, for example, a networked computing system, a server computer, a desktop computer, or a portable computing device. The invention also extends to a computer readable recording medium containing program code instructions for performing any of the methods defined herein. [0023]
  • For a better understanding of the invention, and to show how embodiments of the same may be carried into effect, reference will now be made, by way of example, to the accompanying diagrammatic drawings in which: [0024]
  • FIG. 1 shows an example computing environment including subject and target computing environments; [0025]
  • FIG. 2 outlines a preferred method for emulating condition code flags; [0026]
  • FIG. 3 shows two examples of subject program code; [0027]
  • FIG. 4 shows a preferred emulator; [0028]
  • FIG. 5 shows an example of subject program code together with recorded instruction parameters; [0029]
  • FIG. 6 shows program code during translation from a subject environment to a target environment; [0030]
  • FIG. 7 shows a preferred arrangement for storing instruction parameters; [0031]
  • FIG. 8 shows an example of subject program code; [0032]
  • FIG. 9 shows a condition register of condition code flags in an example subject processor; [0033]
  • FIG. 10 shows a preferred arrangement for storing instruction parameters; and [0034]
  • FIG. 11 shows another preferred arrangement for storing instruction parameters.[0035]
  • Referring to FIG. 1, an example computing environment is shown including a [0036] subject computing environment 1 and a target computing environment 2. In the subject environment 1, subject code 10 is executable natively on a subject processor 12. The subject processor 12 includes a set of subject registers 14 and a set of subject condition code flags 16. Here, the subject code 10 may be represented in any suitable language with intermediate layers (e.g. compilers) between the subject code 10 and the subject processor 12, as will be familiar to the skilled person.
  • It is desired to run the [0037] subject code 10 in the target computing environment 2, which provides a target processor 22 using a set of target registers 24 and a set of target condition code flags 26. As a typical example, the subject processor 12 is a member of the Intel (rtm) ×86 family of processors, whilst the target processor 22 is a member of the PowerPC (rtm) processor family. These two processors are inherently non-compatible. Firstly, these two processors use different instruction sets. Secondly, an ×86 processor uses two flags (the auxiliary flag and the parity flag) which are unique to that family and are not provided in the PowerPC (rtm) architecture. Hence, an emulator 30 is provided in the target computing environment 2, in order to run the subject code 10 in that non-compatible environment.
  • The [0038] emulator 30 performs a translation process on the subject code 10 and provides a translated target code 20 to the target processor 22. Suitably, the emulator 30 performs binary translation, wherein subject code 10 in the form of executable binary code appropriate to the subject processor 12 is translated into executable binary code appropriate to the target processor 22.
  • Translation can be performed statically, or dynamically. In static translation, an entire program is translated prior to execution of the translated program on the target processor. This involves a significant delay. Therefore, emulators have been developed which dynamically translate small sections of the [0039] subject code 10 for execution immediately on the target processor 22. This is much more efficient, because large sections of the subject code 10 will not be used in practice, or will be used only rarely. The preferred embodiment of the present invention is particularly intended for use with an emulator 30 that performs dynamic binary translation of the subject code 10 into target code 20 executable on the target processor 22.
  • In executable form, the [0040] subject code 10 provides instructions that directly or indirectly make use of the subject registers 14 and the subject condition code flags 16. Hence, it is desired to emulate the effects of those instructions, in order to provide an accurate translation of the subject code 10. However, since the target condition code flags 26 are not directly compatible with the subject condition code flags 16, emulation of the subject condition code flags 16 in the target computing environment is expensive in terms of both time and resources.
  • It is desired to provide emulation of condition code flags in a manner which is cost efficient in the target processor. Further, it is desired that the emulation method can be performed efficiently in many different types of target processor. Ideally, it is desired to allow efficient emulation even in a target processor which does not provide any condition code flags. [0041]
  • FIG. 2 shows a first preferred embodiment of a method for emulating condition code flags. In [0042] step 210, parameters of a flag-setting instruction are recorded. Conveniently, certain instructions are known to affect one or more of the condition code flags, whilst other instructions are known to have no affect on the condition code flags. Hence, when translating a sequence of instructions in the subject code 10, an instruction which potentially affects flag settings is identified. Parameters of that flag-affecting instruction are then stored, to be available later.
  • In [0043] step 220, a flag usage is detected. That is, it is known that some instructions in the instruction set of the subject code 10 make use of one or more of the subject condition code flags 16, such as to make a branch or jump decision based on the value of a condition code flag. At this point, it is desired to know the real values of those flags.
  • [0044] Step 230 comprises resolving a value for the condition code flags, at least for the one or more flags where a usage has been detected, from the recorded parameters of the flag-affecting instruction.
  • In this method, flag emulation is deferred until the last possible moment. Instruction parameters are recorded for a potentially flag-affecting instruction. Then, when it is necessary to emulate the flag, such as when the flags are used as the basis for a decision, the recorded instruction parameters are used to resolve the necessary flag or flags at that point. Here, the flag-affecting instruction is emulated including explicit emulation of the effect of that instruction on the subject condition code flags. However, since full flag emulation is only performed when a flag-using instruction is encountered, overhead associated with flag emulation is significantly reduced and emulator performance is substantially enhanced. [0045]
  • Once the flag values have been resolved, they remain valid until a new flag-affecting instruction is encountered. At that point, the parameters of the flag-affecting instruction are again recorded, as in [0046] step 210. Conveniently, the emulated condition code flags are marked as either being in a normalised, explicitly calculated state, or else in a pending state to be resolved with reference to a recorded flag-affecting instruction.
  • FIG. 3 shows two example instruction sequences to illustrate the method of FIG. 2. In a simple first example, the instruction at [0047] line 1 affects the subject condition code flags “z”, “s” and “o”, with the “z” flag subsequently utilised by the conditional branch instruction at line 2. In this example, the first instruction (Sub) subtracts the value of register R2 from the value in register R1, and the branch (Bez) is effected if the result is equal to zero. The parameters of the instruction on line 1 are recorded, and are then used to determine the value of the flag “z” for the instruction on line 2. In the second more complex example, the instruction (Ble) on line 2 branches if the result of the subtraction is less than or equal to zero, this decision being made with reference to the example condition code flags “z”, “s” and “o”.
  • As an enhancement of this first method, it has been found that for most flag-using instructions it is not necessary to explicitly calculate the value of each flag. That is, the value of a- flag can be determined implicitly, with reference to the stored parameters of the flag-affecting instruction. [0048]
  • Referring to the code examples of FIG. 3, the branch decision in [0049] line 2 can be made simply based upon the parameters of the preceding flag-affecting instruction in line 1. That is, the flag value “z” can be determined implicitly based upon the recorded instruction parameters and there is no need to explicitly determine the value of the flag “z”. Hence, the step 220 advantageously comprises determining a flag usage, and determining a flag usage type. The step 230 then comprises either explicitly determining flag values, or else implicitly determining flag values from recorded instruction parameters, based upon the determined flag usage type.
  • Instruction combinations similar to those shown in FIG. 3 occur very frequently. Hence, this optimisation has a significant impact. [0050]
  • The example instruction sequences shown in FIG. 3 provide a flag-affecting instruction (Sub) followed immediately by a flag-using instruction (Bez or Ble) However, it is also possible that one or more intervening sterile instructions are present between [0051] example lines 1 and 2, which do not affect or use the relevant flag or flags.
  • Referring now to FIG. 4, the [0052] emulator 30 of the preferred embodiment is illustrated in more detail, comprising a front end 31, a core 32 and a back end 33.
  • The [0053] front end 31 is configured specific to the subject processor 12 being emulated. The front end 31 takes a predetermined section of the subject code 10 and provides a block of a generic intermediate representation (an “IR block”).
  • The [0054] core 32 optimises each IR block generated by the front end 31 by employing optimisation techniques, such as dead code elimination, which need not be described here in detail.
  • The [0055] back end 33 takes optimised IR blocks from the core 32 and produces target code 20 executable by the target processor 22.
  • Suitably, the [0056] front end 31 divides the subject code 10 into basic blocks, where each basic block is a sequential set of instructions between a first instruction at a unique entry point and a last instruction at a unique exit point (such as a jump, call or branch instruction). The core 32 may select a group block comprising two or more basic blocks which are to be treated together as a single unit. Further, the front end 31 may form iso-blocks representing the same basic block of subject code under different entry conditions.
  • In use, a first predetermined section of the [0057] subject code 10 is identified, such as a basic block, and is translated by the emulator 30 running on the target processor 22 in a translation mode. The target processor 22 then executes the corresponding optimised and translated block of target code 20.
  • The preferred [0058] emulator 30 includes a plurality of abstract registers 320, suitably provided in the core 32, which represent the physical subject registers 14 that would be used within the subject processor 12 to execute the subject code 10. The abstract registers define the state of the subject processor 12 being emulated by representing the expected effects of the subject code instructions on the subject processor registers.
  • FIG. 4 also shows a preferred implementation of the flag emulation method, suitable for use in the general emulator architecture described above. When a flag-affecting instruction is identified in the [0059] subject code 10, parameters of that instruction are recorded in an instruction parameter store 200. Most conveniently, the stored instruction parameters include an instruction type 201, and one or more instruction operands 202. For example, in a ×86 type processor each instruction can operate on a maximum of two operands, and therefore two operand parameters 202 a, and 202 b are recorded. The instruction type parameter 201 together with the one or more operand parameters 202 provide sufficient information for each of the emulated subject condition code flags 16 to be resolved either explicitly, or implicitly.
  • The one or more operand parameters [0060] 202 are suitably represented as one or more abstract registers additional to the emulated set of subject registers 14. That is, the emulator 30 of target computing environment 2 emulates the set of subject registers 14, by using abstract registers, and supplements this set of abstract registers with one or more additional registers to store the instruction operand parameters. Hence, the operand parameters 202, which are dynamic quantities, are available in the target processor 12 in a high speed memory location and the values of the subject condition code flags 16 are resolvable quickly and cheaply, such as via suitable dynamic target code. The instruction type parameter 201, which is a statically determinable quantity, is suitably stored in a slower or more remote location in the target computing environment 2, such as in main memory, and is associated with a corresponding section of code such as a basic block.
  • As shown in FIG. 4, in this first preferred embodiment only the most recent flag-affecting instruction is recorded. As each new flag-affecting instruction is encountered in the sequence of instructions in the [0061] subject code 10, then the recorded parameters are replaced with those of the latest encountered flag-affecting instruction. That is, as each new flag-affecting instruction is encountered, the instruction parameters are replaced with those of that new flag-affecting instruction.
  • To further illustrate the preferred embodiments of the present invention, FIG. 5 shows six lines of example subject code. Some of the instructions (Sub) affect the full set of condition code flags o,s,z,a,p & c, whilst other instructions (Inc) affect only a subset of the condition code flags. The third column records the instruction type, whilst the fourth and the final columns record the two operands A & B referenced by that instruction. In this example, “Normalised” refers to the normalised status of the flag values, while “SubLong” refers to an instruction type, namely a long (32 bit) subtraction operation in an example ×86 processor. EAX, EBX, ECX and EDX are example subject registers. [0062]
  • In use, the emulator forms predetermined sections of subject code such as basic blocks, and records entry conditions giving the status of the emulation when passing from one basic block into another. That is, the emulator records entry conditions which are used to define the current status of the emulation at entry into a new basic block. These entry conditions include, for example, the status of each abstract register, and the status of the condition code flags. In FIG. 5, the “Inc” instructions in [0063] lines 2 and 4 which affect a subset of the flags require the flags to be explicitly determined and the status is shown as normalised. The “Sub” instructions on the other hand put the flags into the pending state and the parameters of that flag-affecting instruction are recorded. When it comes to the jump “JA” instruction in line 6, the condition code flags are emulated indirectly derived from the recorded parameters of the “Sub” instruction in line 5.
  • FIG. 6 illustrates the preferred emulation method during translation of the subject code into target code In the first column an example pair of instructions are shown, in this case a compare (Cmp) instruction and a jump if not equal to zero (Jne) instruction. The [0064] front end 31 of the emulator 30 determines that these instructions form a basic block. The second column shows the same instructions, set out as standardised intermediate representation in the core 32. The third column shows the resulting target code produced by the back end 33. This example shows subject code appropriate to an ×86 processor being emulated by an MIPS processor. The architecture of a MIPS processor does not provide any target condition code flags. This example illustrates a worst case practical situation, because traditionally the condition code flags of the ×86 processor are very expensive to emulate in the flagless MIPS processor. The fourth column of FIG. 6 shows that two lines of target code produced from the intermediate representation can be removed by global dead code elimination during an optimisation phase performed by the emulator. Hence, the two lines of subject code in the first column result in a single line of target code in the third column.
  • As illustrated by the simple example in FIG. 6, the emulation method described herein can be efficiently implemented even for highly non-compatible environments. Flag emulation is not required at all for a large percentage of instructions, i.e. for sterile instructions. Further, in many instances flag status can be derived implicitly from the recorded instruction parameters. Only a small percentage of the instructions in the source code require full normalised emulation of the subject condition code flags. As practical examples, instructions such as subtraction (Sub) or compare (Cmp) or test (Tst) which occur frequently in source code written such as for ×86 subject processors can be emulated without any need for explicit resolution of the subject condition code flags. [0065]
  • In the implementation described above, the last flag-affecting instruction is recorded simply and easily by using additional abstract registers to represent each operand. In this architecture, an additional abstract register is provided for each potential operand. In the example of an ×86 processor, each instruction can act on at most two operands, and therefore two additional operand parameter registers are employed. Sometimes, however, it is advantageous to record additional instruction parameters, as will now, be described below. [0066]
  • FIG. 7 shows a preferred implementation for recording multiple sets of instruction parameters. In this example, two sets of instruction parameters are provided, namely [0067] inst 1 and inst 2.
  • For some types of processor, there are instructions which affect only a subset of the subject condition code flags, whilst other instructions affect the full set of subject condition code flags. As one option, this problem is overcome by explicitly determining the full set of flag values from the last full set flag-affecting instruction, and then explicitly determining the flag values of the subset affected by the subset-affecting instruction. The full set of flag values can then be determined by combining the explicitly determined flag values of the last full-set flag affecting instruction with those of the newly encountered subset affecting instruction. [0068]
  • FIG. 8 shows four lines of subject code to illustrate the use of the first and second recorded instruction parameters of FIG. 7. The add instruction (add) at [0069] line 1 affects the complete flag set, whereas the decrement instruction (dec) at line 3 affects only a subset of the flags. The embodiment described above would require an explicit definition of the flags at line 3, by first normalising the flags with reference to the instruction parameters recorded for line 1. However, by providing two sets of instruction parameters as shown in FIG. 7, it is now possible to record both instructions, from lines 1 and 3, without needing to normalise the flags at either point. When the flag-using jump instruction is encountered at line 4, the values of the condition code flags are resolved explicitly or implicitly from the two sets of stored instruction parameters.
  • FIGS. 9 and 10 illustrate another preferred implementation of the emulation method for use with processors such as the PowerPC (rtm) family which make use of a number of identical flag sets. [0070]
  • FIG. 9 shows the condition register used in a typical PowerPC processor using eight [0071] 4-bit condition fields (CF) which each contain four flags, namely less than (LT), greater than (GT), equal to (EQ) and summary overflow (SO). In this processor architecture, a flag-setting operation is allowed to selectively modify one of the eight sets of flags. Further, although most instructions will set every flag in the specified flag set, some operations exist which affect the status of specific flags. Hence, in traditional emulation systems, it is relatively expensive to emulate a processor of this nature.
  • A majority of modifications to the condition code flags in the condition register are initiated by compare instructions, which perform a signed or unsigned comparison of two values. One of the three comparison flags within the specified condition field (LT[0072] n, GTn or EQn, where n=0 . . . 7) is set, while the other two are cleared. In order to emulate this relatively complex set of subject condition code flags, it is convenient to provide a set of recorded instructions such that instruction parameters are recorded for each of the condition fields. In this example, as shown in FIG. 10, instruction parameters are recorded for each of “n” instructions, such that the last flag-affecting instruction can be recorded for each of the condition fields. If necessary, the embodiment of FIG. 10 can be combined with the embodiment of FIG. 8, to provide a plurality of recorded instructions for each of the condition fields.
  • FIG. 11 shows a further preferred option to improve efficiency of emulation. In the embodiments discussed above, the operands of a flag affecting instruction are copied to operand registers so as to be available when it is necessary to resolve the flag status. However, in some circumstances it is possible to avoid this copying operation by referring instead to the original source location of that operand. That is, the operand value is validly recorded, for example, in an emulated subject register. Provided the value in that subject register remains unchanged, then the subject register itself can be used as the source of the value of that operand. [0073]
  • FIG. 11 in this example is adapted for the architecture of a PowerPC processor. For each operand A[0074] 0-n, B0-n, two control fields are recorded. The first control field denotes whether the operand value has been copied to the dedicated operand register 202, or else denotes that the second field specifies the location which contains the value of this operand. That is, the second control field is used as a reference to a subject register (i.e. one of the abstract registers held by the emulator) which contains the value of the desired operand parameter. Here, the first control field is a single bit in length, while the second field is five bits in length, which is sufficient to address the available subject registers of this example processor.
  • In another preferred embodiment, the recorded operand parameters are only a subset of the operand parameters employed by the flag-affecting instruction. Firstly, when the flag-affecting instruction performs a reversible transformation and the result of the operation is still available when it is desired to resolve flag status, then the result together with a first operand can be used to infer a second operand. Secondly, if the flag-affecting operation has duplicate parameters, then it is sufficient to record just one of those parameters. These special-case flag-affecting instructions allow increased optimisation of the target code and further reduce overhead associated with emulation of condition code flags. [0075]
  • The preferred embodiments of the invention have been described in the context of an emulator performing program code conversion for the purposes of translation between non-compatible computing environments. However, the principles of the invention are also applicable to fields such as program code conversion for the purposes of optimisation, wherein a subject processor and a target processor have a compatible architecture.: [0076]
  • The emulation method described herein is apt to be recorded on a computer readable recording medium as a computing program for performing the method. The invention also extends to an emulator apparatus, and to a computing platform, for performing the emulation method. [0077]
  • The present invention has many advantages as will be apparent from the description above, and as will be apparent to the skilled person through practice of the invention. In particular, flag emulation is performed efficiently and cost effectively, even for highly non-compatible subject and target processor environments. [0078]

Claims (25)

1. A method for emulating condition code flags during program code conversion, comprising the steps of:
(a) identifying a flag-affecting instruction in a sequence of subject code instructions;
(b) recording parameters of the identified flag-affecting instruction;
(c) detecting a flag-usage instruction in the sequence of subject code instructions; and
(d) resolving a flag status with respect to the recorded parameters.
2. The method of claim 1, wherein the step (d) comprises explicitly calculating a flag status by emulating effects of the identified flag-affecting instruction on one or more subject condition code flags.
3. The method of claim 2, wherein the step (b) comprises setting a flag status indicator to a pending state to indicate that parameters have been recorded, and the step (d) comprises setting the flag status indicator to a normalised state to indicate that a flag status has been explicitly calculated.
4. The method of claim 1, wherein the step (d) comprises implicitly determining flag status with reference to the recorded parameters.
5. The method of claim 1, wherein the step (c) comprises determining a flag usage type with reference to a type of the detected flag-usage instruction, and the step (d) comprises resolving flag status either by explicitly calculating a flag status or by implicitly determining a flag status, according to the determined flag usage type.
6. The method of claim 1, wherein the step (a) comprises identifying a second flag-identifying instruction in the sequence of subject code instructions, and the step (b) comprises replacing the recorded parameters with parameters of the second flag-affecting instruction.
7. The method of claim 1, wherein the step (a) comprises identifying a type of flag-affecting instruction as one of a plurality of predetermined types, and the step (b) comprises recording parameters for each type of flag-affecting instruction.
8. The method of claim 7, wherein the predetermined types include a first type instruction affecting a full set of condition code flags, and a second type instruction affecting a subset of the full set of condition code flags.
9. The method of claim 8, wherein the step (d) comprises resolving flag status for a full set of condition code flags with respect to the recorded first-type parameters, and resolving flag status with respect to the subset of the condition code flags with respect to the recorded second-type parameters.
10. The method of claim 9, wherein the step (d) comprises explicitly determining flag status from the recorded first-type parameters, and modifying the explicitly determined flag status from the- recorded second-type parameters.
11. The method of claim 7, wherein the predetermined types include instruction types each affecting a condition code flag set amongst a plurality of condition code flag sets.
12. The method of claim 1, wherein the recorded parameters include an instruction type parameter and one or more instruction operand parameters.
13. The method of claim 12, wherein recording an instruction operand parameter comprises storing a reference to a location containing an operand.
14. The method of claim 12, wherein recording an instruction operand parameter comprises determining that an operand remains available unmodified at an original location and storing a reference to the original location as the instruction operand parameter, or else copying the operand from the original location to a dedicated operand parameter storage location.
15. The method of claim 12, comprising providing a plurality of abstract registers representing registers of a subject processor, and supplementing the abstract registers with one or more additional abstract registers each for storing an operand as an instruction operand parameter.
16. A method for emulating condition code flags during program code conversion, comprising:
selecting a sequence of subject code instructions;
identifying a flag-affecting instruction in the sequence of subject code instructions, the flag-affecting instruction specifying an operation that affects subject condition code flags of a subject processor;
recording parameters of the identified flag-affecting instruction including an instruction type parameter and one or more operand parameters;
detecting a flag-usage instruction in the sequence of subject code instructions, the flag-usage instruction specifying an operation with reference to a flag status of one or more of the subject condition code flags; and
in response to detecting a flag-usage instruction, resolving a flag status of one or more of the subject condition code flags with respect to the recorded parameters.
17. The method of claim 16, comprising updating the recorded parameters when a new flag-affecting instruction is encountered in the sequence of subject code instructions.
18. The method of claim 16, comprising recording parameters for a plurality of flag-affecting instructions.
19. The method of claim 18, wherein the plurality of flag-affecting instructions are each associated with differing sets of subject condition code flags.
20. The method of claim 16, comprising resolving flag status by at least one of (a) explicitly calculating a status for one or more subject condition code flags by emulating an effect of the recorded flag-affecting instruction, or (b) implicitly representing the flag-usage instruction using the recorded parameters, or (c) selecting between options (a) and (b) according to a type of the flag-usage instruction.
21. The method of claim 16, wherein the recorded parameters include at least one instruction operand parameter, and wherein recording the instruction operand parameter comprises .at least one of (a) copying an operand to a predetermined storage location, or (b) storing a reference to an original location containing the operand, or (c) selectively performing (a) or (b).
22. An emulator apparatus for use in a target computing environment for emulating a subject processor of a subject computing environment when translating subject code appropriate to the subject computing environment to produce target code appropriate to the target computing environment, the emulator apparatus comprising:
means for identifying a flag-affecting instruction in a sequence of subject code instructions;
an instruction parameter store for recording parameters of the identified flag-affecting instruction;
means for detecting a flag-usage instruction in the sequence of subject code instructions; and
means for resolving a flag status with respect to the instruction parameters recorded in the instruction parameter store.
23. A computing platform comprising the emulator apparatus of claim 22.
24. A computer-readable recording medium containing program code constructions for performing the method of claim 1.
25. A computer-readable recording medium containing program code constructions for performing the method of claim 16.
US10/314,179 2002-02-06 2002-12-05 Condition code flag emulation for program code conversion Abandoned US20030149963A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US10/361,000 US7331040B2 (en) 2002-02-06 2003-02-06 Condition code flag emulation for program code conversion
US11/957,343 US8024555B2 (en) 2002-02-06 2007-12-14 Condition code flag emulation for program code conversion

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
GB0202728.2 2002-02-06
GBGB0202728.2A GB0202728D0 (en) 2002-02-06 2002-02-06 Condition code flag emulation for program code conversion

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US10/361,000 Continuation-In-Part US7331040B2 (en) 2002-02-06 2003-02-06 Condition code flag emulation for program code conversion

Publications (1)

Publication Number Publication Date
US20030149963A1 true US20030149963A1 (en) 2003-08-07

Family

ID=9930503

Family Applications (2)

Application Number Title Priority Date Filing Date
US10/314,179 Abandoned US20030149963A1 (en) 2002-02-06 2002-12-05 Condition code flag emulation for program code conversion
US11/957,343 Active 2025-07-06 US8024555B2 (en) 2002-02-06 2007-12-14 Condition code flag emulation for program code conversion

Family Applications After (1)

Application Number Title Priority Date Filing Date
US11/957,343 Active 2025-07-06 US8024555B2 (en) 2002-02-06 2007-12-14 Condition code flag emulation for program code conversion

Country Status (4)

Country Link
US (2) US20030149963A1 (en)
JP (1) JP4911868B2 (en)
GB (2) GB0202728D0 (en)
HK (1) HK1056933A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040176941A1 (en) * 2003-03-04 2004-09-09 Shan-Chyun Ku Method of simulating computation instructions for an instruction set simulator
US20080034188A1 (en) * 2006-08-03 2008-02-07 Nec Corporation Information processing apparatus and method for accelerating information processing
US20080177985A1 (en) * 2002-02-06 2008-07-24 Transitive Limited Condition code flag emulation for program code conversion
US20100268916A1 (en) * 2007-12-29 2010-10-21 Institute Of Computing Technology Of The Chinese Academy Of Sciences Risc processor and its register flag bit processing method
US20120180039A1 (en) * 2011-01-11 2012-07-12 International Business Machines Corporation Automated Deployment of Applications with Tenant-Isolation Requirements

Families Citing this family (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7434209B2 (en) 2003-07-15 2008-10-07 Transitive Limited Method and apparatus for performing native binding to execute native code
GB0316531D0 (en) * 2003-07-15 2003-08-20 Transitive Ltd Method and apparatus for performing native binding
US8574393B2 (en) * 2007-12-21 2013-11-05 Tsinghua University Method for making touch panel
US8880853B2 (en) * 2008-02-01 2014-11-04 International Business Machines Corporation CAM-based wake-and-go snooping engine for waking a thread put to sleep for spinning on a target address lock
US8640141B2 (en) * 2008-02-01 2014-01-28 International Business Machines Corporation Wake-and-go mechanism with hardware private array
US8171476B2 (en) * 2008-02-01 2012-05-01 International Business Machines Corporation Wake-and-go mechanism with prioritization of threads
US8225120B2 (en) * 2008-02-01 2012-07-17 International Business Machines Corporation Wake-and-go mechanism with data exclusivity
US8127080B2 (en) 2008-02-01 2012-02-28 International Business Machines Corporation Wake-and-go mechanism with system address bus transaction master
US8732683B2 (en) * 2008-02-01 2014-05-20 International Business Machines Corporation Compiler providing idiom to idiom accelerator
US8145849B2 (en) 2008-02-01 2012-03-27 International Business Machines Corporation Wake-and-go mechanism with system bus response
US8612977B2 (en) 2008-02-01 2013-12-17 International Business Machines Corporation Wake-and-go mechanism with software save of thread state
US8341635B2 (en) * 2008-02-01 2012-12-25 International Business Machines Corporation Hardware wake-and-go mechanism with look-ahead polling
US8452947B2 (en) 2008-02-01 2013-05-28 International Business Machines Corporation Hardware wake-and-go mechanism and content addressable memory with instruction pre-fetch look-ahead to detect programming idioms
US8316218B2 (en) 2008-02-01 2012-11-20 International Business Machines Corporation Look-ahead wake-and-go engine with speculative execution
US8312458B2 (en) * 2008-02-01 2012-11-13 International Business Machines Corporation Central repository for wake-and-go mechanism
US8386822B2 (en) 2008-02-01 2013-02-26 International Business Machines Corporation Wake-and-go mechanism with data monitoring
US8516484B2 (en) * 2008-02-01 2013-08-20 International Business Machines Corporation Wake-and-go mechanism for a data processing system
US8725992B2 (en) 2008-02-01 2014-05-13 International Business Machines Corporation Programming language exposing idiom calls to a programming idiom accelerator
US8250396B2 (en) 2008-02-01 2012-08-21 International Business Machines Corporation Hardware wake-and-go mechanism for a data processing system
US8788795B2 (en) * 2008-02-01 2014-07-22 International Business Machines Corporation Programming idiom accelerator to examine pre-fetched instruction streams for multiple processors
CN100555225C (en) * 2008-03-17 2009-10-28 中国科学院计算技术研究所 A kind of risc processor device and method of supporting the X86 virtual machine
US8230201B2 (en) 2009-04-16 2012-07-24 International Business Machines Corporation Migrating sleeping and waking threads between wake-and-go mechanisms in a multiple processor data processing system
US8082315B2 (en) 2009-04-16 2011-12-20 International Business Machines Corporation Programming idiom accelerator for remote update
US8886919B2 (en) * 2009-04-16 2014-11-11 International Business Machines Corporation Remote update programming idiom accelerator with allocated processor resources
US8145723B2 (en) 2009-04-16 2012-03-27 International Business Machines Corporation Complex remote update programming idiom accelerator
US9811338B2 (en) * 2011-11-14 2017-11-07 Intel Corporation Flag non-modification extension for ISA instructions using prefixes
KR101642556B1 (en) * 2012-09-21 2016-07-25 인텔 코포레이션 Methods and systems for performing a binary translation
US10261785B2 (en) 2017-02-28 2019-04-16 Microsoft Technology Licensing, Llc Arithmetic lazy flags representation for emulation
US10884720B2 (en) 2018-10-04 2021-01-05 Microsoft Technology Licensing, Llc Memory ordering annotations for binary emulation
US10684835B1 (en) * 2018-12-11 2020-06-16 Microsoft Technology Licensing, Llc Improving emulation and tracing performance using compiler-generated emulation optimization metadata

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5768593A (en) * 1996-03-22 1998-06-16 Connectix Corporation Dynamic cross-compilation system and method
US5805895A (en) * 1996-06-09 1998-09-08 Motorola, Inc. Method and apparatus for code translation optimization
US20020026633A1 (en) * 1991-04-23 2002-02-28 Shinobu Koizumi Retargetable information processing system

Family Cites Families (66)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4514803A (en) 1982-04-26 1985-04-30 International Business Machines Corporation Methods for partitioning mainframe instruction sets to implement microprocessor based emulation thereof
JPS6017539A (en) 1983-07-11 1985-01-29 Hitachi Ltd Emulation system
US5329471A (en) 1987-06-02 1994-07-12 Texas Instruments Incorporated Emulation devices, systems and methods utilizing state machines
US6522985B1 (en) 1989-07-31 2003-02-18 Texas Instruments Incorporated Emulation devices, systems and methods utilizing state machines
US4951195A (en) * 1988-02-01 1990-08-21 International Business Machines Corporation Condition code graph analysis for simulating a CPU processor
CA2002201C (en) 1988-12-06 1999-04-27 John Charles Goettelmann Translation technique
US5313614A (en) 1988-12-06 1994-05-17 At&T Bell Laboratories Method and apparatus for direct conversion of programs in object code form between different hardware architecture computer systems
US5077657A (en) * 1989-06-15 1991-12-31 Unisys Emulator Assist unit which forms addresses of user instruction operands in response to emulator assist unit commands from host processor
US5805792A (en) 1989-07-31 1998-09-08 Texas Instruments Incorporated Emulation devices, systems, and methods
JPH04229337A (en) 1990-12-27 1992-08-18 Hitachi Ltd Emulator
EP0528019B1 (en) * 1991-03-07 1997-05-02 Digital Equipment Corporation Method and apparatus for computer code processing in a code translator
US5507030A (en) 1991-03-07 1996-04-09 Digitial Equipment Corporation Successive translation, execution and interpretation of computer program having code at unknown locations due to execution transfer instructions having computed destination addresses
US5598560A (en) 1991-03-07 1997-01-28 Digital Equipment Corporation Tracking condition codes in translation code for different machine architectures
US5630157A (en) 1991-06-13 1997-05-13 International Business Machines Corporation Computer organization for multiple and out-of-order execution of condition code testing and setting instructions
US5440702A (en) 1992-10-16 1995-08-08 Delco Electronics Corporation Data processing system with condition code architecture for executing single instruction range checking and limiting operations
WO1994027215A1 (en) 1993-05-07 1994-11-24 Apple Computer, Inc. Method for decoding guest instructions for a host computer
US6126329A (en) 1993-06-08 2000-10-03 Rational Software Coporation Method and apparatus for accurate profiling of computer programs
US5999737A (en) 1994-03-01 1999-12-07 Digital Equipment Corporation Link time optimization via dead code elimination, code motion, code partitioning, code grouping, loop analysis with code motion, loop invariant analysis and active variable to register analysis
US5574927A (en) 1994-03-25 1996-11-12 International Meta Systems, Inc. RISC architecture computer configured for emulation of the instruction set of a target computer
US5481719A (en) 1994-09-09 1996-01-02 International Business Machines Corporation Exception handling method and apparatus for a microkernel data processing system
US5751982A (en) 1995-03-31 1998-05-12 Apple Computer, Inc. Software emulation system with dynamic translation of emulated instructions for increased processing speed
US5737631A (en) 1995-04-05 1998-04-07 Xilinx Inc Reprogrammable instruction set accelerator
US6076155A (en) 1995-10-24 2000-06-13 S3 Incorporated Shared register architecture for a dual-instruction-set CPU to facilitate data exchange between the instruction sets
US6077314A (en) 1995-12-06 2000-06-20 International Business Machines Corporation Method of, system for, and computer program product for providing improved code motion and code redundancy removal using extended global value numbering
US6105124A (en) 1996-01-26 2000-08-15 Intel Corporation Method and apparatus for merging binary translated basic blocks of instructions
US6535903B2 (en) 1996-01-29 2003-03-18 Compaq Information Technologies Group, L.P. Method and apparatus for maintaining translated routine stack in a binary translation environment
US6000028A (en) 1996-01-29 1999-12-07 Digital Equipment Corporation Means and apparatus for maintaining condition codes in an unevaluated state
US5930509A (en) 1996-01-29 1999-07-27 Digital Equipment Corporation Method and apparatus for performing binary translation
US6199095B1 (en) 1996-01-29 2001-03-06 Compaq Computer Corporation System and method for achieving object method transparency in a multi-code execution environment
US6091897A (en) 1996-01-29 2000-07-18 Digital Equipment Corporation Fast translation and execution of a computer program on a non-native architecture by use of background translator
US6330691B1 (en) 1996-02-23 2001-12-11 Institute For The Development Of Emerging Architectures Llc Use of dynamic translation to provide breakpoints in non-writeable object code
US5901308A (en) 1996-03-18 1999-05-04 Digital Equipment Corporation Software mechanism for reducing exceptions generated by speculatively scheduled instructions
US5946491A (en) 1996-06-06 1999-08-31 International Business Machines Corporation Register allocation method and apparatus for gernerating spill code as a function of register pressure compared to dual thresholds
US5903760A (en) * 1996-06-27 1999-05-11 Intel Corporation Method and apparatus for translating a conditional instruction compatible with a first instruction set architecture (ISA) into a conditional instruction compatible with a second ISA
US5890000A (en) 1996-12-04 1999-03-30 International Business Machines Corporation Cooperation of global and local register allocators for better handling of procedures
US5925124A (en) 1997-02-27 1999-07-20 International Business Machines Corporation Dynamic conversion between different instruction codes by recombination of instruction elements
US6031994A (en) 1997-04-01 2000-02-29 Intel Corporation Method for determining the set of variables that may be ambiguously defined at a point in a computer program
JP3327818B2 (en) 1997-08-29 2002-09-24 松下電器産業株式会社 Program conversion device and recording medium
US5870575A (en) 1997-09-22 1999-02-09 International Business Machines Corporation Indirect unconditional branches in data processing system emulation mode
US5956495A (en) 1997-09-22 1999-09-21 International Business Machines Corporation Method and system for processing branch instructions during emulation in a data processing system
US6505296B2 (en) 1997-10-13 2003-01-07 Hewlett-Packard Company Emulated branch effected by trampoline mechanism
US6185675B1 (en) 1997-10-24 2001-02-06 Advanced Micro Devices, Inc. Basic block oriented trace cache utilizing a basic block sequence buffer to indicate program order of cached basic blocks
US6170083B1 (en) 1997-11-12 2001-01-02 Intel Corporation Method for performing dynamic optimization of computer code
US6009261A (en) 1997-12-16 1999-12-28 International Business Machines Corporation Preprocessing of stored target routines for emulating incompatible instructions on a target processor
US6631514B1 (en) 1998-01-06 2003-10-07 Hewlett-Packard Development, L.P. Emulation system that uses dynamic binary translation and permits the safe speculation of trapping operations
US6530078B1 (en) 1998-03-26 2003-03-04 Alexander V. Shmid Virtual machines in OS/390 for execution of any guest system
US6434741B1 (en) 1998-04-30 2002-08-13 Hewlett-Packard Company Method and apparatus for debugging of optimized code using emulation
US6205545B1 (en) 1998-04-30 2001-03-20 Hewlett-Packard Company Method and apparatus for using static branch predictions hints with dynamically translated code traces to improve performance
US6427234B1 (en) 1998-06-11 2002-07-30 University Of Washington System and method for performing selective dynamic compilation using run-time information
US6223339B1 (en) 1998-09-08 2001-04-24 Hewlett-Packard Company System, method, and product for memory management in a dynamic translator
US6360194B1 (en) 1998-09-08 2002-03-19 Bull Hn Information Systems Inc. Different word size multiprocessor emulation
US6301705B1 (en) 1998-10-01 2001-10-09 Institute For The Development Of Emerging Architectures, L.L.C. System and method for deferring exceptions generated during speculative execution
US6308318B2 (en) 1998-10-07 2001-10-23 Hewlett-Packard Company Method and apparatus for handling asynchronous exceptions in a dynamic translation system
US20020147969A1 (en) 1998-10-21 2002-10-10 Richard A. Lethin Dynamic optimizing object code translator for architecture emulation and dynamic optimizing object code translation method
EP0997815A3 (en) 1998-10-29 2004-05-26 Texas Instruments Incorporated Interactive translation system and method
US6321379B1 (en) 1998-12-23 2001-11-20 Cray Inc. Method and system for target register allocation
US6539471B2 (en) 1998-12-23 2003-03-25 Intel Corporation Method and apparatus for pre-processing instructions for a processor
US6594824B1 (en) 1999-02-17 2003-07-15 Elbrus International Limited Profile driven code motion and scheduling
US6530079B1 (en) 1999-06-02 2003-03-04 International Business Machines Corporation Method for optimizing locks in computer programs
US6539541B1 (en) 1999-08-20 2003-03-25 Intel Corporation Method of constructing and unrolling speculatively counted loops
US6523173B1 (en) 2000-01-11 2003-02-18 International Business Machines Corporation Method and apparatus for allocating registers during code compilation using different spill strategies to evaluate spill cost
US6526572B1 (en) 2000-02-09 2003-02-25 Hewlett-Packard Company Mechanism for software register renaming and load speculation in an optimizer
US6643630B1 (en) 2000-04-13 2003-11-04 Koninklijke Philips Electronics N.V. Apparatus and method for annotating an intermediate representation of an application source code
US6564297B1 (en) 2000-06-15 2003-05-13 Sun Microsystems, Inc. Compiler-based cache line optimization
US6549987B1 (en) 2000-11-16 2003-04-15 Intel Corporation Cache structure for storing variable length data
GB0202728D0 (en) * 2002-02-06 2002-03-27 Transitive Technologies Ltd Condition code flag emulation for program code conversion

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020026633A1 (en) * 1991-04-23 2002-02-28 Shinobu Koizumi Retargetable information processing system
US5768593A (en) * 1996-03-22 1998-06-16 Connectix Corporation Dynamic cross-compilation system and method
US5805895A (en) * 1996-06-09 1998-09-08 Motorola, Inc. Method and apparatus for code translation optimization

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080177985A1 (en) * 2002-02-06 2008-07-24 Transitive Limited Condition code flag emulation for program code conversion
US8024555B2 (en) * 2002-02-06 2011-09-20 International Business Machines Corporation Condition code flag emulation for program code conversion
US20040176941A1 (en) * 2003-03-04 2004-09-09 Shan-Chyun Ku Method of simulating computation instructions for an instruction set simulator
US20080034188A1 (en) * 2006-08-03 2008-02-07 Nec Corporation Information processing apparatus and method for accelerating information processing
US7886133B2 (en) * 2006-08-03 2011-02-08 Nec Corporation Information processing apparatus and method for accelerating information processing
US20100268916A1 (en) * 2007-12-29 2010-10-21 Institute Of Computing Technology Of The Chinese Academy Of Sciences Risc processor and its register flag bit processing method
US9189232B2 (en) * 2007-12-29 2015-11-17 Loongson Technology Corporation Limited RISC processor and its register flag bit processing method
US20120180039A1 (en) * 2011-01-11 2012-07-12 International Business Machines Corporation Automated Deployment of Applications with Tenant-Isolation Requirements
US9104514B2 (en) * 2011-01-11 2015-08-11 International Business Machines Corporation Automated deployment of applications with tenant-isolation requirements

Also Published As

Publication number Publication date
US20080177985A1 (en) 2008-07-24
GB0302718D0 (en) 2003-03-12
HK1056933A1 (en) 2004-03-05
US8024555B2 (en) 2011-09-20
JP4911868B2 (en) 2012-04-04
GB0202728D0 (en) 2002-03-27
GB2388218B (en) 2005-01-26
GB2388218A (en) 2003-11-05
JP2004038923A (en) 2004-02-05

Similar Documents

Publication Publication Date Title
US20030149963A1 (en) Condition code flag emulation for program code conversion
US7331040B2 (en) Condition code flag emulation for program code conversion
US5721927A (en) Method for verifying contiquity of a binary translated block of instructions by attaching a compare and/or branch instruction to predecessor block of instructions
KR100463810B1 (en) Memory controller for a microprocessor for detecting a failure of speculation on the physical nature of a component being addressed
US6009261A (en) Preprocessing of stored target routines for emulating incompatible instructions on a target processor
EP2324424B1 (en) Apparatus and method for handling page protection faults in a computing system
EP2267598B1 (en) Risc processor apparatus and method for supporting x86 virtual machine
EP0817996B1 (en) Software emulation system with dynamic translation of emulated instructions for increased processing speed
US5903760A (en) Method and apparatus for translating a conditional instruction compatible with a first instruction set architecture (ISA) into a conditional instruction compatible with a second ISA
KR100816781B1 (en) Data processing using multiple instruction sets
US8578351B2 (en) Hybrid mechanism for more efficient emulation and method therefor
US7809547B2 (en) Host computer system emulating target system legacy software and providing for incorporating more powerful application program elements into the flow of the legacy software
US8364461B2 (en) Reusing invalidated traces in a system emulator
KR100443759B1 (en) Improved microprocessor
JP2001504957A (en) Memory data aliasing method and apparatus in advanced processor
JPH0782441B2 (en) Simulation method
JP2001507151A (en) Gate storage buffers for advanced microprocessors.
US7171543B1 (en) Method and apparatus for executing a 32-bit application by confining the application to a 32-bit address space subset in a 64-bit processor
US5764962A (en) Emulation of asynchronous signals using a branch mechanism
KR100864891B1 (en) Unhandled operation handling in multiple instruction set systems
US5732235A (en) Method and system for minimizing the number of cycles required to execute semantic routines
US20070156386A1 (en) Linearization of page based memory for increased performance in a software emulated central processing unit
US6467037B1 (en) Utilizing a program counter with one or more data counters for executing instructions
US7069205B1 (en) System and method for emulating the operation of a video graphics adapter
US10133655B1 (en) Emulation of target system using JIT compiler and bypassing translation of selected target code blocks

Legal Events

Date Code Title Description
AS Assignment

Owner name: TRANSITIVE TECHNOLOGIES LIMITED, UNITED KINGDOM

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:SANDHAM, JOHN;NORTH, GERAINT M.;REEL/FRAME:013752/0793

Effective date: 20030203

AS Assignment

Owner name: TRANSITIVE LIMITED, UNITED KINGDOM

Free format text: CHANGE OF NAME;ASSIGNOR:TRANSITIVE TECHNOLOGIES LIMITED;REEL/FRAME:017940/0686

Effective date: 20030620

STCB Information on status: application discontinuation

Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION

AS Assignment

Owner name: IBM UNITED KINGDOM LIMITED, ENGLAND

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:TRANSITIVE LIMITED;REEL/FRAME:022824/0715

Effective date: 20090529

Owner name: IBM UNITED KINGDOM LIMITED,ENGLAND

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:TRANSITIVE LIMITED;REEL/FRAME:022824/0715

Effective date: 20090529

AS Assignment

Owner name: IBM CORPORATION, NEW YORK

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:IBM UNITED KINGDOM LIMITED;REEL/FRAME:022928/0190

Effective date: 20090626

Owner name: IBM CORPORATION,NEW YORK

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:IBM UNITED KINGDOM LIMITED;REEL/FRAME:022928/0190

Effective date: 20090626

AS Assignment

Owner name: INTERNATIONAL BUSINESS MACHINES CORPORATION, NEW Y

Free format text: CORRECTIVE ASSIGNMENT TO CORRECT THE ASSIGNEE NAME PREVIOUSLY RECORDED ON REEL 022928 FRAME 0190. ASSIGNOR(S) HEREBY CONFIRMS THE RECEIVING PARTY;ASSIGNOR:IBM UNITED KINGDOM LIMITED;REEL/FRAME:031085/0824

Effective date: 20090626