VECTOR MASK CONTROL SYSTEM

Abstract: The vector mask control system comprises a means for holding a plurality of operands each consisting of a plurality of elements; a means for holding vector mask information consisting of a plurality of elements associated with the respective elements of operand; and vector mask operation instruction executing means for taking out the respective elements sequentially from said operand holding means and, at the same time, the elements of the vector mask information sequentially from said vector mask information holding means so as to perform an operation on each of the elements of the operand in association with the successive element of the vector mask information. The system further comprises: means for identifying an instruction intended for a vector mask operation when an instruction word is decoded; first operation indicating means for discriminating the validity of the vector mask operation specified by a given area of an instruction word under said identifying means and, thereby, indicating a vector mask operation; holding means for holding a mode which determines a valid or invalid state of the vector mask operation; second operation indicating means for indicating the vector mask operation in response to an output of said identifying means and a mode output from said holding means, and means for causing the vector instruction executing means to execute the vector mask operation in response to an output from said first or second operation indicating means. This system makes it needless for a subroutine itself to be aware of a mask control and allows a flexible and efficient program to be developed and executed.

Description: This invention relates to a vector mask control system for performing vector mask operations in a vector processing apparatus which executes vector operations for scientific computation. Generally, it seldom occurs in processing vector data or other massive data that all the elements of the data are valid ones which should be processed and, rather, they are often the mixture of data to be processed and those needless to be processed. In light of this, a system has customarily employed which, while making reference to mask information associated with individual element data of an operand, performs an operation control on individual element data of the operand associated therewith. In the above-described type of data processing apparatus instructions are selectively executed in two different modes, i.e., one which makes reference to mask information and the other which does not. For a vector mask control system whose operation is based on whether or not to make reference to mask information, a reference can be made to a publication entitled "FEASIBILITY STUDY FOR A NUMERICAL AERODYNAMIC SIMULATION/DESCRIPTION" published in May 1979 by CONTROL DATA CORPORATION. In the disclosed processor, a system is utilized in which an instruction word includes a particular field for indicating whether or not to make reference to mask data and either one of the two modes of instruction execution is selected depending on the content of the field when the instruction word is decoded. Specifically, when reference to mask, or mask reference as will hereinafter referred to, is specified, a result of operation on an operand is validated or invalidated depending on the value of mask information associated with respective elements of the operand; when mask reference is not specified, the result of operation is always valid. How such processing actually proceeds will be described in detail. Referring to Fig. 1, assume that there is a program in which vectors (I), (I) and (I) (I = element numbers 1 ∼ n) are defined and, when (I) is larger than 0, (I) should be obtained by (I) = F ( (I), (I)) (where F(x, y) is any desired function) and, when (I) is equal to or smaller than 0 (I), it should not be obtained, and that in such a condition it is desired to use a generalized subroutine as a routine for obtaining (I). Then, the processing starts with identifying the content of (I), which is one of elements of an operand, in response to an operand compare instruction at the main routine side. A vector mask M (I) is generated which is M (I) = 1 if (I) is larger than 0 and M (I) = 0 if (I) is equal to or smaller than 0. Subsequently, the subroutine is executed with reference made to the vector mask M (I) . At this instant, the subroutine itself is often unaware of the above-mentioned mask control for generalized application purpose. In such a case, the prior art system which specifies mask reference in an instruction word cannot use the subroutine in its original condition, i.e. without any modification of the original subroutine. The result is the need for another subroutine which specifies mask reference in an instruction word intended for a masked operation, leading to a significant decrease of efficiency. That is, the prior art system lacks flexibility since it has to be furnished with two different kinds of subroutines for accommodating user's programs. JP-A-57 23 174 (FUJITSU) shows a vector mask control system with a vector arithmetic operation using a vector mask bit. IEEE, DIGEST OF PAPERS FROM COMPCON FALL MEETING, Washington, 10th-12th September 1974, Micros and Minis, pages 229-234, IEEE, Long Beach, US; P. GREENFIELD et al.: "Signetics 2650 microprocessor" describes the design criteria of a particular microprocessor. wherein special instructions can be created to selectively set and reset any bit or group of bits in a program status word in order to change the way certain instructions are executed. Both techniques are similar to that described above. SUMMARY OF THE INVENTION It is, therefore, an object of the present invention to provide a vector mask control system which makes it needless for a subroutine itself to be aware of a mask control and allows a flexible and efficient program to be developed and executed. This object is solved with the vector mask control system according to claim 1. In this context the following explanation should be noted: the term "vector mask information" means a group of vector masks corresponding to each of a plurality of operand elements; the term "vector mask operation" means the execution of the decision whether or not the result of the operation corresponding to each of the operands is stored in the register by referring to the value of the vector mask; the term "vector mask" means information to designate whether the above-mentioned vector mask operation is valid or invalid; the first and second operation indicating means refer to two types of instructions. One instruction is used as the type of the vector instruction for the vector mask operation. The other instruction is not used for the vector mask operation. In the one instruction, whether or not the vector mask operation is executed, is determined by another information externally given; the term "mode" refers to the state of the holding means, e.g. a flip-flop, having a "mode output". BRIEF DESCRIPTION OF THE DRAWINGS The above and other objects, features and advantages of the present invention will become more apparent from the following detailed description taken with the accompanying drawings in which: Fig. 1 is a flowchart for explaining the background of the invention; Fig. 2 is a block diagram of one embodiment of the invention; Fig. 3 is a block diagram of a part of Fig. 2; and Fig. 4 demonstrates the operation of the embodiment of Fig. 2. DESCRIPTION OF THE PREFERRED EMBODIMENT Referring to Fig. 2, an embodiment of the invention comprises a register 1 for storing an instruction word to be executed, a decoder 2 for deciding whether or not an instruction specifies a masked operation, a mode flip-flop 3 for specifying a vector mask control system of a program under the management by a process currently in execution, a vector instruction execution unit 5, a flip-flop 4 for issuing an instruction to the unit 5 for executing a masked operation, and an instruction control section 6 adapted for decoding of an instruction word as well as for start-up processing. A line 100 led from the register 1 to the decoder 2 is for the transfer of an operation code. The decoder 2 serves to decode an operation code which is capable of effecting a predetermined masked operation. When the content delivered to the decoder 2 over the line 100 is the instruction capable of effecting the masked operation, the decoder 2 produces the result of the decoding on a line 101. When the content on the line 101 is logical "1", it shows that the instruction to be executed is intended for a masked operation. A line 102 is adapted to determine whether or not to actually validate the masked operation. A line 103 is a set signal line for setting the mode flip-flop 3 in response to a result of decoding the operation code from the register 1 which is the output of the instruction control section 6. When the line 103 is logical "1", that is, when a set instruction for the flip-flop 3 has been executed, a line 105 becomes logical "1" and a line 106, logical "0". A line 104, on the other hand, is a reset line which resets the flip-flop 3 in response to a result of decoding output from the section 6. When the line 104 is logical "1", that is, when a reset command for the flip-flop 3 has been executed, the line 105 becomes logical "0" and the line 106, logical "1". Whenever the instruction word to be executed is meant for a masked operation while the flip-flop 3 is logical "1", the execution unit 5 is instructed to execute the masked operation. The lines 101, 102 and 106 are connected to an AND gate A1. The output 107 of the gate A1 becomes logical "1" under the conditions wherein the output of the flip-flop 3 is logical "0", the line 101 is logical "1" as a result of decoding, and the line 102 is logical "1", which indicates the masked operation is valid in the instruction word. Meanwhile, the lines 101 and 105 are connected to an AND gate B1. The output 108 of the gate B1 becomes logical "1" when the flip-flop 3 is logical "1" and the line 101 indicative of a result of decoding, logical "1". Further, the outputs 107 and 108 of the AND gates are connected to an OR gate C1. When either of the outputs 107 and 108 is logical "1", the output 109 of the OR gate C1 becomes logical "1". The flip-flop 4 functions to issue an instruction for causing the execution unit 5 to execute the masked vector operation. In response to logical "1" on the line 109, the flip-flop 4 applies a masked operation instruction to the unit 5 over a line 110. The instruction control section 6, in response to an operation code and additional information coming in over the lines 100 and 111, respectively, decodes an instruction word and controls start-up. When identified the instruction word as a vector instruction, the instruction control section 6 instructs the execution unit 5 to start on the instructed operation over a line 112 while supplying thereto control data necessary for the operation over a line 113. The vector instruction execution unit 5 in the embodiment comprises a unit capable of performing masked vector operations and constructed in a well known manner and, therefore, it will be described only briefly herein. Referring to Fig. 3, an exemplary construction of the execution unit 5 is shown. The unit 5 comprises a vector instruction control section 50, a vector mask control section 51, storage sections 52 and 53 each storing vector data which consists of a plurality of elements, a storage section 54 storing vector mask data associated with the respective elements of the vector data, a vector data operating section 55 having a pipeline construction for sequentially performing operations on vector data read out of the storage sections 52 and 53, and a shift register 56 for holding the successive vector masks read out of the section 54 in association with each stage of the pipeline of the section 55. Now, the procedure of a masked vector operation will be briefly presented. The instruction control section 6 triggers the execution of a vector instruction over the line 112. At the same time, the section 6 supplies control data necessary for the execution of the instruction to the control section 50 over the line 113, while the flip-flop 4 informs the control section 51 of the designation of the masked operation over the line 110. In response to the execution instruction, the vector instruction control section 50 decodes the control data coming in through the line 113 and, thereby, delivers addresses and read instructions to the storage sections 52 and 53 over lines 502 and 503, respectively. Also, the control section 50 applies a vector mask read instruction to the vector mask control section 51 over a line 500 and, in turn, the control section 51 delivers an address and a read instruction to the storage section 54 over a line 504. Further, the control section 50 applies an operation instruction to the operating section 55 over a line 501. The vector data read out of the storage sections 52 and 53 are sequentially routed to the operating section 55 via lines 505 and 506, respectively, so as to be processed while passing through the pipeline as specified by the operation mode. The vector operation results are fed out to the storage sections 52 and 53. Meanwhile, the vector mask data sequentially read out of the storage section 54 are transferred to the shift register 56 over a line 507 to be sequentially shifted therein in synchronism with the operation of the pipeline. Timed to the delivery of vector results, vector masks associated with the vector results are fed to the control section 51 via a line 509. The control section 51, depending upon the content of the incoming successive vector mask, informs the control section 50 of whether or not the results can be stored in the storage section 52 and 53 over the line 500. That is, when the content of a vector mask has a valid value, i.e., "1", an address and a write instruction are fed over the signal line 502 or 503. When it has an invalid value, on the other hand, i.e., "0", the write instruction is suppressed via the line 502 or 503. By the above procedure, the masked vector operation is executed. The embodiment will further be described in conjunction with a program by way of example. When the flip-flop 3 is logical "0" in conjunction with a program to be executed, the execution of the masked vector operation depends on the value of the specific field of the instruction word which indicates validity of the masked vector operation. That is, assuming that at the time of decoding an instruction word an operation code is determined by the decoder 2 to be intended for the masked vector operation and the masked operation validity field to be logical "1", then all the lines 101, 102 and 106 are logical "1" and so is the line 107. In this condition, the set signal line 109 associated with the flip-flop 4 is logical "1" to make the flip-flop 4 logical "1" with the result that an instruction for the masked vector operation is applied to the vector instruction execution unit over the line 110. Meanwhile, under the condition wherein a program routine to be executed is of the kind which is programmed as a subroutine and, therefore, a mask control is not specified in an instruction word, it is sometimes desired to cause the subroutine to be executed while effecting mask reference. For example, it may be desired to execute a subroutine of a program B which is managed by a process 2 by generating mask information and making reference to the mask information by the execution of a program A which is controlled by a process 1. Assuming a case wherein the subroutine is one for computing a certain function F ( (I), (I)) for two vector data (I) and (I) (I = 1 ∼ n) to produce vector data (I), the vector data (I) is kept as it is when mask information M (I) IS "0" and (I) = F ( (I), (1)) is executed only when M (I) is "1". Then, by making the flip-flop 3 logical "1" at the time of switch from the process 1 to the process 2 prior to the execution of the subroutine, it is possible to cause the mask operation in the event of executing an instruction even if validity of the mask operation is not specified in the instruction word. Upon switching of the process from 2 to 1, which occurs when the operation returns to the program A after the subroutine, the flip-flop 3 will be reset to allow the rest of the program to be executed while deciding the masked vector operation depending on the value of the masked operation validity field of an instruction word. In the above-described manner, the subroutine B, without the need for being aware of mask reference itself, can be mask-controlled under the control of the flip-flop 3 during execution. In summary, it will be seen that the present invention achieves the development and execution of programs which allows unprecedented flexibility and efficiency.

