(19)
(11)EP 0 114 304 B1

(12)EUROPEAN PATENT SPECIFICATION

(45)Mention of the grant of the patent:
08.06.1988 Bulletin 1988/23

(21)Application number: 83112629.7

(22)Date of filing:  15.12.1983
(51)International Patent Classification (IPC)4G06F 15/347, G06F 9/38

(54)

Vector processing hardware assist and method

Hardwarehilfe und Verfahren zur Vektorverarbeitung

Assistance matérielle et méthode de traitement de vecteur


(84)Designated Contracting States:
DE FR GB

(30)Priority: 22.12.1982 US 452190

(43)Date of publication of application:
01.08.1984 Bulletin 1984/31

(73)Proprietor: International Business Machines Corporation
Armonk, N.Y. 10504 (US)

(72)Inventor:
  • Drimak, Edward George
    Johnson City New York 13790 (US)

(74)Representative: Suringar, Willem Joachim 
Intellectual Property Department IBM Nederland N.V. Watsonweg 2
1423 ND Uithoorn
1423 ND Uithoorn (NL)


(56)References cited: : 
US-A- 3 541 528
US-A- 4 128 880
  
  • IBM TECHNICAL DISCLOSURE BULLETIN, vol. 23, no. 4, September 1980, pages 1720-1724, New York (USA); J. HUANG et al.: "Vector mode computation"
  • IBM TECHNICAL DISCLOSURE BULLETIN, vol. 13, no. 2, July 1970, pages 420-421, New York (USA); A. KING et al.: "Instruction storage buffers"
  • W.K. Giloi: "Rechnerarchitektur", Sammlung Informatik, Heidelberger Taschenbücher Band 208, Spanger-Verlag, Berlin-Heidelberg-New York 1981, pages 63-71
  
Note: Within nine months from the publication of the mention of the grant of the European patent, any person may give notice to the European Patent Office of opposition to the European patent granted. Notice of opposition shall be filed in a written reasoned statement. It shall not be deemed to have been filed until the opposition fee has been paid. (Art. 99(1) European Patent Convention).


Description

Field of the invention



[0001] The present invention relates to the architecture of a digital processor to enable the processor to efficiently perform vector operations.

Background art



[0002] In the course of development of the data processing field, it has become evident that it may be desirable to provide specialized architecture to enhance machine operation on vector data.

[0003] Typically, to perform a given arithmetic function (even on non-vector data), each of the operands must be successively brought to the arithmetic unit, the function performed, and the result saved in somefashion.Thetime required to perform this overall operation may be much greater than that actually required to perform the given function due to the time required to deliver each operand, usually from memory, to the arithmetic unit, and the time required to save the result, also usually to memory. Under certain circumstances, this time can be considerably shortened by providing a cache, between the main memory and the arithmetic unit (usually contained in a central processing unit). The advantage obtained is derived from the fact that the accessing time of the cache is significantly shorter than the time required to access the main memory. Of course, the advantage can only be achieved if the necessary operands can be transferred from the main memory to the cache, prior to the time that the arithmetic function is going to be performed, and desirably so that the transfer from main memory to the cache overlaps, in time, a prior function. In this fashion, the unit time to perform an arithmetic function can be considerably shortened.

[0004] In certain operations, e.g. vector operations, it is typically necessary to perform the same operation repetitively on each successive element of a set of data. In data processing, a vector X is an ordered array of elements (X,, X2, X3f ... Xv(x))-The variable X, is called the ith component or element of the vector X, and the number of components, denoted by v(x) (or simply v when the determining vector is clear from the context), is called the dimension or length of X.

[0005] In scalar machines, in order to perform such repetitive operation, it is necessary to operate by software program and indexing so as to successively bring each operand to the arithmetic unit and to return the result to memory. This type of task is very time consuming because of the delays associated with the memory-arithmetic unit transfers for each operation on the individual elements of the ordered set.

[0006] Prior art illustrates a variety of improvements specifically aimed at vector operations. An illustrative vector operation performed by a vector machine is the adding of two operand vectors to produce a result vector. Each element of the result vector in this example is the sum of the corresponding ordered elements of the operand vectors. Basically, a vector machine is one which deals with these ordered sets of data by virtue of its hardware organization, rather than by software program and indexing, thus attaining a higher speed of operation.

[0007] Prior art vector architectures are described in Watson et al U.S. Patent 3,573,851; Cray, Jr. U.S. Patent 4,128,880; Muraoka et al U.S. Patent 4,293,941 and Niemann U.S. Patent 4,302,818. Of these, Muraoka is concerned with minimizing time lost in sequentially accessing different elements of a vector such that if access to one element is blocked, the memory cycle is not lost, rather access is accomplished to a different element of the vector during the time that access to the first element is blocked. The Watson, Cray and Niemann patents, on the other hand, teach the addition of substantial quantities of hardware to decrease the time consumed in vector operations.

[0008] Another technique to speed up computer operation is implicit load and store, which is described in Randall U.S. Patent 3,541,528.

[0009] In an article entitled "Vector mode computation" by Huang et al, published in IBM Technical Disclosure Bulletin, Vol. 23, No. 4, September 1980, pages 1720-1724, it is suggested to use the vector registers as a 'programmable cache' where the operands, once fetched from memory, shall remain as long as they are needed.

Summary of the invention



[0010] The present invention as claimed in claims 1 and 6 is based on the use of a cache memory (or cache) to perform the function of providing fast access to vector data. There are modifications necessary to enable a general purpose processor architecture to perform, in a time overlap fashion, the various functions required for vector processing. However, in accordance with the invention, the desired increase in vector processing speed is achieved with the addition of relatively few elements in the data processing path, and several additional registers and simple processing apparatus in the addressing structure.

[0011] Accordingly, it is one object of the present invention, as claimed, to provide for relatively efficient vector processing without requiring substantial quantities of hardware dedicated to vector processing. It is another object of the present invention to apply the advantages of a cache memory to machine architectures suitable for vector processing. It is another object of the invention to provide efficient vector processing using cache memory for operand and result storage. According to claim 6 reading and writing from cache is effectively overlapped firstly by using registers associated with an ALU (which is provided for performing arithmetic functions) for temporary vector element operand and result storage, and providing a buffer in a data path from the ALU to the cache.

