Apparatus for performing floating point arithmetic operations

Abstract: A processor for performing floating point arithmetic operations includes a circuit that performs a first floating point arithmetic operation on a set of operands in a first cycle and a second floating point arithmetic operation on an operand and a result of the first floating point arithmetic operation during a second cycle. A control circuit is provided for, in a third cycle, transferring a result of the second floating operation to the first floating point circuit for a first floating point operation in a next successive cycle while rounding the result of the second floating point operation.

Description: This invention relates generally to data processing systems and more specifically to data processing systems providing floating point arithmetic operations. Traditionally floating point operations are performed in a sequential manner in data processing systems. In some data processing systems, a floating point operation is actually executed within the central processing unit in accordance with an algorithm provided by software. In other systems a dedicated floating point processor is provided. Both techniques require for the answer of a first operation to have been completed before a second operation is started. In modern pipeline processing, this requirement of waiting for the completion of a first operation before a second operation can commence may generate unnecessary delays. Electro/87 and Mini/Micro Northeast 12 (1987) Conference Record, 11/2 pages 1 to 7, discloses a 4 stage pipeline system in figure 8. The first stage generates a micro-control word, the second stage writes data to a data path element, the third stage performs an arithmetic operation, while the fourth stage writes the result of the arithmetic operation to memory. It is an object of the present invention to provide a floating point processing unit that performs floating point arithmetic operations in a pipeline fashion, while determining data dependencies and performing data dependent floating point operations in a more efficient manner. The present invention provides an apparatus for performing floating point arithmetic operations, said apparatus comprising: storing means for storing operands; first means for performing a first floating point arithmetic operation on a set of operands supplied from said storing means in a first cycle; second means for performing a second floating point arithmetic operation on an operand and a result of said first floating point arithmetic operation in a second cycle; and characterized by means for rounding the result of said second floating point operation; control means for determining when the next floating point arithmetic operation to be performed in said first and second means includes an operand that is a result of said second floating point arithmetic operation and, in response to said determining, for providing without storing in said storing means the result of said second floating point arithmetic operation to said first means in a third cycle concurrently with rounding the result of said second floating point arithmetic operation. In one such arrangement disclosed herein, a floating point arithmetic unit is provided that performs both a multiply and addition operation. The control circuitry for the floating point arithmetic unit is able to detect when a second set of operands includes a result computed from a first set of operands in a sequence of floating point operations. When this second set of operands includes this result a data dependency is declared. The control circuit addresses the data dependency by providing the result of the first arithmetic operation before the rounding is actually complete. This rounding operation is used to provide a direct input to a floating point multiplier in the preferred embodiment. Also, the control circuit ensures that the answer from the first floating point operation is provided directly to the floating point circuitry in order to more quickly perform the second floating point operation. The present invention will be described further by way of example with reference to an embodiment thereof as illustrated in the accompanying drawings, in which Figure 1 is a block diagram of a floating point arithmetic unit; Figure 2 is a block diagram of the multiplier circuit thereof; Figure 3 is a flow chart illustrating the operation of the control circuitry when operating without a data dependency; Figure 4 is a flow chart illustrating the operation of the control circuitry when a data dependency that exists on one of the multiply operands occurs; Figure 5 is a flow chart illustrating the operation of the control circuitry when a data dependency on the add operand exists; Figure 6 is a timing diagram illustrating the pipeline operation of the floating point arithmetic unit when no data dependency exists; Figure 7 is a timing diagram illustrating the pipeline operation of the floating point arithmetic unit when a data dependency of 0 multiplication operand exists; and Figure 8 is a timing diagram illustrating the pipeline operation of the floating point arithmetic unit when a data dependency of the addition operand exists. The floating point processor illustrated in Fig. 1 includes a register file 10 which stores 40 words. The register file 10 provides an output to an A operand latch 12, a B operand latch 14, and a C operand latch 16. The A operand latch and B operand latch are used to contain operands that are used in the multiplication portion of the floating point arithmetic operations. The C operand latch 16 is used to contain the addition operand. The output of the A operand latch 12 is provided directly to multiplier 22. The output of the B operand latch 14 is provided through a multiplexer 18 to the multiplier 22. The output of the C operand latch 16 is provided to a multiplexer 20 and then to an align shifter 24. The purpose of the align shifter is to align the addition operand with the result of the multiplication performed in the multiplier circuit 22. The multiplier 22 provides an output to a first partial product latch 26 and a second partial product latch 28. The output of these latches 26 and 28 are provided to a three to two carry save adder 32. The align shifter 24 provides an output to the addend latch 30, which also provides an output to the three to two carry save adder 32. The carry save adder 32 provides two outputs to the full adder 34. The output of the full adder 34 is normalised in the normalising circuit 36. Result latch 38 stores the result of the normalisation operation. The data in the result latch is then rounded in the rounding circuitry 40 and in normal operation, provided back to the register file 10. The control circuitry 42 includes a control line 8 which is, in fact, a set of control lines that control the different elements of the floating point processor shown in Figure 1. One of the functions of the control circuitry 42 is to perform the addition of the exponents for the multiplication operation in the multiplier 22. This information is used by the align shifter 24 to properly align the addition operand. Also, a function of the control circuitry 42 is to determine when a data dependency exists. A data dependency is defined when the floating point operation to be performed includes an operand that is a result of a previous floating point operation. Under normal operation, the result of the previous floating point operation would be stored in the register file. Since the control circuitry 42 can detect data dependencies, the capability is provided to take the result from the rounding circuit 40 and provide it directly to one of two multiplexers 18 or 20. In this manner the unrounded result operation from latch 38 that is an operand for the multiplication or the rounded result that is an operand for the addition operation in a subsequent floating point operation, can be provided directly to the arithmetic circuitry without having to pass through the register file 10 and one of the latches 14 or 16. Additionally, the control circuitry 42 provides the capability for the rounding circuit 40 to provide an input 41 to a multiplier to indicate whether or not a round operation is needed. Figure 2 is an illustration of a carry save adder tree that is included in the multiplier circuit 22 of Figure 1. Note that line 41 provides an input to the carry save adder CSA#11. This input is used to indicate if the previously computed result was rounded upward. If so, the one is added in a manner disclosed. Because of the propagation delay through the tree, the rounding can be added in a timely manner. Figure 3 is a flow chart illustrating the operation of the control circuitry 42 when no data dependency has occurred. In step 100, the floating point instruction is decoded. In step 102, the operands are read from the register file 10. Step 100 and step 102 make up what is termed the decode cycle. Then in step 104 the multiplication occurs together with the add alignment in step 106. In practice the multiplication and add alignment steps 104 and 106 respectively overlap. These two steps 104 and 106 are termed the multiply cycle. In step 108, the add operation is performed. Then, in step 110, the normalisation operation is performed. Steps 108 and 110 are referred to as the add cycle. In step 112, the result of the normalisation cycle is rounded. Then in step 114 the rounded result is written into the floating point register file 10. The control flow for a arithmetic operation where a data dependency cn a multiply operand exists, is shown in Figure 4. During the decode cycle, in step 120, the instruction is initially decoded. In step 122, the operands for the instruction are checked to determine if in fact there is a data dependency. In this example, the operand B is a dependent operand (i.e., this B operand is actually the unrounded result of a previous floating point operation). In step 124, the A and C operands are loaded from the floating point register file 10. In step 126, the multiplexer 18 loads the B operand into the multiplier 22 and the multiply operation is performed in step 128. In step 128, the rounding adjustment from the round circuit 40 is provided on line 41 as previously discussed. Also simultaneously with the operation of the multiplier 22, the align shifter shifts the addition operand in step 130. In step 132 the add is performed and in step 134 the normalisation is performed. As before, the rounding is performed in step 136 and finally the result is written to the floating point register file 10 in step 138. Figure 5 illustrates the control flow for a floating point operation where a data dependency exists on an add operand. In step 140, the instruction is decoded and in step 142 the operands are checked. In this example, the C operand is actually a previous floating point operation result. Therefore, in step 144, the A and B operands are loaded from the floating point register file 10. In step 146, the multiplexer 20 takes the C operand from the round circuit 40. The multiplication is performed in step 148 and the addition alignment shifting is performed in step 150. Since the add alignment is relatively quick, it is performed after completion of the round operation. In step 152, the add operation is performed and, in step 154, the normalisation of the result of the add is performed. This normalised result is rounded in step 156 and written to the floating point register file 10 in step 158. Figure 6 is a simple timing diagram illustrating the pipeline flow of the floating point processor for a single instruction. It should be understood that since this is a pipeline operation, the second instruction will start its decode cycle at cycle 2. Likewise a third instruction would start its decode cycle in cycle 3 as shown in Figure 6. Figure 7 is a timing diagram illustrating the pipeline flow for the condition where a multiplication operand dependency exists. Note that during cycle 2 the decode operation actually exists for cycles 2 and 3. Then in cycle 4 the multiplexing of the data dependent operand is performed. The multiply cycle coincides with the early operation in cycle 4 that includes the rounding of the result. Figure 8 is a timing diagram illustrating the pipeline flow for a floating point operation wherein the add operand is dependent upon a previous operation. Again, in cycle 2 the decode operation for the second instruction takes two cycles (cycles 2 and 3). The multiply cycle in the second instruction overlaps with the write cycle in the first instruction (cycle 4) so that the result of the round operation can be multiplexed into the C operand for the add alignment operation. Other aspect of floating point arithmetic are disclosed in co-pending applications EP 0 377 991 A3, EP 0 377 990 A3 and EP 0 377 992 A2.

