4 operand error (operr), 5 overflow (ovfl), Operand error (operr) -21 – Freescale Semiconductor MCF5480 User Manual

Page 211: Overflow (ovfl) -21

Advertising
background image

Floating-Point Exceptions

MCF548x Reference Manual, Rev. 3

Freescale Semiconductor

6-21

6.6.1.4

Operand Error (OPERR)

The operand error exception encompasses problems arising in a variety of operations, including errors too

infrequent or trivial to merit a specific exception condition. Basically, an operand error occurs when an

operation has no mathematical interpretation for the given operands.

Table 6-15

lists possible operand

errors. When one occurs, FPSR[OPERR] is set.

Table 6-16

describes results when the exception is enabled and disabled.

6.6.1.5

Overflow (OVFL)

An overflow exception is detected for arithmetic operations in which the destination is a floating-point

data register or memory when the intermediate result’s exponent is greater than or equal to the maximum

exponent value of the selected rounding precision. Overflow occurs only when the destination is S- or

D-precision format; overflows for other formats are handled as operand errors. At the end of any operation

that could potentially overflow, the intermediate result is checked for underflow, rounded, and then

checked for overflow before it is stored to the destination. If overflow occurs, FPSR[OVFL,INEX] are set.
Even if the intermediate result is small enough to be represented as a double-precision number, an

overflow can occur if the magnitude of the intermediate result exceeds the range of the selected rounding

precision format. See

Table 6-17

.

Table 6-15. Possible Operand Errors

Instruction

Condition Causing Operand Error

FADD

[(+

∞) + (-∞)] or [(-∞) + (+∞)]

FDIV

(0 ÷ 0) or (

∞ ÷ ∞)

FMOVE OUT (to B, W, or L)

Integer overflow, source is NAN or ±

FMUL

One operand is 0 and the other is ±

FSQRT

Source is < 0 or -

FSUB

[(+

∞) - (+∞)] or [(-∞) - (-∞)]

Table 6-16. OPERR Exception Enabled/Disabled Results

Condition

OPERR

Description

Exception

disabled

0

When the destination is a floating-point data register, the result is a double-precision NAN, with
its mantissa set to all ones and the sign set to zero (positive).
For a FMOVE OUT instruction with the format S or D, an OPERR exception is impossible. With
the format B, W, or L, an OPERR exception is possible only on a conversion to integer overflow,
or if the source is either an infinity or a NAN. On integer overflow and infinity source cases, the
largest positive or negative integer that can fit in the specified destination size (B, W, or L) is
stored. In the NAN source case, a constant of all ones is written to the destination.

Exception

enabled

1

The result written to the destination is the same as for the exception disabled case unless the
exception occurred on a FMOVE OUT, in which case the destination is unaffected. If desired,
the user OPERR handler can overwrite the default result.

Advertising
This manual is related to the following products: