A floating point arithmetic unit for performing independent multiply and add operations in the execution of a multiply-add instruction on three operands A, B, and C, wherein A being the multiplicand, C being the multiplier and B being the addend, and each operand comprising data of a prescribed number p of bits in accordance with a given floating-point precision including one (1) sign bit indicating if a data represents a positive (+) or a negative (-) value, x exponent bits, and y mantissa bits, said arithmetic unit comprising:
- (a) a multiplier unit including an input stage for receiving operands A and C and having an external datapath width of d bits, wherein p<d.ltoreq.2p, and further wherein the input stage includes a respective buffer of b bits of zeros (0's) concatenated to the right of a respective least significant bit of each of operands A and C, wherein b is equal to d-p bits, said multiplier unit further including an output stage for conveying a product A*C including d uppper order bits AC.sub.UPPER and d lower order bits AC.sub.LOWER ;
- (b) a sticky collect unit for receiving AC.sub.LOWER and generating a sticky bit representative of a logical OR of all of the bits of AC.sub.LOWER, wherein the sticky bit equals one (1) upon any of the bits of AC.sub.LOWER being one (1);
- (c) an adder unit having an input stage for receiving AC.sub.UPPER and operand B and having an external datapath width of d bits, and further wherein the input stage includes a buffer of b bits of zeros (0's) concatenated to the right of a least significant bit of operand B, wherein b is equal to d minus p bits, said adder unit further including an output stage for providing a resultant quantity +/- AC.sub.UPPER +/- B, wherein said multiplier unit, said sticky collect unit, and said adder unit implement an integrated multiply-add sequence;
- (d) means for rounding the resultant quantity +/- AC.sub.UPPER +/- B to a precision of p bits in response to the sticky bit and further in accordance to a desired rounding mode, said rounding means further providing a multiply-add output of said arithmetic unit;
- (e) means for detecting an occurrence of either a first risk condition or a second risk condition in connection with the resultant quantity prior to a rounding of the resultant quantity by said rounding means, the first risk condition indicative of an undesirable cancellation on the resultant quantity +/- AC.sub.UPPER +/- B and the second risk condition indicative of a specific loss of precision in the resultant quantity +/- AC.sub.UPPER +/- B, said risk condition detection means further for triggering a trap upon a detection of a risk condition, the trap for discarding the resultant quantity +/- AC.sub.UPPER +/- B and further for initiating an extended multiply-add sequence;
- and
- (f) means for implementing the extended multiply-add sequence upon the three operands A, B, and C in response to the trap and providing a mouthily-add output of said arithmetic unit, wherein the extended multiply-add sequence is selected for achieving mathematical compatibility with the integrated multiply-add sequence, wherein said extended multiply-add sequence implementation means includes
- a multiplier means having a narrowed datapath width of p bits for receiving operands A and C and performing a first and a second multiply for providing an intermediate product A*C including a partial product of p upper order bits AC.sub.(2p-1:p) and a partial product of p lower order bits AC.sub.(p-1:0) ;
- an adder means for executing three passes through an adder unit in accordance with the following operation:
- ##EQU3## and providing an intermediate resultant quantity AC+B of infinite precision;
- and
- a means for rounding the intermediate resultant quantity AC+B to a precision of p bits and providing an output corresponding to the multiply-add output of said arithmetic unit.