[0012] The addressing structure includes three vector operand base address registers and a pair of offset registers. Two of the base address registers and one offset register are used for reading successive elements of two vectors, the offset register being incremented after certain ones of the reading operations. The third base address register and the other offset register are used for writing functions, with the offset register being incremented after each writing function. A vector mode selection control, operated under microprogram control, indicates when the processor is performing operations in the vector mode. The cache is subdivided into a vector space and a scalar space, and when the vector mode selection control indicates operation in the vector mode, the cache vector space is addressed using an address formed by concatenating the contents of a selected one of the vector operand base address registers and a selected one of the offset registers.

[0013] The data processing apparatus provides a path for data output from the cache, through a byte shifter to either one of two specified registers, depending upon the progress through the processing functions. A vector element can be applied to the ALU either directly from one of the specified operand registers or indirectly from the second operand register through another operand register or local storage. The result of the arithmetic function can be provided through the second specified operand register either to local storage or to another operand register. The data path back to the cache includes a buffer to enhance time overlap operation.

[0014] To take advantage of this vector processing, three explicit microprogrammed functions are provided along with a fourth implicit function. The three explicit functions are read vector operand, read vector operand and store, and load vector register. In this connection, the term vector register is specific to a portion of the cache vector space into which plural vector registers have been mapped. The implicit function operates during vector operating mode and provides for reading from an address in the cache, specified by the contents of one of the operand address registers and one offset register; this read operation is performed during every cycle that the data cache is not otherwise being used.

[0015] The read vector operand micro-instruction:

1. Loads a specified vector operand element accessed from the cache vector space in a preceding cycle into a specified one of the vector operand registers;

2. Loads a different vector operand element accessed from the cache vector space into a local storage location; and

3. Increments the contents of the offset register used during reading operation.



[0016] The read vector operand and store micro-instruction performs the same functions as the read vector operand instruction plus:

4. Loads the contents of a local storage location (which may contain an arithmetic result) into a shifter buffer.



[0017] In the following cycle, the same instruction:

5. Writes the contents of the shifter buffer into the cache vector space; and

6. Increments the offset register associated with writing operations.



[0018] The load vector register function:

1. Transfers a vector operand element from local storage or one of the vector operand registers to the cache vector space at a specified address; and

2. Increments the offset register associated with the write operation.



[0019] Application of the invention produces a machine with both scalar and vector processing capabilities. Since the cache is partitioned into vector and scalar data areas, the vector mode selection (when indicating vector operation) is used to enable addressing of the cache vector area.

[0020] Accordingly, in accordance with one aspect, the invention provides a digital data processing apparatus as claimed in claim 1.

[0021] The invention claimed in claim 6 also provides an efficient method of vector processing without requiring substantial additional hardware, especially by providing for vector registers mapped into cache and using an implicit read vector register operation each time the cache is not otherwise addressed during vector operation.

Brief description of the drawings



[0022] The present invention will now be described so as to enable those skilled in the art to make and use the same in the following portions of the specification when taken in conjunction with the attached drawings in which like reference characters identify identical apparatus and in which:

Figure 1 is a block diagram illustrating the relationship of the central processing unit, cache and main memory;

Figure 2 illustrates the apparatus used for addressing cache, specifically illustrating the apparatus employed to address the cache vector space;

Figure 3 is a block diagram of the portion of the central processing unit associated with transferring data to/from cache and to/from an arithmetic logic unit;

Figure 4 illustrates how plural vector registers are mapped into the cache vector space;

Figures 5 and 6 show timing diagrams for respectively the read vector operand functions and the load vector register function; and

Figures 7, 8 and 9 are examples of flow diagrams showing use of the microprogram instructions described above to perform respectively a vector binary add, a store vector register or a load vector register function.


Detailed description of preferred embodiments



[0023] Figure 1 illustrates, in block diagram fashion, the relationship of a central processing unit (CPU) 14, a relatively rapid access cache 10, along with the cache storage control 13, and a main storage and control 16. More particularly, as shown in Figure 1, the CPU 14 communicates both with the store control 13 of the cache 10 and the main store and control 16 via data and control paths 19 and 18, respectively. In this fashion, the CPU 14 can access and control either data stored in the cache 10, or data stored in the main memory 16. For data transfers between the cache 10 and the main storage and control 16, a data path 17 is provided. Accordingly, it should be apparent that the cache 10 is an intermediate memory, coupled between the main memory 16 and the CPU 14.

[0024] Referring now to Figure 2, the cache 10, according to this invention, is partitioned into two alternatively operable parts, i.e., the cache 10 is shown to include a cache vector space 11 and cache scalar space 12. That portion of Figure 2 below the dashed line AA' illustrates conventional (i.e. scalar) apparatus for addressing the cache 10. Particularly, an address register SSAR 22 provides an input to cache address 15, which addresses the cache 10. Data selected by the address so supplied are coupled to a cache output buffer 20, from whence they are coupled to the cache output assembler 25. Simultaneously, the cache directory compare 30 identifies which portion of the data in the cache output assembly 25 has been addressed, the cache output assembly 25 provides for the appropriate selection and the resulting data are coupled to the CPU 14, specifically to a byte shifter 52 via data path 51 (see Figure 3). For convenience, the numbers in parentheses associated with different data coupling lines identify the width (in bits) of the information passing on different paths. Thus, as shown in Figure 2, the cache address is 9 bits, selecting 64 bytes from the cache. The output of the cache directory compare 30 selects one 8-byte group of the 64 bytes, and the selected 8-byte group is coupled to the shifter 52 via data path 51, for subsequent use in the CPU 14.

[0025] In accordance with a suggestion found in the above-cited Huan et al article, a cache is used as a convenient space for implementing vector registers. For purposes of this description, the cache 1-0 is assumed to take one machine cycle to read data and 1) cycles to write data; the write consisting first of a cache read followed by a cache write modifying the data that were just read. In accordance with the invention, multiple element vector registers are mapped into the cache vector space 11 such that an operand address register may be used to denote a particular vector register, and an offset register may be used to access consecutive elements of the vector register. See, for example, Figure 4 which is a memory map of cache 10, showing it divided into vector space 11 and scalar space 12. Plural vector registers are mapped into the vector space 11. Figure 4 shows three such vector registers, one for each of vector operands 1, 2 and 3. Those skilled in the art will realize that many more than the three illustrative vector registers may be mapped into the vector space 11. The vector registers each have a capacity of N vector elements, where each element is separately addressable. If concatenation of the initial contents of a base and an offset address register sums to the address of vector register 1, element 1, that element may be addressed. If thereafter, the contents of the offset register are incremented, vector register 1, element 2 may be accessed. As will be described, the embodiment of the invention illustrated herein uses a single offset register and two base registers to successively access successive elements of two vector register operands, by incrementing the offset register only after the selected elements of both vectors have been accessed. Thus, with the offset register at a particular value, corresponding elements of two vectors are accessible, as illustrated in Figure 4.