Claims: Apparatus for performing floating point arithmetic operations, said apparatus comprising: storing means (10, 12, 14, 16) for storing operands; first means (22) for performing a first floating point arithmetic operation on a set of operands supplied from said storing means (10, 12, 14, 16) in a first cycle; second means (34) for performing a second floating point arithmetic operation on an operand and a result of said first floating point arithmetic operation in a second cycle; and characterized by means (40) for rounding the result of said second floating point operation; control means (42) for determining when the next floating point arithmetic operation to be performed in said first and second means (22, 34) includes an operand that is a result of said second floating point arithmetic operation and, in response to said determining, for providing without storing in said storing means (10, 12, 14, 16), the result of said second floating point arithmetic operation to said first means (22) in a third cycle concurrently with rounding the result of said second floating point arithmetic operation. Apparatus as claimed in Claim 1, further including storage means for storing a plurality of floating point operands, means connecting the first means and second means and the storage means under the control of the control means (42), the control means (42) determining when a third set of operands includes the result from a floating point arithmetic operation on first and second sets of operands and for providing the result of the floating point arithmetic operation of the first and second sets of operands to the first means while the result of the floating point arithmetic operation on the first and second sets of operands is being rounded in the means (40) for rounding. Apparatus as claimed in either preceding claim, wherein the first floating point arithmetic operation is a multiply operation. Apparatus as claimed in claim 1 or claim 2, wherein the first floating point arithmetic operation is an add operation. Apparatus as claimed in any preceding claim, further comprising a tree of combination logic (22) and the control means (42) provides a round signal (41) to the tree of combinational logic (22) if a round operation has occurred. Apparatus as claimed in Claim 5, further comprising means for performing two unique floating point operations and the control means (42) includes means for providing the first result to either of the two unique floating point operations upon determining that a second set of operands includes a result of the floating point operations on the first set of operands.

Inventors: COCANOUGHER DANIEL, MONTOYE ROBERT KEVIN, NGUYENPHU MYHONG, RUNYON STEPHEN LARRY, COCANOUGHER, DANIEL, MONTOYE, ROBERT KEVIN, NGUYENPHU, MYHONG, RUNYON, STEPHEN LARRY
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1989
Main classification: G06F7
IPC codes: G06F7