US20050257032A1 - Accessing a test condition - Google Patents

Accessing a test condition Download PDF

Info

Publication number
US20050257032A1
US20050257032A1 US11/159,161 US15916105A US2005257032A1 US 20050257032 A1 US20050257032 A1 US 20050257032A1 US 15916105 A US15916105 A US 15916105A US 2005257032 A1 US2005257032 A1 US 2005257032A1
Authority
US
United States
Prior art keywords
condition
test
instruction
code
register
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
US11/159,161
Inventor
Sophie Wilson
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.)
Avago Technologies General IP Singapore Pte Ltd
Original Assignee
Broadcom Corp
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
Priority to GB9917126A priority Critical patent/GB2352308B/en
Priority to GB9917126.6 priority
Priority to US09/395,296 priority patent/US6530015B1/en
Priority to US10/341,590 priority patent/US6918029B2/en
Assigned to ELEMENT 14, INC. reassignment ELEMENT 14, INC. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: WILSON, SOPHIE
Priority to US11/159,161 priority patent/US20050257032A1/en
Application filed by Broadcom Corp filed Critical Broadcom Corp
Assigned to BROADCOM UK LTD reassignment BROADCOM UK LTD CHANGE OF NAME (SEE DOCUMENT FOR DETAILS). Assignors: ELEMENT 14, INC.
Assigned to BROADCOM CORPORATION reassignment BROADCOM CORPORATION ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: BROADCOM UK, LTD
Publication of US20050257032A1 publication Critical patent/US20050257032A1/en
Assigned to BANK OF AMERICA, N.A., AS COLLATERAL AGENT reassignment BANK OF AMERICA, N.A., AS COLLATERAL AGENT PATENT SECURITY AGREEMENT Assignors: BROADCOM CORPORATION
Assigned to AVAGO TECHNOLOGIES GENERAL IP (SINGAPORE) PTE. LTD. reassignment AVAGO TECHNOLOGIES GENERAL IP (SINGAPORE) PTE. LTD. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: BROADCOM CORPORATION
Assigned to BROADCOM CORPORATION reassignment BROADCOM CORPORATION TERMINATION AND RELEASE OF SECURITY INTEREST IN PATENTS Assignors: BANK OF AMERICA, N.A., AS COLLATERAL AGENT
Application status is Abandoned legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30094Condition code generation, e.g. Carry, Zero flag
    • GPHYSICS
    • G06COMPUTING; CALCULATING; 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/3001Arithmetic instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING; 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30036Instructions to perform operations on packed data, e.g. vector operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING; 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30072Arrangements for executing specific machine instructions to perform conditional operations, e.g. using guard

Abstract

A method and system of executing computer instructions is described. Each instruction defines first and second operands and an operation to be carried out on said operands. Each instruction also contains an address field of a predetermined bit length which identifies a test register holding a plurality of test bits greater than the predetermined bit length. The test register holds a test code defining a test condition. The test condition is checked against at least one condition code and the operation is selectively carried out in dependence on whether the condition code satisfies the test condition. In one embodiment, the condition codes are set on a lane-by-lane basis for packed operands.

