6
In addition to being used by the FPCP to validate a state frame before it is used in a restore
operation, the format word can be used by a user program to identify the format of a state
frame and the saved state of the FPCP. In the following descriptions of the three state
frames, the data format within a frame is guaranteed only for those version number and
frame size values given in the accompanying tables. Routines that utilize state frame in-
formation must examine the format word to correctly identify any data formats that are
subject to change by Freescale.
NOTE
The state size value in the format word indicates the size (in bytes) of the FPCP
internal state information. This size value does not include the format word or
the reserved word.
6.4.2.1 NULL STATE FRAME. As shown in Figures 6-4 and 6-5, no internal state infor-
mation is saved in the null state frame. Only the coprocessor version number (0) is indicated.
Version number 0 is a wild card number, allowing this state frame type to be restored to
a coprocessor of any version. The size value of a null state frame is not assumed to be
valid during a save operation and is ignored by the FPCP during a restore operation. A
restore of the null state performs the reset function with all floating-point data registers
loaded with nonsignaling NANs and with the FPCR and FPSR set to zero. A save of the
null state results when no FPCP instructions have been executed since the last null state
restore or hardware reset. Note that a save of a null state indicates that the FPCP pro-
grammer's model is empty, and thus does not need to be saved with a FMOVEM instruction.
6.4.2.2 IDLE STATE FRAME. As shown in Figure 6-4, 24 bytes of internal state are saved
in the idle state frame for the MC68881. For the MC6882, the idle state frame consists of
56 bytes (see Figure 6-5). The format word indicates the coprocessor version number and
state size (24 or 56 bytes in addition to the format word). An idle state frame is produced
if an FSAVE occurs when a floating-point instruction is not being executed, or when the
current instruction is in the end phase (refer to 6.4.3.5 END PHASE for a definition of the
end phase).
In addition to being used for context switching, the idle state frame contains information
that is useful to most floating-point exception handlers. First, it contains the exceptional
operand value, which can be evaluated by an exception handler to determine the cause
of an exception. Second, it contains the BIU flag word that indicates the status of the FPCP
at the time of an FSAVE instruction. For example, this information can be used by the trace
exception handler in a debug monitor to display the pending exception status along with
the register state of the machine.
As shown in Figure 6-4, the idle state frame for the MC68881 contains four data items: the
command/condition register image, the exceptional operand, the operand register image,
and the BIU flags. A reserved word is also included in order to align the state frame to a
long-word boundary; it is written as $FFFF and ignored during restore operations. The
command/condition word and operand register may contain temporary information, as
indicated by the BIU flags.
The idle state frame for the MC68882 contains 32 words of CU internal register and state
information between the command condition register and the exceptional operand. It is
otherwise identical to the idle state frame for the MC68881.
FREESCALE
6-32
MC68881/MC68882 USER'S MANUAL