[0026] A combination of a third base register and a second offset register allows access to a third vector register mapped in the vector space 11. Reading and writing may be interleaved by incrementing the offset registers (OEO and REO) at different times. Thus, Figure 4 illustrates a snapshot of a typical condition of OEO and REO in which REO allows access to a given element, whereas OEO is, simultaneously, in a condition to allow the access to the next higher adjacent element.

[0027] Referring now to Figure 2, three vector operand base address registers (VR1, VR2 and VR3) 50, 49 and 48 are provided for selecting up to two vector operands and a result vector location. The two element offset registers (OEO, REO) 47 and 46, respectively, plus update circuitry (44, 45) are provided to select particular elements of the vector operands and the result vector. The use of two offset registers permits overlapping the fetch of an operand element with the writing of a previously generated result element. the vector operand base address registers and the offset registers 46-50 are initialized at the beginning of a vector operation. The system is put into vector operation mode for the duration of the vector operation by changing the condition of the vector mode selection control 41. The cache address 15 is modified as follows. In a scalar machine, an address input from SSAR 22 into cache address 15 merely provides access to (the scalar space of) cache 10. To employ the invention, cache address 15 is provided with a second input for access to cache vector space 11. The second input has the ability to concatenate its cache vector address inputs when vector operation is indicated by the condition of vector mode control 41.

[0028] More particularly as shown in Figure 2, a sequence of vector operand elements is accessed from the cache vector space 11 as follows:

[0029] The four bits in VR1 50 (coupled to gate 43) are divided into three bits coupled to a decoder 40, and the remaining bit is concatenated with the 8 bits from one of the offset registers 46 or 47, (coupled to gate 42) to form a 9-bit address to address the cache 10 via cache address 15. During vector operations, the vector mode selection control 41 is in a distinctive state providing signals to

[0030] both the cache address 15 and the cache 10, indicating addressing of the cache vector space 11. The decoder circuit 40 energizes a selected one of eight select lines via gate 31 to select one 8-byte group of the eight such groups output by the cache 10 in response to the supplied address.

[0031] The next element of a vector is accessed by merely incrementing the appropriate offset register. Additional elements of the same vector are accessed by successively incrementing the offset register.

[0032] A second vector may be accessed using the contents of VR2 49 (coupled to gate 43), for example, and the identical offset register. Of course, under these circumstances the offset register is incremented only after accessing the associated element of the second vector operand in sequence.

[0033] Addressing is provided for a third vector (the result vector) employing the register VR3 48 (coupled to gate 43) and a different offset register (REO) 46. The different offset registers are employed so that they may be incremented at different times to overlap the reading and writing, as will be explained in more detail below.

[0034] Those skilled in the art will understand that while the widths of the different information elements employed in addressing the cache vector space 11 as illustrated in Figure 2, are suitable, other different size cache vector spaces 11 can be addressed by varying the information field length in the vector base address operand registers and/ or offset registers.

[0035] Referring now to Figure 3, the data path to/from cache 10 and to/from the (unillustrated) arithmetic logic unit ALU is illustrated in detail. The apparatus of Figure 3 is generally considered part of CPU 14. As shown in Figure 3, the data path from the cache 10 includes a path 51 providing one input to a byte shifter 52. One output of the byte shifter 52 is coupled over path 57 to a D register 56, and is also coupled, over path 85, to an A register 55. The D register 56 has an output, coupled over path 59, the other input of the A register 55, an input of the B register 54 and an input of a local storage unit 53. The local storage unit 53 may be implemented in the form of a push down stack so as to provide storage for multiple data words or vector elements. The output of the local storage register 53 is coupled over a path 58 to the other input of the B register 54. Outputs of the A register 55 and B register 54 are coupled as inputs to the ALU as well as to a gate 60. The gate 60 is coupled to a bit shifter 61, whose output is coupled over a path 62 to another input of the byte shifter 52, as well as over a path 82 to a shifter buffer 81. A second output of the byte shifter 52 is coupled via path 63 to gate 83. The output of the shifter buffer 81 is also coupled to gate 83 via path 84. The output of gate 83 is provided as the input to the data cache 10.

[0036] As indicated above, one of the general objects of the invention is to speed up vector processing without requiring substantial additional hardware. The hardware required by the invention, over and above the hardware required for scalar processing is illustrated in Figures 2 and 3. In Figure 2, the additional required hardware is illustrated above the dashed line A-A'. In Figure 3, the hardware required by the invention consists of the data paths 82, 84 and 85 as well as buffer 81 and gate 83. Those skilled in the art will understand that the CPU 14 may include still other (unillustrated) registers; these are not described as they are not required for vector processing.

Description of microprogrammed operation



[0037] The following portions of this specification will describe the operation of the apparatus illustrated in Figure 2 and 3 in connection with the three explicit microprogrammed instructions referred to above as well as the fourth implicit function.

[0038] At the beginning of any sequence of vector operations, the microprogrammed control unit (not illustrated) performs two functions: the first function is to change the state of the vector address selection control 41 (Figure 2), to indicate to the addressing circuitry that subsequent operations will employ the vector space 11 of the cache 10. The second function is to load the vector operand address registers 48-50 as well as the offset registers 46, 47. Typically, the quantities loaded in the first and second vector operand base address registers 50 and 49 will be different, so as to enable access to two different vector registers in the vector space 11. The contents loaded into the third vector operand base address register 48 may be identical to the contents of one of the other two vector operand address registers, or it may be different, depending upon the needs of the particular operation to be performed. Because of the interleaved reading and writing operation, to be explained below, the result vector register can be identical to one of the two vector registers containing the operands. As will be seen below, the write access, to write the results of a particular vector element, is subsequent to the read access and therefore one of the two vector registers containing the operands can be used to write the result.

[0039] The offset registers 46 and 47 will typically be loaded with an identical quantity, at the beginning of a vector operation; although as will be seen below, they are incremented at different times.

