9- 6 M68040 USER’S MANUAL MOTOROLA
Many users elect to disable traps for all or part of the floating-point exception classes. The
AEXC byte makes it unnecessary to poll the EXC byte after each floating-point instruction.
At the end of most operations (FMOVEM and FMOVE excluded), the bits in the EXC byte
are logically combined to form an AEXC value that is logically ORed into the existing
AEXC byte. This operation creates sticky floating-point exception bits in the AEXC byte
that the user needs to poll only once (i.e., at the end of a series of floating-point
operations). A sticky bit is one that remains set until the user clears it.
IOP OVFL UNFL DZ INEX
7 654321 0
DIVIDE BY ZERO
Figure 9-6. FPSR Accrued Exception Byte
Setting or clearing the AEXC bits neither causes nor prevents an exception. The following
equations show the comparative relationship between the EXC byte and AEXC byte.
Comparing the current value in the AEXC bit with a combination of bits in the EXC byte
derives a new value in the corresponding AEXC bit. These equations apply to setting the
AEXC bits at the end of each operation affecting the AEXC byte:
= Old AEXC
IOP = IOP V(SNAN V OPERR)
OVFL = OVFL V(OVFL)
UNFL = UNFL V(UNFL Λ INEX2)
DZ = DZ V(DZ)
INEX = INEX V(INEX1 V INEX2 V OVFL)
9.2.4 Floating-Point Instruction Address Register (FPIAR)
For the subset of the floating-point instructions that generate exception traps, the FPU
loads the 32-bit FPIAR with the logical address of the instruction before executing the
instruction. Because the IU can execute instructions while the FPU executes floating-point
instructions and, the FPU can concurrently execute two floating-point instructions the PC
value stacked by the MC68040 in response to a floating-point exception handler cannot
point to the offending instruction. Therefore, a floating-point exception handler uses the
address in the FPIAR to locate a floating-point instruction that has caused an exception.
Since the FMOVE to/from the FPCR, FPSR, or FPIAR and FMOVEM instructions cannot
generate floating-point exceptions, these instructions do not modify the FPIAR. However,