correction on three-operand addition

Bob Alverson validgh!uunet!colossus.tera.com!bobaSun.COM
Mon Jan 21 09:30:00 PST 1991


For a three operand add with only one round, it seems the following
would be a sufficient basis:

	t = u + v + w
	t = u + v - w
	t = u - v - w

You might also have "z = - u - v - w", although with round to nearest
it is the same as adding and negating.

** Tera plug on **

At Tera, we seriously considered implementing a three-operand add, but
decided it was too complicated, compared to a "fused-multiply-add"
(which we are implementing).  Instead, we have a primitive called
"add-lower":

	add-lower(x, y) = x + y - round-nearest(x + y)

In the absence of exceptions, this provides the exact remainder from
the add of two values.  It can be profitably used for implementing
"doubled" precision FP.  Add-lower can be computed with similar hardware
to what the fused-mul-add requires.  Note that compare&swap is not
needed for DP add when you have add-lower.

Also note that add-lower is much harder to compute when the round mode
is not round to nearest.  (You may need to round x+y *and* the add-lower
result)  Thus, we only support add-lower for round to nearest math.

** Tera plug off **

Bob



More information about the Numeric-interest mailing list