[0040] Referring to Figure 5, a timing diagram is illustrated for two of the explicit microprogrammed instructions of read vector operand, and read vector operand and store.

[0041] However, before discussing these explicit microprogrammed instructions, the implicit function will be described, since it is also illustrated.

[0042] We assume that at To, the operand base address registers 48-50 and the offset registers 46, 47 have been loaded, the vector mode selection control 41 has changed its state to indicate a vector operation, and some other operation is being performed which does not require access to the cache 10. Under these circumstances, and for every other memory cycle under these conditions when the cache 10 is not otherwise referred to, the operation reflected in Figure 5 in the first cycle (that is in the time period extending from the first sub-period So to the next sub-period identified as So), the cache 10 is addressed with the address contained in register 15. At this time, cache address 15 will address a vector register defined by the contents of VR1 (base address register 50) and OEO (offset register 47). Loading of cache address 15 is effected by operation of gates 42 and 43 and the concurrent indication of vector mode by vector mode control 41. That operand, identified as operand 1, is transferred from cache 10 beginning at the termination of the first S2 sub-period, and is present on the conductor 51. Accordingly, at the beginning of the next time So (in the period identified as the exemplary cycle) in Figure 5, operand 1 is available at the output of the byte shifter 52, i.e. on conductor 56. Typically, operand 1 is the first element of a first vector which will take part in some vector arithmetic.

[0043] At this point, we can now describe the functions performed by the explicit read vector operand micro-instruction. Timing for this function is also shown in Figure 5 (except that the operands identified by the asterisk do not occur in the read vector operand micro-instruction-more particularly the contents of VR3 and REO are not employed, nor is the timing in the last four lines of Figure 5 applicable).

[0044] Accordingly, at the beginning of the exemplary cycle (extending in sub-periods So-S3), the cache 10 is again addressed using the contents of VR2, OEO. Typically, this will address the first element of the second vector, the first element of the first -vector (operand 1) having previously been addressed prior to the initiation of the exemplary cycle. Just at the termination of this addressing operation, the offset register 47 (or OEO) is incremented, as indicated in the second line of Figure 5; the reason for this will become apparent hereinafter.

[0045] At the same time that the cache 10 is being addressed in the exemplary cycle, operand 1, which at this time exists on the output conductor 57, is read into the A register 55, via the path 85.

[0046] Beginning at about the S2 sub-period of the exemplary cycle, the addressed element of operand 2 is present on the output 51 of the cache 10. As shown in Figure 5, this is directly coupled to the output 57 of the byte shifter 52, and is loaded into the D register 56 just after the end of the exemplary cycle (specifically in the So sub-period following the exemplary cycle).

[0047] Because of operations required by the implicit function, if an element of operand 1 is required, the preceding micro-instruction cannot be a storage reference to the cache 10 or any function that requires the output of the byte shifter 52.

[0048] At the conclusion of the exemplary cycle, therefore, the CPU 14 contains elements of both vector operands, an element of operand 1 is in the A register 55 and an element of operand 2 is entering the D register 56. Furthermore, increment OEO enables addressing of the next element of the first and second vector registers.

[0049] The following description relates to the explicit function of read vector operand and store. Just as in the simple read vector operand instruction, on the cycle preceding the exemplary cycle, an element of the first vector register is read, such that at about time S, in the exemplary cycle, the A register 55 contains the first element of operand 1. Just as in the simple read vector operand instruction, the exemplary cycle is used to address and read an element of the second vector register so that at the conclusion of the exemplary cycle, the addressed element of operand 2 is located in the D register 56. Furthermore, just as in the read vector operand instruction, at the very end of the exemplary cycle, the OEO register is incremented. In the cycle immediately following the exemplary cycle, the next element of the first vector is addressed, by the implicit read step, and is transferred from the cache 10 via path 51 to the output 57 of byte shifter 52, so that before the end of the cycle following the exemplary cycle, the next element of operand 1 is available on the output path 57 of byte shifter 52.

[0050] At about the same time (particularly beginning at about S3 in the cycle following the exemplary cycle) the third base address register 48 is employed for reasons which will become clear hereinafter.

[0051] The first element of operand 2 is transferred, in the cycle following the exemplary cycle, from the D register 56 to the B register 54. As a result, and referring again to Figure 3, the two elements destined for the arithmetic operation are now located in the A register 55 and the B register 54. These quantities can now be transferred to the ALU, and the result is set into the D register 56, as shown in Figure 5. Furthermore, the result is relatively immediately transferred from the D register 56 to the B register 54 or to local storage 53.

[0052] For convenience in describing writing of results, we will assume that the result has reached the B register 54 beginning at about time S, in the exemplary cycle. While this is obviously not the case for an operation being performed in the exemplary cycle, it is true for an operation performed in the preceding cycle, and therefore in a typical vector operation which requires repeatedly running through a fixed sequence of steps, this description is completely general.

[0053] The result, now residing in the B register 54 is transferred through the gate 60 and bit shifter 61. The result passes through the gate 60 and bit shifter 61 relatively rapidly and is then stored in the shifter buffer 81 via path 82, so that a result available in the B register 54 at about S, in a cycle reaches the shifter buffer 81 at about time S3 in the same cycle. The use of the shifter buffer 81 can be gleaned from viewing Figure 3. The B register from which the result was available, is necessary for storage of an element of operand 2, and thus must be cleared. However, the byte shifter 52 is, at about this time, occupied in transferring the element of operand 2, and thus cannot be used to transfer a result. Furthermore, the cache 10 itself is occupied in reading out the next element of operand 1. Thus, the shifter buffer 81 is used to buffer the result until it can be written to the cache 10. Reading an element of vector 1 terminates at about time S3 in the cycle following the exemplary cycle of Figure 5. Accordingly, the result from the buffer 81 is transferred via the gate 83 to the cache 10, beginning at about time S3 in the cycle following the exemplary cycle. The actual cache write is shown to occur near the end (sub-period 85) of the cycle following the exemplary cycle. Following the transfer of the addressing information from register 46 and 48 to register 15, the update circuitry 45 increments the contents of REO register 46.

[0054] Accordingly, it should be apparent from Figure 5 that the read vector operand and store micro-instruction effects the following functions:

1. Loads a vector operand 1 element accessed in a preceding cycle into the A register 55;

2. Loads a vector operand 2 element accessed from the cache into a local storage location, e.g. the D register 56;

3. Loads the result from a preceding operation, from a local storage location (via the B register) into the shifter buffer 81. Furthermore, during subsequent periods of time, the same instruction:

