Processor apparatus and complex condition processing method

Information

  • Patent Application
  • 20070234019
  • Publication Number
    20070234019
  • Date Filed
    March 21, 2007
    17 years ago
  • Date Published
    October 04, 2007
    17 years ago
Abstract
Disclosed is a processor apparatus that has an instruction set that includes a complex conditional branch instruction that performs comparison operations corresponding to one or more conditions and causes a branch to a specified branch destination to be taken, based on a comparison operation between a result of the comparison operations and a specified branch condition value; and a condition setting instruction that sets a condition. The apparatus includes a plurality of condition setting/comparison units each of which is selected by an execution of the condition setting instruction, in each of which a condition specified by the condition setting instruction is set and, when the complex conditional branch instruction is executed, each of which performs a comparison operation corresponding to the condition specified by the condition setting instruction; and a complex conditional branch determination unit that determines whether to cause the branch to the branch destination to be taken or not, based on a result of a comparison between a result of the comparison operations of the plurality of condition setting/comparison units and the branch condition value specified by the complex conditional branch instruction.
Description

BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1 is a diagram showing the configuration of one example of the present invention.



FIG. 2 is a diagram showing a condition setting/comparison unit and its related parts in one example of the present invention.



FIG. 3 is a diagram showing a condition setting/comparison unit and its related parts in one example of the present invention.



FIG. 4 is a diagram showing a condition setting/comparison unit and its related parts in one example of the present invention.



FIG. 5 is a diagram showing a complex conditional branch determination unit and its related parts in one example of the present invention.



FIG. 6 is a diagram showing condition setting instructions and a complex conditional branch instruction coded in Assembler in one example of the present invention.



FIG. 7 is a time chart showing the operation of the condition setting instruction in one example of the present invention.



FIG. 8 is a time chart showing the operation of the complex conditional branch instruction in one example of the present invention.



FIGS. 9A and 9B are diagrams showing one example of the present invention and showing the bit-to-bit correspondence between the comparison operation result of a complex condition and a branch condition.



FIGS. 10A and 10B are time charts showing the operation of complex condition processing when loop processing is applied to the complex condition processing method in Patent Document 1.