Description

    CROSS-REFERENCE TO RELATED APPLICATIONS
  • This application is a continuation of the U.S. Non-Provisional qapplication Ser. No. 10/341,590, filed Jan. 14, 2003, which is a continuation of U.S. Non-Provisional application Ser. No. 09/395,296, filed Sep. 13, 1999, now U.S. Pat. No. 6,530,015, issued Mar. 4, 2003, all of which are incorporated herein in their entireties by reference.
  • BACKGROUND OF THE INVENTION
  • 1. Field of the Invention
  • The present invention relates to accessing a test condition, and in particular to a method of conditionally executing computer instructions, a computer system and a computer program product.
  • 2. Background Art
  • Computer systems are known where execution of an instruction is predicated on some value identified or addressed in the instruction. According to one proposal, a multibit test code is defined in each instruction, the multibit test code indicating a certain test condition. That condition is checked against a condition code held in the computer system and set by an earlier instruction. If the condition defined in the test code is satisfied by the condition code, the instruction is executed. If it is not, then the instruction is not executed.
  • In that arrangement, the number of test conditions which can be identified is restricted by the available length of the address field addressing the test register in the instruction. More test conditions can be defined, but at the expense of using up more bits in the instruction.
  • BRIEF SUMMARY OF THE INVENTION
  • According to one aspect of the present invention there is provided a method of executing computer instructions each of which define first and second operands and an operation to be carried out on said operands, each instruction containing an address field of a predetermined bit length which identifies a test register holding a plurality of test bits greater than said predetermined bit length, the method comprising: accessing said first and second source operands; accessing the test register identified in the address field and deriving from that test register a test code defining a test condition; checking the test condition against at least one condition code; and selectively carrying out the operation defined in the instruction in dependence on whether the condition code satisfies the test condition.
  • Some instructions operate on so-called packed operands, each of which contain a plurality of packed objects in respective lanes. In that case, the method can comprise checking the test condition against a condition code set for each lane of the operand and carrying out the operation only in those lanes for which the condition code satisfies the test condition.
  • The test register can contain a condition code selector wherein the method comprises checking the test condition against the condition code selected by the condition code selector in the addressed test register and selectively carrying out the operation in dependence on whether the condition code satisfies the test condition.
  • In the described embodiment, the address field in the instruction is 3 bits long, and the test register contains 8 bits, a 4 bit test code, a 3 bit condition code selector and a single side field bit. The side field bit is used in computer systems which have first and second execution channels with corresponding first and second associated sets of condition codes. The side field bit denotes which set of condition codes is to be accessed. It is possible to arrange the computer system such that an instruction executed on one of the execution channels updates its associated set of condition codes which is then accessible by an instruction executing on the other execution channel.
  • The invention further provides a computer system for conditionally carrying out an operation defined in a computer instruction, the computer system comprising: fetch and decoding circuitry for fetching and decoding a sequence of instructions from a program memory; at least one execution unit for conditionally executing said instructions and including means for accessing a test register defined in an address field of the instruction; a condition code register for holding a set of condition codes used in determining whether or not the instruction is to be executed; and a test register holding a test code defining a test condition to be checked against at least one condition code in the set of condition codes to determine whether or not the instruction is to be executed.
  • The invention further provides a computer program product comprising program code means in the form of a sequence of computer instructions each of which define first and second operands and an operation to be carried out on said operands, each instruction further including an address field of a predetermined bit length which identifies a test register holding a plurality of test bits greater than said predetermined bit length, the computer program product being loadable into a computer system and cooperating with the computer system to cause the test register identified in the address field to be accessed, a test condition held in the test register to be checked against at least one condition code, and the operation to be selectively carried out in dependence on whether the condition code satisfies the test condition.
  • For a better understanding of the present invention and to show how the same may be carried into effect, reference will now be made by way of example to the accompanying drawings.
  • BRIEF DESCRIPTION OF THE DRAWINGS/FIGURES
  • FIG. 1 is a schematic block diagram illustrating a processor;
  • FIG. 2 is a diagram illustrating the encoding of two “packed” instructions;
  • FIG. 3 illustrates a number of different 32 bit instruction formats;
  • FIG. 4 illustrates the contents of a text register;
  • FIG. 5 illustrates the contents of a condition code register;
  • FIG. 6 is a diagram illustrating setting of condition codes; and
  • FIG. 7 is a diagram illustrating use of condition codes.
  • DETAILED DESCRIPTION OF THE INVENTION
  • The computer system described herein is schematically illustrated in FIG. 1 is a schematic diagram of the system. In FIG. 1, reference numeral 2 denotes a program memory which holds programs in the form of a plurality of instructions. The program memory 2 is connected to an instruction cache 3 which is connected to instruction fetch/decode circuitry 4. The fetch/decode circuitry issues addresses to the program memory and receives on each fetch operation a 64 bit instruction from the program memory 2 (or cache 3). Each 64 bit instruction can define two operations or a single operation. The decode unit 4 evaluates the opcode and transmits the appropriate control signals along X and Y channels 5 x, 5 y, Each channel comprises a SIMD execution unit 8 x, 8 y which includes three data processing units, MAC, INT and FPU and a load/store unit LSU 6. Each data processing unit MAC, INT and FPU and the load/store units LSU operate on a single instruction multiple data (SIMD) principle according to the SIMD lane expressed in the instruction according to the following protocol which defines the degree of packing of objects for packed data processing operations: (B) 8 bit objects (bo . . . b7) (H) 16 bit objects (ho . . . h3) (W) 32 bit objects (w0 . . . w,) (L) 64 bit objects (I) (S) 32 bit floating point (D) 64 bit floating point

    For each channel 5x, 5y if the instruction defines a data processing operation it is supplied to the appropriate data processing unit MAC, INT or FPU and if it defines a load/store operation it is supplied to the load/store unit LSU. Data values are loaded to and from the MAC data processing units into and out of a common register file 10 which includes sixteen 64 bit special purpose registers along register access paths 12 x, 12 y. Data values are loaded to and from the INT and FPU data processing units and the load/store units LSU into and out of a second register file 11 which includes sixty-four 64-bit general purpose registers. Register access paths 14 x, 14 y are provided for these accesses. The program counter PC which indicates the current instruction can be read via one of the general purpose registers (the PC register). Another one of the general purpose registers constitutes a control and status register. The general purpose registers also include a condition code register (CCreg) and a test register TSTreg which are discussed in more detail in the following.
  • Each register access path 12, 14 carries three addresses from the accessing unit, two source addresses SRC1, SRC2 and a destination address DST. In the case of data processing operations, the source addresses SRC1, SRC2 define registers in the register files 10, 11 which hold source operands for processing by the data processing unit. The destination address DST identifies a destination register into which a result of data processing will be placed. The operands and results are conveyed between the register file 10 or 11 and the respective data processing unit via the access paths 12, 14. In the case of load/store operations, the instruction formats allow memory access addresses Ax, Ay to be formulated from data values held in the registers as described in our copending Application No. (PWF Ref: 92472) as described later. The load/store units access a common address space in the form of a data memory 16 via a dual ported data cache DCACHE 15. For this purpose, each load/store unit has a 64 bit data bus Dx, Dy and a 64 bit address bus Ax, Ay.
  • The architecture supports two types of instruction, so called “long instructions” and “dual operation instructions”. Each 64 bit dual operation instruction defines two 31 bit operations in the manner illustrated in FIG. 2. That is, each 64 bit sequence contains two 32 bit instruction portions labelled INST1 and INST2. Each instruction also includes a designated set of identification bits which identify the type of each operation. There are two such bits in FIG. 2 at bit locations 31 and 63 denoted ID1 and ID2 in FIG. 2. In this embodiment operations are divided into data processing (DP) types or a load/store (LD/ST) types. The allowed combinations are two data processing operations (ID1, ID2 both set to “0”), two load/store operations (ID1, ID2 both set to “1”) or one data processing and one load/store operation (ID1=0,ID2=1).
  • FIG. 3 illustrates a number of basic formats for the 32 bit data processing portions of dual operation instructions. Each 32 bit operation requires the resources of one load/store unit, or one or more of the SIMD data processing units (MAC, INT, FPU) to execute. Thus, normally, two 32 bit operations can execute simultaneously, one in each of the X and Y channels. In the following, the X and Y channels are sometimes referred to as the right and left sides of the processor.
  • Format (1) defines register-register operations. Format (2) defines register-immediate operations. Format (3) defines a memory access operation. Memory access operations are not discussed further herein but it is noted that they are used to load data from memory into the register files and to provide store operations for the reverse.
  • The data processing instruction formats have the following fields in common. There are three identification bits, M (bit 31) and G (bits 29 and 30) which denote the nature of the data processing operation. An opcode field (bits 22 to 28) which defines the nature of the operation to be carried out, a condition setting field S (bit 21), a test register field (bits 18 to 20) and fields defining two source registers Src1, Src2 and a destination register Dst. Of course, format (2) does not include a field identifying a second source register, but instead holds an immediate value. As mentioned above, the registers in the register files 10, 11 can hold a number of packed objects and in that case, normally, the operation defined in the opcode of the instruction will be carried out on each “lane” of the operand, that is on each pair of corresponding packed objects in respective source registers Src1, Src2 or source register and immediate value as the case may be.
  • As mentioned above, the general purpose registers 11 include CC registers and test registers. The test register holds a plurality of test bytes with each byte having a format as in FIG. 4, and the least significant byte set to zero. Each of these bytes will be referred to as a Treg byte [1 . . . 7]. The Treg bytes are programmable and are set to the required values prior to instruction execution. The test register is used to allow conditional execution of instructions. Each instruction format contains a 3 bit TST field which allows a Treg byte [1 to 7] to be specified. If a Treg byte is not specified in the instruction, the TST field in the opcode is set to 0, and the instruction executes unconditionally. A specified byte can be modified using an ADL instruction of format (2) which adds a byte value specified in the immediate field to a specified SIMD lane defined in the TST field (Treg byte [1 . . . 7]).
  • The 8-bit field of each Treg is as shown in FIG. 4.
  • The Condition field (bits 0 to 3) applies to all predicated instructions. It holds a 4 bit test code to allow for conditions to be tested. As discussed in more detail later, for instructions on packed objects, the condition applies to all the lanes on a per lane basis.
  • The four condition flags are:
      • N (Negative flag—bit 3)
      • Z (Zero flag—bit 2)
      • C (Carry flag—bit 1)
      • V (Overflow flag—bit 0)
  • These four bits give rise to 16 test conditions (see Table 1). TABLE 1 Opcode Mnemonic Meaning Flags 0000 AL Always execute 0001 EQ Equal Z 0010 NE Not Equal !Z 0011 CS Carry Set C 0100 CC Carry Clear !C 0101 MI Negative N 0110 PL Positive or Zero !N 0111 VS Overflow V 1000 VC No Overflow !V 1001 HI Unsigned Higher C.!Z 1010 LS Unsigned Lower or Equal !C + Z 1011 GE Greater or Equal N.V + !N.!V 1100 LT Signed Less Than N.!V + !N.V 1101 GT Signed Greater Than !Z.(N.V + !N.!V) 1110 LE Signed Less than or Equal Z.(N.!V + !N.V) 1111 Reserved Reserved Reserved
  • The CC-Selector field (bits 4 to 6) applies only to instructions on non-packed objects. The CC-Selector field designates the condition code (in the CC register discussed later) which is to be compared with the code in the Treg Byte.
  • In the described embodiment, the Side field (S-bit 7, X=O, Y=1) applies only to non-SIMD 64-bit instructions. For 32-bit operations the side is decided according to the channel in which the instruction is being executed, irrespective of what the side field is set to. For non-SIMD 64-bit instructions, the side field designates either left or right (X or Y) condition codes in the CC register.
  • The Condition code register is 64 bits long and the bit fields are defined in FIG. 5. Each condition code is four bits long (a nibble).
  • Each CC{X,Y} {0 . . . 7} nibble has the four condition flags (NZCV) in that order. The condition codes can be set and used on a per lane basis.
  • SIMD byte (B) operations update 8 condition codes, X or Y depending on the side of the machine.
      • CC{X, Y}0 . . . CC{X, Y}7
  • SIMD halfword (H) operations update four pairs of condition code as follows (again depending on the sides of the machine). That is, two condition codes are updated with the same value for each operation. CCXO = CCX1 CCYO = CCY1 CCX2 = CCS3 CCY2 = CCY3 CCX4 = CCX5 CCY4 = CCY5 CCX6 = CCX7 CCT6 = CCY7
  • SAID word (W) operations update two quads of condition codes, as follows (depending on the side of the machine). That is four condition flags are updated to the same value for each operation. CCXO = CCX1 = CCX2 = CCX3 CCY0 = CCY1 = CCY2 = CCY3 CCX4 = CCX5 = CCX6 = CCX7 CCY4 = CCY5 = CCY6 = CCY7
  • SIMD longword (L) operations update all eight condition codes as follows (depending on the side of the machine).
      • CCX0=CCX1=CCX2=CCX3=CCX4=CCX5=CCX6=CCX7
      • CCY0=CCY1=CCY2=CCY3=CCY4=CCY5=CCY6=CCY7
  • Use of the test register and condition code register will now be described with reference to the following examples. It will be understood that the following are examples only used to illustrate the principles of operation.
  • Consider the arithmetic operation ADD. This instruction can be implemented in a register-to-register format using format (1) in FIG. 3, or in a register-to-immediate format using format (2) of FIG. 3. Only the register-to-register format is described in detail in the following to illustrate the principles of the use of the test registers and the condition code register.
  • The instruction ADD has the following semantics:
      • ADD{B|H|W|L}{S}{Treg,} Dest, Src1, Src2.
  • Considering format (1) in FIG. 3, this instruction thus defines two source registers in the fields SRC1 and SRC2, each source register containing operands for the addition operation. If the instruction is ADDL, the registers are not packed but each contains a 64 bit object. For the ADDB, ADDH and ADDW instructions, each source register contains a number of packed objects according to the degree of packing defined earlier. It is assumed in the following example that each source register holds eight packed objects b0 . . . b7. A destination register DST is defined in the DST field of the instruction for holding the result of the addition operation. Eight packed objects are generated in the destination register. Assume for the time being that a single 32 bit operation is being effected by one channel (X or Y) of the processor.
  • FIG. 6 illustrates a diagram of one of the functional units which is capable of executing the ADD instruction. First and second 64 bit buffers 40,42 are provided for holding first and second source operands. In the illustrated example, the source operands contain eight packed objects b0 to b7, in each case. Addition circuitry 44 comprises eight operators, in this case addition circuits, each connected to receive two packed objects respectively from the same lane b0 . . . b7, of the input buffers 40, 42. Only the connections of the first and last objects are shown. Similar connections apply to each of the other addition circuits. An output buffer 46 holds the result which is likewise in the form of eight packed objects for loading into the destination register specified in the instruction. A condition code generator 48 also examines the results of each addition and generates condition codes for the side of the machine where the instruction is being executed to be held in the condition code register CCreg. The condition generator 48 always generates eight condition codes for each side of the machine regardless of the degree of packing of the source operands, as described more fully in the following.
  • The instruction format (1) contains an S flag (bit 21). If this flag is set, then the condition codes for the side of the machine in which the instruction is being executed are set. Assume in this example that the instruction is being executed on the X side of the machine. The condition code generator 48 generates condition codes CCX0 to CCX7 by considering the results of the addition operations which were carried out on each packed object in the source registers and determining from those operations the values of N,Z,C and V which are the bits defining each condition code. In the example of FIG. 6, a different condition code can be generated for each condition code location CCX0 . . . CCX7 in the condition code register. Condition codes are set as follows. The N flag of the condition code is set if the result is negative, that is the top bit is set (event for unsigned inputs). The Z flag is set if the result is zero. The C flag is set if the operation generated an output carry. The V flag is set if the operation overflowed its range before being wrapped or saturated.
  • If the S flag in the instruction is not set, the condition register is not updated.
  • For the above explanation it has been assumed that the addition operation was carried out. It is possible to predicate the ADD instruction itself on condition codes which have been set by an earlier instruction or instruction sequence. For this purpose, the instruction format contains a test register field TST (bits 18 to 20). These three bits allow one of the test register bytes Treg (1 . . . 7) to be addressed. If a test register byte is specified in the TST field of the instruction, then each condition code on the side of the machine where the instruction is being executed is checked against the condition code specified in the addressed Treg byte. If the TST field is set to zero, such that no Treg byte is specified, then the instruction always executes.
  • After comparing the test code specified in the addressed Treg byte with each of the condition codes CCX0 . . . CCX7 (assuming the operation is being executed on the X side of the machine), then the specified operation is carried out on the SIMD lanes where there is a match, and is not carried out on the SIMD lanes where there is no match. An example is illustrated in FIG. 7. Assume that the operation illustrated in FIG. 6 and described above has been carried out and that condition codes CCX0 to CCX7 have been set as described above depending on the results of the arithmetic operation in each of the SIMD lanes b0 . . . b7: It is assumed for this example that the condition codes are: b0 0010, b1, 0101, b2 0011, b3 0010, b4 0010, b5 0100. This is illustrated in the condition code register in FIG. 7. Let us also assume that the addressed test register byte in the TST field of the instruction holds the condition code 0011. This denotes the condition Carry Set C. SIMD lanes b0,b2,b3,b4 satisfy this condition. Assume that the subsequent operation to be carried out is also an ADD instruction operating on the byte packed contents of two source registers SRC1, SRC2 with the results to be loaded into a destination register DST. Because a test register byte has been specified, the addition operation is only effected on the SIMD lanes where the condition code set for that lane (CCX0 . . . CCX7) satisfies the condition defined by the test code set in the addressed Treg byte. This is determined by a condition code checker 50. The output of the condition code checker 50 controls a set of switches 52, one for each SIMD lane b0 . . . b7. These switches control whether or not the results of the addition operation recited in the instruction update the values in the corresponding lane in the destination register DST. This is shown diagrammatically in FIG. 7, with a cross illustrating that the result of the addition operation does not get loaded into the destination register, and a through arrow illustrating that it does. This is denoted in the destination register by DST denoting an original byte in the destination register (that is prior to execution of the instruction), and RES denoting a result byte which, following execution of the instruction is a result of the arithmetic operation on that lane.
  • As mentioned above, when an instruction is to be executed on less densely packed objects, for example H or W, eight condition codes are still set, in pairs or quads as mentioned above. Assume for example that an operation is carried out on halfword packed objects h0 . . . h3. The condition generator 48 determines condition code values by setting the N,C,Z and V flags as before for each SIMD lane. Thus, four condition code values are generated. These are used to set eight condition codes in the condition code register as condition code pairs as mentioned above. Once the condition codes have been set in the condition code register, they can be used in subsequent instructions operating on any degree of packing. For halfword packed objects, the first condition code CCX0 and every alternate condition code thereafter is checked against the test code in the addressed Treg byte to determine whether or not the instruction executes on that SIMD lane. For word packed objects, the first condition code and the fourth condition code is checked against the test code in the addressed Treg byte to determined whether or not the operation should be executed on that SIMD lane.
  • For long word operations, the first condition code CCX0 is evaluated. As described above, all condition codes for one side of the machine will have the same value set.
  • For non-SIMD instructions, that is instructions where the operands are not packed, the condition codes can still be used to determine whether or not the instruction is executed. In that case, the TST field of the instruction again identifies a Treg byte. The condition selector in the Treg byte identifies one condition code which can be on the right or left sides. The side bit S denotes which side of the machine (X or Y). That is, any condition code out of the sixteen condition codes CCX0 . . . CCX7, CCY0 . . . CCY7 can be identified by the condition selector. The code held in the condition bits 0 to 3 of the Treg byte is then tested against the selected condition code to determine whether or not the instruction is executed. If the test condition is satisfied the instruction is executed. If not, the instruction is not executed.
  • From the above description it will be appreciated that although the processor has right and left sides (X and Y channels), the condition code register is accessible from both sides. For 32 bit operations, condition codes are set and accessed according to the side of the processor which is actually processing the 32 bit operation. Thus, 32 bit operations processed in the X channel 5X update the condition codes for the X channel CCX0 . . . CCX7, and are executed conditionally only on the X channel codes CCX0 . . . CCX7. Similarly, for 32 bit operations being executed in the Y channel 5Y. However, 64 bit operations have greater flexibility. 64 bit instructions also include a TST field for accessing a Treg byte in a manner similar to the 32 bit operations discussed above. In that case, the side field S in the accessed Treg byte determines which condition codes (X or Y) are used. That is, the side field S determines both which condition codes are set pursuant to a 64 bit instruction being executed and, also, on which condition codes (X or Y) operation of the 64 bit instruction is predicated. Thus, this considerably increases the options available on the execution of 64 bit instructions.
  • It will be understood that a number of variations are possible to the embodiment described above. For example, the Side bit S in the Treg byte can be used always to denote the required set of condition codes (X or Y), rather than only in non-SIMD 64-bit instructions as mentioned above. Also, there is no need for a specific condition set flag S in the instruction—whether or not condition codes are to be set can be defined in the opcode or the instruction semantics can be such that condition codes are always set.
  • Considering FIG. 7, it is possible to implement conditional lane-by-lane execution in a number of ways. Another alternative to that described would be to perform the operation (and power-up the respective operators) only when the test condition is satisfied for that lane.