4. Writes the contents of the shifter buffer 81 into the appropriate element of the cache result vector register; and

5. Increments both the operand element offset, and the result element offset; the operand element offset is incremented after it is used in conjunction with the VR2 register, the result element offset is incremented after it is used in connection with the VR3 register.



[0055] Although the particular steps of exemplary micro-instructions have been described, those skilled in the art will be aware that other different micro-instructions could use the present invention to similar advantage with slightly different results. For example, if intermediate results are required for subsequent operations, it may be inefficient to write those intermediate results to cache 10, and then re-read the cache 10 to withdraw those intermediate results. In such a case, the intermediate results, from the ALU, can be coupled via the D register 56 to local storage 53. When needed, the intermediate results can be withdrawn from local storage via path 58 and applied to the B register 54, where those intermediate results can be employed with other intermediate results, or data withdrawn from cache 10, to produce still other intermediate results or a final result, which itself may be written back to cache 10.

[0056] Other and still different modifications will occur to those skilled in the art from a review of Figures 3 and 5 and the preceding description.

[0057] Figure 6 is a timing diagram illustrating the operations performed during the third explicit micro-instruction, i.e. load vector register. In this instruction, a source operand located in local storage 53 or the D register, or the A register 55, respectively, is written to a specified location in cache 10. The location is determined by concatenating the contents of VR1 and OEO. In the example shown in Figure 6, the element written in cache is obtained from the B register 54. Since the B register 54 can be written from D register 56 or local storage 53, using the B register 54 as the source is not at all limiting. As shown in Figure 6, at the beginning of the cycle, the cache 10 is addressed with the contents of VR1 and OEO. Just after addressing cache 10, the contents of the B register 54 are coupled through the gate 60, through the bit shifter 61, through path 62, the byte shifter 52, the path 63 and the gate 83 to cache 10. In that cycle, at sub-period S3, the write strobe is generated to write the data. Substantially simultaneously therewith, the contents of OEO are incremented by the update circuitry 44. Since the preceding description has described, in detail, the various steps required for execution of the microprogrammed functions, those skilled in the art will be able to provide the necessary gating signals to effect the various steps, as described. Accordingly, no further description of those gating signals appears necessary.

[0058] Figures 7, and 9 illustrate how macro functions of vector binary add, store vector register and load vector register, respectively, can be implemented using the previously described micro-instructions.

[0059] More particularly, and referring to Figure 7, the vector binary add loop is illustrated. As shown in Figure 7, the vector binary add loop includes a read vector operand micro-instruction 100, an arithmetic instruction 101 and a read vector operand and store micro-instruction 102. The loop includes a single entry point, a normal exit, and provides an error exitfor an overflow condition. Function 100 is the read vector operand micro-instruction which is described above in connection with Figure 5. At the conclusion of the instruction, two vector elements are available to the CPU. The first vector element is obtained in an implicit operation preceding step 100, the second during step 100. Function 101 produces a sum. A branch point 103 provides an error exit in the case of overflow. Since function 101 does not require access to the cache 10, during its execution an implicit read step is performed to read the next element of the first vector operand, as was described above in connection with Figure 5. Assuming the absence of an overflow, function 102 is the read vector operand and store micro-instruction also described in connection with Figure 5. This provides for reading an additional element of the second vector, and storing the result computed at function 101. The loop provides for a branch on a loop counter, initially set to the number of elements in the vector. Assuming the loop counter has not reached the branching point, the processor loops back and performs function 101 on the vector operand elements extracted at function 102. The loop of functions 101 and 102 continues until each of the elements of the vectors has been processed. This concludes the function and thus it exits.

[0060] At the bottom of Figure 7 timing is illustrated. The read vector operand instruction 100 consumes one cycle and the arithmetic operation consumes 1) cycles. The function 102 is shown as one cycle since the store function is executed during the following arithmetic function 101.

[0061] Figures 8 and 9 relate respectively to the macro functions of store vector register (write the contents of a vector register from cache vector space 11 to main memory 16) and load vector register (write into a vector register in cache vector space 11 from main memory 16).

[0062] Figure 8 illustrates a store vector register loop macro-instruction for storing a plurality of elements of a vector in a vector register mapped into the cache 10. More particularly, the contents of a vector register in cache vector space 11 are transferred to cache scalar space 12. From this location, conventional procedure can write main memory 16. As shown in Figure 8, the loop includes two micro-instructions, the read vector operand 100 and a storage write 104. The loop has a single entrance point and a single exit point; typically it is entered after having set the loop counter indicating the number of elements in a vector. The timing is indicated at the bottom of Figure 8. Function 100 reads the contents of a cache vector register from the cache vector space 11 and function 104 writes the data just read to cache scalar space 12. Since function 100 is discussed above, no further description is necessary. Function 104 is a conventional scalar operation of writing to the scalar space of cache 10.

[0063] Figure 9 illustrates a load vector register loop macro-instruction. The loop has a single entry point and a single exit point. For each iteration, a vector operand element is read from cache scalar space 12 by function 105 and written into a local storage location, e.g. D register 56. Function 106 is used to load a vector register in cache vector space 11. The function 106 is described in connection with Fig. 6. Again, the timing is indicated at the bottom of Figure 9.

[0064] Figures 7-9 are merely exemplary applications of the specific macro-programmed functions capable of efficient execution with the inventive apparatus and method. Those skilled in the art will, after reviewing this description, be able to synthesize still other macro-instruction loops employing the method and apparatus of the invention.


Claims

1. A digital data processing apparatus comprising a cache memory (10) coupled between a main memory (16) and a central processing unit (14)' including an ALU and an address register (22) which is coupled to a cache address circuit (15), characterized by said cache memory being partitioned into scalar data and vector data areas (12, 11) which are alternatively operable;

vector mode selection means (41);

and vector operand address registers (46-50) which are alternatively operable with said address register (22), responsive to said vector mode selection means and said central processing unit, for accessing said vector or said scalar data areas by providing an address to said cache address circuit (15).


 
2. The apparatus of claim 1 wherein said vector operand address registers (46-50) include:

a plurality of base registers (48-50), and a pair of offset registers (46, 47); and