Claims
  • 1. A processor apparatus comprising: an instruction set that includes: a conditional branch instruction that causes a branch to a branch destination to be taken, depending upon whether or not a condition is true; anda condition setting instruction that sets the condition;a circuit that, when executing the condition setting instruction, sets a condition specified by the condition setting instruction, but does not perform a comparison operation corresponding to the condition; anda circuit that, when executing the conditional branch instruction, performs the comparison operation corresponding to the condition, which has been set in advance by the condition setting instruction, to determine whether to cause a branch to the branch destination to be taken or not, based on a result of the comparison operation.
  • 2. The apparatus according to claim 1, wherein the conditional branch instruction is a complex branch condition instruction having a complex condition composed of a plurality of conditions for determining whether to cause the branch to be taken or not;a plurality of the condition setting instructions are executed to set the conditions of the complex condition; andwhen the complex conditional branch instruction is executed, a plurality of comparison operations corresponding to respective ones of the plurality of the conditions, which have been set in advance are executed, in parallel, and, based on a result of the plurality of comparison operations, determines whether to cause the branch to be taken or not, whereby conditional branch processing based on the complex condition is performed by one complex conditional branch instruction.
  • 3. A processor apparatus comprising: an instruction set that includes: a complex conditional branch instruction that performs comparison operations corresponding to one or more conditions and causes a branch to a specified branch destination to be taken, based on a comparison operation between a result of the comparison operations and a specified branch condition value; anda condition setting instruction that sets a condition;a plurality of condition setting/comparison units each of which is selected by an execution of the condition setting instruction, in each of which a condition specified by the condition setting instruction is set and, when the complex conditional branch instruction is executed, each of which performs a comparison operation corresponding to the condition specified by the condition setting instruction; anda complex conditional branch determination unit that determines, when the complex conditional branch instruction is executed, whether to cause the branch to the branch destination to be taken or not, based on a result of a comparison between a result of the comparison operations of said plurality of condition setting/comparison units and the branch condition value specified by the complex conditional branch instruction.
  • 4. The apparatus according to claim 3, wherein the condition setting instruction includes, in an operand thereof, a specification of the condition setting/comparison unit, a type of comparison operation, and registers in an operation register or a register in the operation register and immediate data to be used in the comparison operation.
  • 5. The apparatus according to claim 3, wherein the complex conditional branch instruction includes a type of comparison operation in an op code, and the branch condition value and the branch destination in an operand.
  • 6. The apparatus according to claim 3, wherein the condition that is set in said condition setting/comparison unit by the execution of the condition setting instruction is held until another condition setting instruction is executed after the condition setting instruction, said condition setting/comparison unit is selected again by said another condition setting instruction, and the condition is rewritten by another condition.
  • 7. The apparatus according to claim 3, wherein said condition setting/comparison unit comprises:first and second address registers that store address information on two operation registers to be compared;an immediate value register that stores immediate value data;a comparator selection register that stores a type of comparison operation;a comparator; andfirst and second decoders that decode addresses of said first and second address registers; whereinwhen the condition setting instruction is executed, values are set in said first and second address registers or in said first address register and said immediate value register, and in said comparator selection register; andwhen the complex conditional branch instruction is executed, said operation registers specified by said first and second address registers, or said operation register specified by said first address register, is read and the values of the two operation registers read by the specification of the first and second address registers are compared, or the value of said operation register read by the specification of said first address register is compared with the immediate value data, by said comparator.
  • 8. The apparatus according to claim 3, further comprising a plurality of registers in which results of the comparison operations by said plurality of condition setting/comparison units are saved.
  • 9. The apparatus according to claim 8, wherein said complex conditional branch determination unit comprises:a first register that receives an output from an instruction decoder that decodes the complex conditional branch instruction and stores the branch condition value specified by the complex conditional branch instruction;a second register that stores the type of comparison operation; anda comparator that outputs a comparison result by performing a comparison operation, specified by said second register, for outputs of said plurality of registers, in which the results of the comparison operations by said plurality of condition setting/comparison units are saved, and the branch condition value specified by said first register.
  • 10. The apparatus according to claim 3, further comprising a selector that selects the condition setting/comparison unit specified by the condition setting instruction, based on a decoding result of the condition setting instruction by the instruction decoder.
  • 11. The apparatus according to claim 10, further comprising: a jump destination address register that stores a jump destination address specified by the complex conditional branch instruction decoded by said instruction decoder; anda selector that receives a true/false value, which is a result output from said complex conditional branch determination unit, selects the jump destination address if the true/false value is true, selects an address produced by adding one to a program counter value if the true/false value is false, and sets the selected address in said program counter.
  • 12. A conditional branch processing method for use by a processor wherein said processor comprises an instruction set that includes: a conditional branch instruction that causes a branch to a branch destination to be taken, depending upon whether or not a condition is true; anda condition setting instruction that sets the condition, said method comprising the steps of:setting a condition specified by the condition setting instruction, but without performing a comparison operation corresponding to the condition, when the condition setting instruction is executed; andperforming the comparison operation corresponding to the condition, which has been set in advance by the condition setting instruction, to determine whether to cause the branch to the branch destination to be taken or not, based on a result of the comparison operation, when the conditional branch instruction is executed.
  • 13. The method according to claim 12, wherein the conditional branch instruction is a complex branch condition instruction having a complex condition composed of a plurality of conditions for determining whether to cause the branch to be taken or not;a plurality of the condition setting instructions are executed to set the conditions of the complex condition; andwhen the complex conditional branch instruction is executed, the conditional branch instruction executes comparison operations corresponding to the plurality of the conditions, which have been set in advance, in parallel and, based on a result of the plurality of the comparison operations, determines whether to cause the branch to be taken or not, whereby conditional branch processing based on the complex condition is performed by one complex conditional branch instruction.
Priority Claims (1)
Number Date Country Kind
2006-094589 Mar 2006 JP national