Claims (12)

1. A method for conditionally executing operations contained in an instruction, the method comprising:
(a) executing a first operation in a first instruction to generate a set of condition codes;
(b) in a second instruction having a test register field, selecting a test code from a test register defined by an address in the test register field, the test code defining a test condition;
(c) checking the defined test condition against the set of condition codes; and
(d) selectively executing a second operation in the second instruction only when the condition codes generated by the first instruction satisfy the test condition defined in the second instruction.
2. The method of claim 1, wherein the test condition has a greater number of bits than the test register field.
3. The method of claim 1, wherein the first and second instruction further includes fields defining a first and second operand, and wherein operations are executed upon the first and second operands.
4. The method of claim 3, wherein the first operand and second operand each contain a plurality of packed objects in respective lanes, wherein step (c) further comprises checking the test condition against a condition code for each lane of the first or second operand, and step (d) further comprises executing the operation only in those lanes in which the condition code satisfies the test condition.
5. The method of claim 1, wherein a bit length of the test register field is three bits long, wherein the test register comprises a test code having four bits, a condition code selector having three bits, and a single side field bit.
6. The method of claim 5, wherein the single side field bit denotes which set of condition codes are to be accessed where there are dual execution channels, each having an associated set of condition codes.
7. A computer system for conditionally executing an operation included in a computer instruction, the computer system comprising:
memory means for storing first and second instructions, the instructions each defining a test register field and an opcode field;
means for identifying a test register based on an address in the test register field, the test register having a test code that defines a test condition;
computer processing means for executing an operation defined in the opcode field of the first instruction, wherein said execution of the first instruction generates a set of condition codes; and
means for checking at least one condition code against a test condition defined in the second instruction;
wherein an operation defined in the opcode field of the second instruction, is executed when the condition code generated by the execution of the first instruction satisfies the test condition defined in the second instruction.
8. The system of claim 7, wherein the test condition has a greater number of bits than the test register field.
9. The system of claim 7, wherein the instructions further include fields defining a first and second operand, and wherein the operations are conditionally executed upon the first and second operands.
10. The system of claim 9, wherein the first operand and second operand each contain a plurality of packed objects in respective lanes, and wherein the checking means further included means for checking the test condition against a condition code for each lane of the first or second operand, and further comprising computer processing means for executing the operation only in those lanes in which the condition code satisfies the test condition.
11. The system of claim 7, wherein the bit length of the test register field is three bits long, wherein the test register comprises a test code having four bits, a condition code selector having three bits, and a single side field bit.
12. The system of claim 11, wherein the single side field bit denotes which set of condition codes are to be accessed where the computer system has dual execution channels, each channel having an associated set of condition codes.
US11/159,161 1999-07-21 2005-06-23 Accessing a test condition Abandoned US20050257032A1 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
GB9917126A GB2352308B (en) 1999-07-21 1999-07-21 Accessing a test condition
GB9917126.6 1999-07-21
US09/395,296 US6530015B1 (en) 1999-07-21 1999-09-13 Accessing a test condition for multiple sub-operations using a test register
US10/341,590 US6918029B2 (en) 1999-07-21 2003-01-14 Method and system for executing conditional instructions using a test register address that points to a test register from which a test code is selected
US11/159,161 US20050257032A1 (en) 1999-07-21 2005-06-23 Accessing a test condition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US11/159,161 US20050257032A1 (en) 1999-07-21 2005-06-23 Accessing a test condition

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
US10/341,590 Continuation US6918029B2 (en) 1999-07-21 2003-01-14 Method and system for executing conditional instructions using a test register address that points to a test register from which a test code is selected

