EasyManua.ls Logo

Freescale Semiconductor MC68881 - Condition Code Versus Result Data Type

Default Icon
409 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Table 2-1. Condition Code versus Result Data Type
N Z I
NAN Result
Data Type
0 0 0 0 + Normalized or Denormalized
1 0 0 0 - Normalized or Denormalized
0 1 0 0 +0
1 1 0 0 -0
0 0 1 0 + Infinity
1 0 I 0 - Infinity
0 0 0 1 + NAN
1 0 0 1 - NAN
only eight of the 16 possible combinations. Loading the FPCC byte with one of the other
condition code bit combinations and executing a conditional instruction may produce an
unexpected branch condition.
The IEEE standard defines the following four conditions and only requires the generation
of the condition codes as a result of a floating-point compare operation. In addition to this
requirement, the FPCP can test these conditions at the end of any operation affecting the
condition codes.
EQ --Equal To
GT --Greater Than
LT --Less Than
UN --Unordered
An unordered condition occurs when one or both of the operands in a floating-point
compare operation is a NAN. For purposes of the floating-point conditional branch, set
byte on condition, decrement and branch on condition, and trap-on condition instructions,
the FPCP logically combines the four condition codes to form the IEEE conditions according
to the following equations:
EQ =Z
GT = NvNANvZ
LT = NANANvZ
UN = NAN
where:
"A"
= Logical AND
"v" = Logical OR
Note that the setting of the FPCP condition codes is independent of the operation executed;
the condition codes only indicate the data type of the result generated. Unlike other M68000
condition codes, the IEEE defined conditions can always be derived from the data type of
the result, The setting of the M68000 integer condition codes is dependent upon the op-
eration executed as well as the result.
To aid programmers of floating-point subroutine libraries, the FPCP implements the four
previously described floating-point condition code bits in hardware instead of the four IEEE
defined conditions. The IEEE conditions are derived by an instruction when needed. For
example, the programmer of a complex arithmetic multiply subroutine usually prefers to
handle "special" data types such as zeros, infinities, or NANs, separately from "normal"
data types. The FPCP condition codes allow users to efficiently detect and handle these
"special" values.
MC68881/MC68882 USER'S MANUAL FREESCALE
2-5

Table of Contents

Related product manuals