means (42, 43, 15) for combining by concatenation the contents of any of said plurality of base registers and any of said offset registers for accessing a vector element in said cache vector area (11) at an address location defined by said combined contents.


 
3. The apparatus of claim 2 wherein a first or a second (50, 49) of said base registers with a first (47) of said offset registers is used for a read access and a third (48) of said base registers with the second (46) of said offset registers is used for a write access.
 
4. The apparatus of claim 3 which includes: means (44) for incrementing said first offset register (47) after a read access is effected and means (45) for incrementing said second offset register (46) after a write access is effected.
 
5. The apparatus of a previous claim wherein said central processing unit (14) further includes:

a pair of operand registers (54, 55);

a result register (56);

first coupling means for providing a data path from said operand registers to the ALU and a further data path from the ALU to said result register (56);

second coupling means (51, 52, 57) for providing a data path from said cache memory (10) to one of said operand registers (55) and said result register (56); characterized by:

an output buffer register (81);

third coupling means (82) providing a data path from either of said operand registers to said output buffer register (81); and

fourth coupling means (83, 84) providing a data path from said output buffer register to said cache memory.


 
6. A method of performing vector processing on data residing in a cache memory (10), said cache memory coupled between a central processing unit (14), including an ALU, and a main memory (16), characterized by the steps of:

a. partitioning the cache memory (10) into scalar data and vector data areas (12, 11);

b. initializing plural vector operand address registers (46-50);

c. setting a vector mode selection device (41) for commanding vector operations when in a distinctive condition;

d. occasionally using at least two vector operand registers (54, 55) coupled between an output of said cache memory and the ALU for storing vector operand elements and results;


 
e. occasionally using a buffer register (81) between either of said vector operand registers and said cache memory; and
 
f. reading a vector element of a first vector operand from said cache memory selected by one (50) of said vector operand address registers into one of said at least two vector operand registers on each machine cycle that vector operation is commanded, in the absence of any other cache reference.
 
7. The method of claim 6 further including the steps of:

g. immediately thereafter storing said first vector operand element of step (e) in one (55) of said vector operand registers and substantially simultaneously reading an element of a second vector operand from said cache memory selected by another (49) of said vector operand address registers, and incrementing said vector operand address registers (49, 50);


 
h. immediately thereafter storing said element of said second vector operand in another (54) of said vector operand registers and substantially simultaneously accessing said cache memory to read a subsequent element of said first vector operand;

i. immediately thereafter transferring vector operand elements from said vector operand registers to said ALU and providing a result from said ALU to a vector operand register (56, 54), substantially simultaneously transferring said subsequent element of said first vector operand to a vector operand register (55), and reading a subsequent element of said second vector operand from said cache memory and incrementing sid vector operand address registers (49, 50) immediately thereafter;

j. immediately thereafter transferring said result into said buffer register (81) and substantially simultaneously transferring said subsequent element of said second vector operand to one (54) of said vector operand registers and reading a further subsequent element of said first vector operand from said cache memory;


 
k. immediately thereafter writing said result from said buffer register to said cache memory at a location specified by a third (48) of said vector operand registers, and immediately thereafter incrementing said third vector operand address register.
 
8. The method of claim 7 in which said plural vector operand address registers include three vector operand base address registers (48-50) and two vector element offset address registers (46, 47), and wherein said steps (f) and (h) each increment a first (47) of said vector element offset address registers and said step (j) increments a second (46) of said vector element offset address registers.
 
9. The method of claim 8 in which a base address from a selected one of said vector operand base address registers and an offset address from a selected one of said vector element offset address registers are additively combined by concatenation to constitute a full vector operand element address.
 
10. The method of any of claims 6-9, in which said vector mode selection device (41) provides a single additional address bitto said cache memory (10) which selects between a vector data area (11) and a scalar data area (12) of said cache memory.
 


Ansprüche

1. Digitale Datenverarbeitungsvorrichtung mit einem Cachespeicher (10), der zwischen einen Hauptspeicher (16) und eine Zentraleinheit (14) mit einem Rechen- und Leitwerk geschaltet ist, und einem Adressenregister (22), das mit einer Cacheadressenschaltung (15) verbunden ist, gekennzeichnet durch einen Cachespeicher, der in Skalardaten- und Vektordatenbereiche (12, 11) unterteilt ist, die abwechselnd arbeiten können,

eine Vektorbetriebswähleinrichtung (41),

und Vektoroperandenadressenregister (46-50), die abwechselnd mit dem Adressenregister (22) auf die Vektorbetriebswähleinrichtung und die Zentraleinheit ansprechend arbeiten können, um auf die Vektor- oder Skalardatenbereiche durch Liefern einer Adresse zur Cacheadressenschaltung (15) zuzugreifen.


 
2. Vorrichtung nach Anspruch 1, bei der die Vektoroperandenadressenregister (46-50)

eine Vielzahl Grundregistern (48-50) und zwei versetzte Register (46, 47), sowie

Einrichtungen (42, 43, 15) zum Kombinieren durch Verketten des Inhalts eines der Vielzahl von Grundregistern und eines der versetzten Register einschließen, um auf ein Vektorelement im Cachevektorbereich (11) an einem Adressenplatz zuzugreifen, der durch den kombinierten Inhalt bestimmt ist.


 
3. Vorrichtung nach Anspruch 2, bei der ein erstes oder ein zweites (50, 49) der Grundregister mit einem ersten (47) der versetzten Register für einen Lesezugriff und ein drittes (48) der Grundregister mit dem zweiten (46) der versetzten Register für einen Schreibzugriff benuzt werden.
 
4. Vorrichtung nach Anspruch 3, welche eine Einrichtung (44) zum Inkrementieren des ersten versetzten Registers (47), nachdem ein Lesezugriff bewirkt ist, und eine Einrichtung (45) zum Inkrementieren des zweiten versetzten Registers (46), nachdem ein Schreibzugriff bewirkt ist, aufweist.
 
5. Vorrichtung nach einem vorhergehenden Anspruch, bei der die Zentraleinheit (14) weiterhin

ein Paar von Operandenregistern (54, 55),

ein Ergebnisregister (56),

eine erste Kopplungseinrichtung, die einen Datenweg von den Operandenregistern zum Rechen- und Leitwerk und einen weiteren Datenweg vom Rechen- und Leitwerk zum Ergebnisregister (56) liefert, und

eine zweite Kopplungseinrichtung (51, 52, 57) enthält, die einen Datenweg vom Cachespeicher (10) zu einem der Operandenregister (55) und dem Ergebnisregister (56) liefert, gekennzeichnet durch