Publications (1)

Publication Number Publication Date
US20050257032A1 true US20050257032A1 (en) 2005-11-17

Family

ID=10857674

Family Applications (3)

Application Number Title Priority Date Filing Date
US09/395,296 Expired - Fee Related US6530015B1 (en) 1999-07-21 1999-09-13 Accessing a test condition for multiple sub-operations using a test register
US10/341,590 Expired - Fee Related US6918029B2 (en) 1999-07-21 2003-01-14 Method and system for executing conditional instructions using a test register address that points to a test register from which a test code is selected
US11/159,161 Abandoned US20050257032A1 (en) 1999-07-21 2005-06-23 Accessing a test condition

Family Applications Before (2)

Application Number Title Priority Date Filing Date
US09/395,296 Expired - Fee Related US6530015B1 (en) 1999-07-21 1999-09-13 Accessing a test condition for multiple sub-operations using a test register
US10/341,590 Expired - Fee Related US6918029B2 (en) 1999-07-21 2003-01-14 Method and system for executing conditional instructions using a test register address that points to a test register from which a test code is selected

Country Status (2)

Country Link
US (3) US6530015B1 (en)
GB (1) GB2352308B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060168426A1 (en) * 1999-07-21 2006-07-27 Broadcom Corporation System and method for selectively controlling operations in lanes
GB2484654A (en) * 2010-10-12 2012-04-25 Advanced Risc Mach Ltd Apparatus and method of performing a conditional select operation

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100274988A1 (en) * 2002-02-04 2010-10-28 Mimar Tibet Flexible vector modes of operation for SIMD processor
US7793084B1 (en) 2002-07-22 2010-09-07 Mimar Tibet Efficient handling of vector high-level language conditional constructs in a SIMD processor
US7002595B2 (en) 2002-10-04 2006-02-21 Broadcom Corporation Processing of color graphics data
US7873812B1 (en) 2004-04-05 2011-01-18 Tibet MIMAR Method and system for efficient matrix multiplication in a SIMD processor architecture
US7647480B2 (en) 2004-07-27 2010-01-12 Arm Limited Handling of conditional instructions in a data processing apparatus
KR100628573B1 (en) * 2004-09-08 2006-09-26 삼성전자주식회사 Apparatus capable of execution of conditional instructions in out of order and method thereof
US7404110B1 (en) * 2004-12-01 2008-07-22 Advanced Micro Devices, Inc. Method and system for self-assembling instruction opcodes for a custom random functional test of a microprocessor
US7565514B2 (en) * 2006-04-28 2009-07-21 Freescale Semiconductor, Inc. Parallel condition code generation for SIMD operations
US8819399B1 (en) * 2009-07-31 2014-08-26 Google Inc. Predicated control flow and store instructions for native code module security

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3699526A (en) * 1971-03-26 1972-10-17 Ibm Program selection based upon intrinsic characteristics of an instruction stream
US5125092A (en) * 1989-01-09 1992-06-23 International Business Machines Corporation Method and apparatus for providing multiple condition code fields to to allow pipelined instructions contention free access to separate condition codes
US5471593A (en) * 1989-12-11 1995-11-28 Branigin; Michael H. Computer processor with an efficient means of executing many instructions simultaneously
US5509129A (en) * 1993-11-30 1996-04-16 Guttag; Karl M. Long instruction word controlling plural independent processor operations
US5555428A (en) * 1992-12-11 1996-09-10 Hughes Aircraft Company Activity masking with mask context of SIMD processors
US5659722A (en) * 1994-04-28 1997-08-19 International Business Machines Corporation Multiple condition code branching system in a multi-processor environment
US5898853A (en) * 1997-06-25 1999-04-27 Sun Microsystems, Inc. Apparatus for enforcing true dependencies in an out-of-order processor
US5974240A (en) * 1995-06-07 1999-10-26 International Business Machines Corporation Method and system for buffering condition code data in a data processing system having out-of-order and speculative instruction execution
US5996066A (en) * 1996-10-10 1999-11-30 Sun Microsystems, Inc. Partitioned multiply and add/subtract instruction for CPU with integrated graphics functions
US6041399A (en) * 1996-07-11 2000-03-21 Hitachi, Ltd. VLIW system with predicated instruction execution for individual instruction fields
US6052776A (en) * 1996-10-18 2000-04-18 Hitachi, Ltd. Branch operation system where instructions are queued until preparations is ascertained to be completed and branch distance is considered as an execution condition
US6115812A (en) * 1998-04-01 2000-09-05 Intel Corporation Method and apparatus for efficient vertical SIMD computations
US6173393B1 (en) * 1998-03-31 2001-01-09 Intel Corporation System for writing select non-contiguous bytes of data with single instruction having operand identifying byte mask corresponding to respective blocks of packed data
US6317820B1 (en) * 1998-06-05 2001-11-13 Texas Instruments Incorporated Dual-mode VLIW architecture providing a software-controlled varying mix of instruction-level and task-level parallelism
US6374346B1 (en) * 1997-01-24 2002-04-16 Texas Instruments Incorporated Processor with conditional execution of every instruction

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3699526A (en) * 1971-03-26 1972-10-17 Ibm Program selection based upon intrinsic characteristics of an instruction stream
US5125092A (en) * 1989-01-09 1992-06-23 International Business Machines Corporation Method and apparatus for providing multiple condition code fields to to allow pipelined instructions contention free access to separate condition codes
US5471593A (en) * 1989-12-11 1995-11-28 Branigin; Michael H. Computer processor with an efficient means of executing many instructions simultaneously
US5555428A (en) * 1992-12-11 1996-09-10 Hughes Aircraft Company Activity masking with mask context of SIMD processors
US5509129A (en) * 1993-11-30 1996-04-16 Guttag; Karl M. Long instruction word controlling plural independent processor operations
US5659722A (en) * 1994-04-28 1997-08-19 International Business Machines Corporation Multiple condition code branching system in a multi-processor environment
US5974240A (en) * 1995-06-07 1999-10-26 International Business Machines Corporation Method and system for buffering condition code data in a data processing system having out-of-order and speculative instruction execution
US6041399A (en) * 1996-07-11 2000-03-21 Hitachi, Ltd. VLIW system with predicated instruction execution for individual instruction fields
US5996066A (en) * 1996-10-10 1999-11-30 Sun Microsystems, Inc. Partitioned multiply and add/subtract instruction for CPU with integrated graphics functions
US6052776A (en) * 1996-10-18 2000-04-18 Hitachi, Ltd. Branch operation system where instructions are queued until preparations is ascertained to be completed and branch distance is considered as an execution condition
US6374346B1 (en) * 1997-01-24 2002-04-16 Texas Instruments Incorporated Processor with conditional execution of every instruction
US5898853A (en) * 1997-06-25 1999-04-27 Sun Microsystems, Inc. Apparatus for enforcing true dependencies in an out-of-order processor
US6173393B1 (en) * 1998-03-31 2001-01-09 Intel Corporation System for writing select non-contiguous bytes of data with single instruction having operand identifying byte mask corresponding to respective blocks of packed data
US6115812A (en) * 1998-04-01 2000-09-05 Intel Corporation Method and apparatus for efficient vertical SIMD computations
US6317820B1 (en) * 1998-06-05 2001-11-13 Texas Instruments Incorporated Dual-mode VLIW architecture providing a software-controlled varying mix of instruction-level and task-level parallelism

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060168426A1 (en) * 1999-07-21 2006-07-27 Broadcom Corporation System and method for selectively controlling operations in lanes
US7979679B2 (en) 1999-07-21 2011-07-12 Broadcom Corporation System and method for selectively controlling operations in lanes in an execution unit of a computer
GB2484654A (en) * 2010-10-12 2012-04-25 Advanced Risc Mach Ltd Apparatus and method of performing a conditional select operation
GB2484654B (en) * 2010-10-12 2013-10-09 Advanced Risc Mach Ltd Conditional selection of data elements
US9753724B2 (en) 2010-10-12 2017-09-05 Arm Limited Conditional selection of data elements
US9983872B2 (en) 2010-10-12 2018-05-29 Arm Limited Conditional selection of data elements