Claims: A vector mask control system comprising: (a) an instruction word register (1) for storing an instruction word to be executed; (b) identifying means (2) for identifying an instruction intended for a vector mask operation when the operation code (100) of said instruction word is decoded, in which case a first identifier signal (101) is delivered; (c) a vector mask operation instruction executing means (5) which comprises: (c1) a operand holding means (52, 53) for holding a plurality of vector data operands each consisting of a plurality of elements, (c2) vector information and mask control sections (50 and 51, respectively) for receiving successive vector mask information (500) and a masked operation instruction signal (110); (c3) vector mask information holding means (54,56), for holding vector mask information consisting of a plurality of elements associated with the respective elements of the operands, (c4) a vector data operating section (55) for taking out the respective elements of the operand sequentially from said operand holding means (52, 53) and, at the same time, the vector mask information elements sequentially from said vector mask information holding means (54,56) so as to perform an operation on each of said operands elements (52,53) in accordance with successive vector mask information elements (56), and for executing a masked vector operation under control of said vector information and mask control sections (51 and 50, respectively) in response to a masked operation instruction signal (110); and (d) an instruction control section (6) for decoding said operation code (100) and additional information (111) from said instruction word (1) so as to issue control data signals (112, 113) to said vector mask operation instruction executing means (5); characterized in that: (e) said instruction control section (6) further delivers a SET signal (103) and a RESET signal (104) in accordance with the type of the instruction that is decoded, wherein said SET and RESET signals are at first fixed values when a first type of instruction is decoded corresponding to a program routine instruction, and at second fixed values when a second type of instruction is decoded corresponding to a subroutine instruction ; (f) holding means (3) are provided for receiving said SET and RESET signals and for accordingly holding a status which indicates a valid or invalid state of a vector mask operation; (g) first operation indicating means (A1) are provided for deciding about the validity of the vector mask operation specified by a fixed area (102) of said instruction word (1), determining whether or not to validate the masked operation, said first identifier signal (101) and said RESET signal (104) thereby issuing a first operation indication signal (107); (h) second operation indicating means (B1) are provided for deciding about the validity of the vector mask operation specified by said first identifier signal (101) and said SET signal (103), thereby issuing a second operation indication signal (108); (i) means (4) are provided for causing the vector mask instruction executing means (5) connected to said first and second operation indicating means (A1, B1) to execute the vector mask operation in response to said masked operation instruction signal (110) resulting from a logical combination between said first and second operation indicator signals (107, 108), thereby allowing a subroutine to be mask-controlled by said holding means (3). A vector mask control system according to claim 1, wherein said status is represented by complementary first and second status output signals (105, 106), and wherein: (a) in conjunction with said program routine instruction, to be executed, said first and second status output signals (105, 106) are fixed to the values (0,1) respectively, and (b) in conjunction with said subroutine instruction, to be executed said first and second status output signals (105, 106) are fixed to the values (1,0) respectively. A vector mask control system according to claim 1 or 2, wherein said first operation indicating means (A1) decides about the validity of said vector mask operation when said fixed area (102) of said instruction word (1) has the value "1", said first identifier signal (101) is "1", and said second status output signal (106) is "1", in which case said first operation indicator signal (107) having the logical "1" is delivered. A vector mask control system according to any one of claims 1 to 3, wherein said vector mask instruction executing means (5) is caused to execute the vector mask operation in response to said masked operation instruction signal (110) resulting from a logical OR between said first and second operation indicator signals (107, 108).

Inventors: OHWADA, KATSUAKI
Applicants: NEC CORPORATION
Application year: 1984
Main classification: G06F9
IPC codes: G06F17, G06F15