ein Ausgangspufferregister (81),

eine dritte Kopplungseinrichtung (82), die einen Datenweg von beiden Operandenregistern zum Ausgangspufferregister (81) liefert und

eine vierte Kopplungseinrichtung (83, 84), die einen Datenweg vom Ausgangspufferregister zum Cachespeicher liefert.


 
6. Verfahren zur Durchführung einer Vektorerarbeitung an Daten, die in einem Cachespeicher (10) gespeichert sind, wobei der Cachespeicher zwischen eine Zentraleinheit (14) mit einem Rechen- und Leitwerk und einen Hauptspeicher (16) geschaltet ist, gekennzeichnet durch die Schritte:

a) Unterteilen des Cachespeichers (10) in Skalardaten- und Vektordatenbereiche (12, 11),

b) Initialisieren einer Vielzahl von Vektoroperandenadressenregistern (46-50),

c) Einstellen einer Vektorbetriebswähleinrichtung (41) zum Befehlen von Vektoroperationen, wenn sie sich in einem bezeichnenden Zustand, befindet,

d) ggf. Benutzen wenigstens zweier Vektoroperandenregister (54, 55), die zwischen den Ausgang des Cachespeichers und das Rechen- und Leitwerk geschaltet sind, um Vektoroperandenelemente und Ergebnisse zu speichern,

e) ggf. Benutzen eines Pufferregisters (81) zwischen beiden Vektoroperandenregistern und dem Cachespeicher und

f) Lesen eines Vektorelementes eines ersten Vektoroperanden vom Cachespeicher, der durch eines (50) der Vektoroperandenadressenregister gewählt ist, in eines der wenigstens zwei Vektoroperandenregister bei jedem Maschinenzyklus, dem ein Vektorbetrieb befohlen ist, wenn ein anderer Cachebezug fehlt.


 
7. Verfahren nach Anspruch 6, welches weiterhin die Schritte einschließt:

g) unmittelbar danach Speichern des ersten Vektoroperandenelementes vom Schritt f) in einen (55) der Vektoroperandenregister und im wesentlichen gleichzeitig Lesen eines Elementes eines zweiten Vektoroperanden von dem Cachespeicher, der durch ein zweites (49) der Vektoroperandenadressenregister gewählt ist, und Inkrementieren der Vektoroperandenadressenregister (49, 50),

h) unmittelbar danach Speichern des Elementes des zweiten Vektoroperanden im anderen (54) der Vektoroperandenregister und im wesentiichen gleichzeitig Zugreifen zum Cachespeicher, um ein folgendes Element des ersten Vektoroperanden zu lesen,

i) unmittelbar danach Übertragen der Vektoroperandenelemente von den Vektoroperandenregistern zum Rechen- und Leitwerk und Liefern eines Ergebnisses vom Rechen- und Leitwerk zu einem Vektoroperandenregister (56, 54), im wesentlichen gleichzeitig Übertragen des folgenden Elementes des ersten Vektoroperanden zu einem Vektoroperandenregister (55) und unmittelbar danach Lesen eines folgenden Elementes des zweiten Vektoroperanden vom Cachespeicher und Inkrementieren der Vektoroperandenadressenregister (49, 50),

j) unmittelbar danach Übertragen des Ergebnisses in das Pufferregister (81) und im wesentlichen gleichzeitig Übertragen des folgenden Elementes des zweiten Vektoroperanden auf eines (54) der Vektoroperandenregister und Lesen des nächstfolgenden Elementes des ersten Vektoroperanden vom Cachespeicher,

k) unmittelbar danach Schreiben des Ergebnisses vom Pufferregister zum Cachespeicher an einem Platz, der durch ein drittes (48) der Vektoroperandenregister spezifiziert ist und unmittelbar danach Inkrementieren des dritten Vektoroperandenadressenregisters.


 
8. Verfahren nach Anspruch 7, bei dem die Vielzahl von Vektoroperandenadressenregistern drei Vektoroperandengrundadressenregister (48-50) und zwei vektorelementversetzte Adressenregister (46, 47) einschließt, und bei dem die Schritte g) und i) jeweils ein erstes (47) der vektorelementversetzten Adressenregister inkrementieren und der Schritt k) ein zweites (46) der vektorelementversetzten Adressenregister inkrementiert.
 
9. Verfahren nach Anspruch 8, bei dem eine Grundadresse von einem gewählten der Vektoroperandengrundadressenregister und eine versetzte Adresse von einem gewählten der vektorelementversetzten Adressenregister additiv durch Verkettung kombiniert werden, um eine Vollvektoroperandenelementenadresse zu bilden.
 
10. Verfahren nach einem der Ansprüche 6 bis 9, bei dem die Vektorbetriebswähleinrichtung (41) ein einzelnes zusätzliches Adressenbit zum Cachespeicher (10) liefert, das zwischen einem Vektordatenbereich (11) und einem Skalardatenbereich (12) des Cachespeichers wählt.
 


Revendications

1. Appareil de traitement de données numériques comportant une antémémoire (10) branchée entre une mémoire principale (16) et une unité centrale de traitement (14), comprenant une ALU et un registre d'adresses (22) qui est raccordé à un circuit (15) d'adresses de l'antémémoire, caractérisé en ce que ladite antémémoire est subdivisée en zones (12, 11) qui contiennent des données scalaires et des données vectorielles et qui peuvent être activées en alternance;

des moyens (41) de sélection du mode vectoriel

et des registres (46-50) d'adresses d'opérandes vectoriels, qui peuvent fonctionner en alternance avec ledit register d'adresses (22), en réponse auxdits moyens de sélection du mode vectoriel et à ladite unité centrale de traitement, pour avoir accès à ladite zone contenant les données vectorielles ou à ladite zone contenant les données scalaires, en envoyant une adresse audit circuit (15) d'adresse de l'antémémoire.


 
2. Appareil selon la revendication 1, dans lequel lesdits registres (46-50) d'adresses d'opérandes vectoriels comprennent:

plusieurs registres de base (48-50), et un couple de registres de décalage (46, 47); et

