Alu Transcendental Floating Point - AMD ATI CTM Technical Reference Manual

Table of Contents

Advertisement

42 Note on Floating Point
OPERATION
x + NaN
Inf + -Inf
Inf + Inf
Inf + -1.0
0.0 + -0.0
-0.0 + -0.0
Dot products may lose precision in cases where the values to be added differ greatly in magnitude. For example, if
the two largest values to be added cancel exactly, and the next-largest value has a magnitude smaller by a factor of
2^25 or more, X1K FP will emit +0.0 rather than the sum of the two remaining components. IEEE is silent on the
behaviour of such fused operations, and it seems unlikely that this condition will manifest very often.
MIN and MAX operations return the second argument if either input is NaN (this is consistent with IEEE and SM3
specifications); infinite values compare as usual. If both inputs are +-0.0, MIN and MAX will return the second input
(consistent with IEEE and the SM3 spec)—as a result, MIN(+0, -0) == -0, and MIN(-0, +0) == +0.
CND and CMP operations return the second argument if either input is NaN; infinite values compare as usual. As
with the predicate compare operators, +0.0 and -0.0 are both "equal" to 0.
MIN, MAX, CND, and CMP are guaranteed to return one of their first two arguments. If you use
OMOD_DISABLED as well, then you will get a bit-exact representation of one of the first two arguments.
ALU operations usually enable the output modifier, which in turn standardizes NaN values and flushes denormal
results to zero. A MOV instruction which preserves the source bits may be implemented by setting
OMOD_DISABLED for the instruction and using the MAX(src, src) instruction. The output modifier cannot be
disabled for a saturated MOV (MOV with clamping enabled).
3.6.3

ALU Transcendental Floating Point

In X1K FP, transcendental operations are EX2, LN2, RCP, RSQ, SIN, and COS (mathematically speaking, one of
these functions does not belong). Transcendentals do not maintain extra internal precision; as a result, if the result of
the transcendental operation exceeds the IEEE finite range, the ALU will generate infinity even if the output modifier
would bring the result back into range. Similarly if the result is denormal, the ALU will generate a pure zero
(preserving sign) even if the output modifier would bring the result back into the normal range.
Special values are computed as shown in the following table:
INPUT
+0.0
-0.0
+Inf
-Inf
NaN
* For RSQ, recall that the square root occurs first. IEEE specifies sqrt(-0.0) -> -0.0; the X1K FP deviates
Note:
from this.
ATI CTM Guide v. 1.01
RESULT
NaN
NaN
Inf
Inf
0.0
-0.0
EX2
LN2
RCP
+1.0
-Inf
+Inf
+1.0
-Inf
-Inf
+Inf
+Inf
+0.0
+0.0
NaN
-0.0
NaN
NaN
NaN
NOTES
x is any value.
RSQ
SIN
+Inf
+0.0
+Inf *
-0.0
+0.0
NaN
NaN
NaN
NaN
NaN
COS
+1.0
+1.0
NaN
NaN
NaN
© 2006 Advanced Micro Devices, Inc.

Advertisement

Table of Contents
loading

Table of Contents