Also Published As

Publication number Publication date
GB9917126D0 (en) 1999-09-22
US20030221090A1 (en) 2003-11-27
US6918029B2 (en) 2005-07-12
GB2352308B (en) 2004-06-30
US6530015B1 (en) 2003-03-04
GB2352308A (en) 2001-01-24

Similar Documents

Publication Publication Date Title
US5465377A (en) Compounding preprocessor for cache for identifying multiple instructions which may be executed in parallel
US4454578A (en) Data processing unit with pipelined operands
US7334161B2 (en) Breakpoint logic unit, debug logic and breakpoint method for a data processing apparatus
EP0503514B1 (en) Backward-compatible computer architecture with extended word size and address space
US6334176B1 (en) Method and apparatus for generating an alignment control vector
JP5586128B2 (en) Method, recording medium, processor, and system for executing data processing
US5125092A (en) Method and apparatus for providing multiple condition code fields to to allow pipelined instructions contention free access to separate condition codes
US8650382B2 (en) Load/move and duplicate instructions for a processor
EP0680013B1 (en) Central processing unit with integrated graphics functions and method of executing graphics instructions by said central processing unit
EP2241968B1 (en) System with wide operand architecture, and method
US6021265A (en) Interoperability with multiple instruction sets
US5954815A (en) Invalidating instructions in fetched instruction blocks upon predicted two-step branch operations with second operation relative target address
EP1073950B1 (en) Method and apparatus for performing shift operations on packed data
EP0689128B1 (en) Computer instruction compression
US5303358A (en) Prefix instruction for modification of a subsequent instruction
EP0333366A2 (en) Context switching method and apparatus for use in a vector processing system
EP0071028B1 (en) Instructionshandling unit in a data processing system with instruction substitution and method of operation
US6816961B2 (en) Processing architecture having field swapping capability
US7421572B1 (en) Branch instruction for processor with branching dependent on a specified bit in a register
US5907842A (en) Method of sorting numbers to obtain maxima/minima values with ordering
US4021655A (en) Oversized data detection hardware for data processors which store data at variable length destinations
US5790844A (en) Millicode load and test access instruction that blocks interrupts in response to access exceptions
US5132898A (en) System for processing data having different formats
EP0138419B1 (en) Central processing unit for a digital computer
CA1242281A (en) Vector processing

Legal Events

Date Code Title Description
AS Assignment

Owner name: BROADCOM UK LTD, UNITED KINGDOM

Free format text: CHANGE OF NAME;ASSIGNOR:ELEMENT 14, INC.;REEL/FRAME:016721/0097

Effective date: 20010116

Owner name: ELEMENT 14, INC., UNITED KINGDOM

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:WILSON, SOPHIE;REEL/FRAME:016721/0105

Effective date: 19991203

Owner name: BROADCOM CORPORATION, CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:BROADCOM UK, LTD;REEL/FRAME:016725/0470

Effective date: 20010618

STCB Information on status: application discontinuation

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

AS Assignment

Owner name: BANK OF AMERICA, N.A., AS COLLATERAL AGENT, NORTH

Free format text: PATENT SECURITY AGREEMENT;ASSIGNOR:BROADCOM CORPORATION;REEL/FRAME:037806/0001

Effective date: 20160201

AS Assignment

Owner name: AVAGO TECHNOLOGIES GENERAL IP (SINGAPORE) PTE. LTD

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:BROADCOM CORPORATION;REEL/FRAME:041706/0001

Effective date: 20170120

AS Assignment

Owner name: BROADCOM CORPORATION, CALIFORNIA

Free format text: TERMINATION AND RELEASE OF SECURITY INTEREST IN PATENTS;ASSIGNOR:BANK OF AMERICA, N.A., AS COLLATERAL AGENT;REEL/FRAME:041712/0001

Effective date: 20170119