Floating-Point Exceptions - Hitachi SH7750 series Hardware Manual

Superh risc engine
Hide thumbs Also See for SH7750 series:
Table of Contents

Advertisement

Round to Nearest: The value is rounded to the nearest expressible value. If there are two nearest
expressible values, the one with an LSB of 0 is selected.
If the unrounded value is 2
unrounded value. The values of Emax and P, respectively, are 127 and 24 for single-precision, and
1023 and 53 for double-precision.
Round to Zero: The digits below the round bit of the unrounded value are discarded.
If the unrounded value is larger than the maximum expressible absolute value, the value will be
the maximum expressible absolute value.
6.5

Floating-Point Exceptions

FPU-related exceptions are as follows:
• General illegal instruction/slot illegal instruction exception
The exception occurs if an FPU instruction is executed when SR.FD = 1.
• FPU exceptions
The exception sources are as follows:
 FPU error (E): When FPSCR.DN = 0 and a denormalized number is input
 Invalid operation (V): In case of an invalid operation, such as NaN input
 Division by zero (Z): Division with a zero divisor
 Overflow (O): When the operation result overflows
 Underflow (U): When the operation result underflows
 Inexact exception (I): When overflow, underflow, or rounding occurs
The FPSCR cause field contains bits corresponding to all of above sources E, V, Z, O, U, and
I, and the FPSCR flag and enable fields contain bits corresponding to sources V, Z, O, U, and
I, but not E. Thus, FPU errors cannot be disabled.
When an exception source occurs, the corresponding bit in the cause field is set to 1, and 1 is
added to the corresponding bit in the flag field. When an exception source does not occur, the
corresponding bit in the cause field is cleared to 0, but the corresponding bit in the flag field
remains unchanged.
• Enable/disable exception handling
The SH7750 Series supports enable exception handling and disable exception handling.
Enable exception handling is initiated in the following cases:
 FPU error (E): FPSCR.DN = 0 and a denormalized number is input
 Invalid operation (V): FPSCR.EN.V = 1 and (instruction = FTRV or invalid operation)
 Division by zero (Z): FPSCR.EN.Z = 1 and division with a zero divisor
Emax
–P
(2 – 2
) or more, the result will be infinity with the same sign as the
Rev. 4.0, 04/00, page 125 of 850

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sh7750sSh7750

Table of Contents