
MOTOROLA
Chapter 5. Exceptions
5-1
Chapter 5
Exceptions
The PowerPC exception mechanism allows the processor to change to supervisor state as a
result of external signals, errors, or unusual conditions arising in the execution of
instructions, and differ from the arithmetic exceptions defined by the IEEE for
floating-point operations. When exceptions (referred to as interrupts in the architecture
specification) occur, information about the state of the processor is saved to certain registers
and the processor begins execution at an address (exception vector) predetermined for each
exception. Processing of exceptions occurs in supervisor mode.
Although multiple exception conditions can map to a single exception vector, a more
specific condition may be determined by examining a register associated with the
exception—for example, the DSISR or FPSCR. Additionally, certain exception conditions
can be explicitly enabled or disabled by software.
The PowerPC architecture requires that exceptions be handled in program order; therefore,
although a particular implementation may recognize exception conditions out of order, they
are handled strictly in order with respect to the instruction stream. When an
instruction-caused exception is recognized, any unexecuted instructions that appear earlier
in the instruction stream, including any that have not yet entered the execute state, are
required to complete before the exception is taken. Any exceptions caused by those
instructions are handled first. Likewise, exceptions that are asynchronous and precise are
recognized when they occur, but are not handled until the instruction currently in the
completion stage successfully completes execution or generates an exception, and the
completed store queue is emptied (see Section 7.1, “Terminology and Conventions,” for the
definition). An instruction is said to have completed when the results of that instruction’s
execution have been committed to the registers defined by the architecture (for example,
the GPRs or FPRs, rather than rename buffers). If a single instruction encounters multiple
exception conditions, those exceptions are taken and handled sequentially. Likewise,
exceptions that are asynchronous are recognized when they occur, but are not handled until
the next instruction to complete in program order successfully completes. Throughout this
chapter, the phrase ‘next instruction’ implies the next instruction to complete in program
order.
Note that exceptions can occur while an exception handler routine is executing, and
multiple exceptions can become nested. It is up to the exception handler to save the states
to allow control to ultimately return to the original excepting program.
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.