des moyens (42,43,15) servant à combiner par chaînage les contenus de n'importe quel registre faisant partie desdits plusieurs registres de base et de n'importe quel registre faisant partie desdits registres de décalages pour avoir accès à un élément d'un vecteur dans la zone (11) de l'antémémoire contenant les données vectorielles, en un emplacement d'adresse défini par lesdits contenus combinés.


 
3. Appareil selon la revendication 2, dans lequel un premier ou un second (50, 49) desdits registres de base est utilisé, en association avec un premier (47) desdits registres de décalage, pour avoir un accès de lecture et un troisième (48) desdits registres de base est utilisé, en association avec le second (46) desdits registres de décalages, pour un accès d'écriture.
 
4. Appareil selon la revendication 3, qui contient:

des moyens (44) pour incrémenter ledit premier registre de décalages (47) après l'exécution d'un accès de lecture, et des moyens (45) pour incrémenter ledit second registre de décalages (46) après l'exécution d'un accès d'écriture.


 
5. Appareil selon une revendication précédente, dans lequel ladite unité centrale de traitement (14) comporte en outre:

un couple de registres d'opérandes (54, 55);

un registre de résultats (56);

des premiers moyens de couplage servant à établir une voie de transmission de données s'étendant depuis lesdits registres d'opérandes jusqu'à l'ALU et une autre voie de transmission de données s'étendant depuis l'ALU jusqu'audit registre de résultats (56);

des seconds moyens de couplage (51, 52, 57) servant à établir une voie de transmission de données s'étendant depuis ladite antémémoire (10) jusqu'à l'un desdits registres d'opérandes (55) et jusqu'audit registre de résultats (56); caractérisé par:

un registre tampon de sortie (81);

des troisièmes moyens de couplage (82) établissant une voie de transmission de données s'étendant depuis l'un ou l'autre desdits registres d'opérandes jusqu'audit registre tampon de sortie (81); et

des quatrièmes moyens de couplage (83, 84) établissant une voie de transmission de données s'étendant depuis ledit registre tampon de sortie jusquà ladite antémémoire.


 
6. Procédé pour exécuter un traitement vectoriel sur des données situées dans une antémémoire (10), ladite antémémoire étant branchée entre une unité centrale de traitement (14), contenant une ALU, et une mémoire principale (16), caractérisé par les étapes consistant à:

a. subdiviser l'antémémoire (10) en zones (12, 11) contenant des données scalaires et contenant des données vectorielles;

b. initialiser plusieurs registres (46-50) d'adresses d'opérandes vectoriels;

c. positionner un dispositif (41) de sélection du mode vectoriel pour commander les opérations vectorielles dans un état distinctif;

d. utiliser occasionnellement au moins deux registres (54, 55) d'opérandes vectoriels, branchés entre une sortie de ladite antémémoire et l'ALU pour la mémorisation d'éléments d'opérandes vectoriels et de résultats;

e. utiliser occasionnellement un registre tampon (81) situe entre l'un quelconque desdits registres d'opérandes vectoriels et ladite antémémoire; et

f. lire, dans ladite antémémoire, un élément d'un vecteur d'un premier opérande vectoriel sélectionné par l'un (50) desdits registres d'adresses d'opérandes vectoriels, pour l'introduire dans l'un des au moins deux registres d'opérandes vectoriels au cours de chaque cycle machine pendant lequel l'opération vectorielle est commandée, en l'absence de toute autre référence à l'antémémoire.


 
7. Procédé selon la revendication 6, comprenant en outre les étapes consistant à:

g. mémoriser, aussitôt après, ledit élément du premier opérande vectoriel de l'étape (f) dans l'un (55) desdits registres d'opérandes vectoriels et lire à peu près simultanément, dans ladite antémémoire, un élément d'un second opérande vectoriel sélectionné par un autre (49) desdits registres d'adresses d'opérandes vectoriels, et incrémenter lesdits registres d'adresses d'opérandes vectoriels (49, 50);

h. mémoriser, aussitôt après, ledit élément dudit second opérande vectoriel dans un autre (54) desdits registres d'opérandes vectoriels et réaliser à peu près simultanément l'accès à ladite antémémoire pour lire un élément suivant dudit premier opérande vectoriel;

i. transférer, aussitôt après, les éléments d'opérandes vectoriels depuis lesdits registres d'opérandes vectoriels dans ladite ALU et délivrer un résultat depuis ladite ALU à un registre d'opérandes vectoriels (56, 54), transférer à peu près simultanément ledit élément suivant dudit premier opérande vectoriel dans un registre d'opérandes vectoriels (55), et lire un élément suivant dudit second opérande vectoriel à partir de ladite antémémoire et incrémenter, aussitôt après, lesdits registres d'adresses d'opérandes vectoriels (49, 50);

j. transférer, aussitôt après, ledit résultat dans ledit registre tampon (81) et transférer à peu près simultanément ledit élément suivant dudit second opérande vectoriel dans l'un (54) desdits registres d'opérandes vectoriels et lire un autre élément suivant dudit premier opérande vectoriel à partir de ladite antémémoire;

k. écrire, aussitôt après, ledit résultat délivré par ledit registre tampon dans ladite antémémoire en un emplacement spécifié par un troisième (48) desdits registres d'opérandes vectoriels, et incrémenter aussitôt après ledit troisième registre d'adresses d'opérandes vectoriels.


 
8. Procédé selon la revendication 7, selon lequel lesdits plusieurs registres d'adresses d'opérandes vectoriels comprennent trois registres (48-50) d'adresses de base d'opérandes vectoriels et deux registres (46, 47) d'adresses de décalages d'éléments de vecteurs, et selon lequel lors de chacune desdites étapes (g) et (i), il se produit une incrémentation d'un premier registre (47) faisant partie desdits registres d'adresses de décalage d'éléments de vecteurs et, lors de ladite étape (k), il se produit l'incrémentation d'un second registre (46) faisant partie desdits registres d'adresses de décalage d'éléments de vecteurs.
 
9. Procédé selon la revendication 8, selon lequel une adresse de base délivrée par l'un sélectionné desdits registres d'adresses de base d'opérandes vectoriels et une adresse de décalage délivrée par l'un sélectionné desdits registres d'adresses de décalage d'éléments de vecteurs sont combinés de façon additif par chaînage pour constituer une adresse complète d'un élément d'opérande vectoriel.
 
10. Procédé selon l'une quelconque des revendications 6 à 9, selon lequel ledit dispositif (41) de sélection du mode vectoriel envoie à ladite mémoire (10), un seul bit additionnel d'adresse, qui établit une sélection entre une zone (11) contenant des données vectorielles et une zone (12) contenant des données scalaires, de ladite antémémoire.
 




Drawing