Alu Non-Transcendental Floating Point - AMD ATI CTM Technical Reference Manual

Table of Contents

Advertisement

Also pervasive, the internal rounding mode is not configurable and is not exact to the IEEE standard. It could best be
said that rounding is random; operations in and near X1K FP round with differing standards. Most ALU operations
are accurate to within one bit on each input; transcendental functions have larger tolerances.
The lack of separable multiply and add instructions has consequences on rounding and sign preservation; when using
MAD to perform only a multiply or addition, keep in mind that the other operation may influence the result despite
apparent identities. For example, the obvious instructions to use for moving a value from one register to another both
utilize MAD, either with the additive identity "0 * 0 + r1", or a combination of additive and multiplicative identities,
"r0 * 1 + 0". Neither these instructions will correctly copy -0.0, because the adder cannot generate -0.0 except with
two negative inputs. In this case, a more accurate move instruction would be "-0 * 0 + r1". (the ideal MOV instruction
is described below).
X1K FP only supports comparisons against zero (predication, ALU result, and CMP) and +0.5 (CND), and this has
consequences for implementing a general compare function with special values. It is tempting to implement a general
comparison between values A and B by subtracting the results, but this will not have the desired effect for special
values. In IEEE, an infinite value is equivalent to itself, but NaN is never equivalent to NaN. Yet (infinity - infinity)
= (NaN - NaN) = NaN, and the results are indistinguishable. The limited operator set further complicates issues, since
(A > B) is not equivalent to !(A <= B) when either input is NaN.
The behaviour for CMP and CND is described below. When using the predicate comparison operators, the following
hold for special values:
VALUE
+0.0
-0.0
+Inf
-Inf
NaN
Denormals compare as equivalent to zero. Note that the only way a denormal may be involved in a comparison for
predicate/alu result is if the output modifier is disabled with OMOD_DISABLED.
3.6.2

ALU Non-Transcendental Floating Point

Non-transcendental ALU operations maintain extra precision to represent computations where an intermediate result
exceeds IEEE's finite range. For example, if a MAD generates a result outside the finite range, but the output modifier
brings the value back into range, the ALU will generate a finite value, not infinity.
The ALU accepts denormal values, but denormals are flushed to zero, preserving sign. It is possible for a
multiplicative output modifier to bring a denormal intermediate result into the normal range; in this case, the ALU
will generate a normal nonzero value.
The ALU MAD operation, which many ALU operations are based on, follows standard IEEE rules when handling
special input values, for example:
OPERATION
x * NaN
0.0 * Inf
Inf * Inf
Inf * -Inf
0.0 * -0.0
© 2006 Advanced Micro Devices, Inc.
X<0
X>=0
0
1
0
1
0
1
1
0
0
0
RESULT
NaN
NaN
Inf
-Inf
-0.0
X==0
X!=0
1
0
1
0
0
1
0
1
0
1
NOTES
x is any value.
ALU Non-Transcendental Floating Point 41
ATI CTM Guide v. 1.01

Advertisement

Table of Contents
loading

Table of Contents