
4-16
ColdFire CF4e Core User’s Manual
For More Information On This Product,
Go to: www.freescale.com
FPU Programmer’s Model
4.3.5.1 Underflow, Round, Overflow
During calculation of an arithmetic result, the FPU has more precision and range than the
64-bit double-precision format. However, the final result is a double-precision value. In
some cases, an intermediate result becomes either smaller or larger than can be
represented in double-precision. Also, the operation can generate a larger exponent or
more bits of precision than can be represented in the chosen rounding precision. For these
reasons, every arithmetic instruction ends by checking for underflow, rounding the result
and checking for overflow.
At the completion of an arithmetic operation, the intermediate result is checked to see if it
is too small to be represented as a normalized number in the selected precision. If so, the
underflow (UNFL) bit is set in FPSR[EXC]. If no underflow occurs, the intermediate
result is rounded according to the user-selected rounding precision and mode. After
rounding, the inexact bit (INEX) is set as described in Figure 4-12. Lastly, the magnitude
of the result is checked to see if it exceeds the current rounding precision. If so, the
overflow (OVFL) bit is set and a correctly signed infinity or correctly signed largest
normalized number is returned, depending on the rounding mode.
NOTE:
INEX can also be set by OVFL, UNFL, and when
denormalized numbers are encountered.
4.3.5.2 Conditional Testing
Unlike operation-dependent integer condition codes, an instruction either always sets
FPCC bits in the same way or does not change them at all. Therefore, instruction
descriptions do not include FPCC settings. This section describes how FPCC bits are set.
FPCC bits differ slightly from integer condition codes. An FPU operation’s final result sets
or clears FPCC bits accordingly, independent of the operation itself. Integer condition
codes bits N and Z have this characteristic, but V and C are set differently for different
instructions. Table 4-8 lists FPCC settings for each data type. Loading FPCC with another
combination and executing a conditional instruction can produce an unexpected branch
condition.
Table 4-8. FPCC Encodings
Data Type
N
Z
I
NAN
+ Normalized or Denormalized
0
0
0
0
– Normalized or Denormalized
1
0
0
0
+ 0
0
1
0
0
– 0
1
1
0
0
+ Infinity
0
0
1
0
– Infinity
1
0
1
0
F
Freescale Semiconductor, Inc.
n
.