7.2. Overview of processing a bounced VFP instruction

The VFP support code is entered when the VFP coprocessor bounces an instruction. This causes the processor to signal an Undefined Instruction exception.

Top-level Undefined Instruction handler

The top-level Undefined Instruction handler TLUndef_Handler() saves the processor state, calls an appropriate second-level handler, and then restores the saved state. There are separate second-level handlers for each coprocessor and for each type of undefined instruction.

Second-level VFP Undefined Instruction handler

The VFP second-level handler VFP_Undef_Handler() first checks the VFP is enabled and the exception was not caused by an illegal instruction. If either check fails the handler calls Undef_Coproc_Handler() to process the bounce.

Note

VFP_Undef_Handler() uses SUBARCHITECTURE DEFINED functions to access and interpret the exception information in the coprocessor. Suitable functions for VFP9, VFP10 and VFP11 are provided in vfpsubarch.s. See Section 7.6 "VFP Subarchitecture Support".

Otherwise the handler reads exception information out of the coprocessor to construct a list of operations that must be processed in software, and resets the VFP coprocessor's exception mechanism. It then prepares arguments for a user-level exception handler which will process the instruction list, and returns control to the top-level handler.

Returning to the top-level handler

The second-level handler returns to the top-level handler, where the application's context is restored.

The second-level handler might raise a user-level exception. The second-level VFP handler does this, and the top-level handler returns by transferring control and parameters to the user-level VFP handler instead of returning directly to the bounced instruction.

User-level VFP handler

The user-level VFP handler processes bounced operations in the application's context using the VFP computation engine software provided.

As floating-point exceptions are encountered calls can be made to application trap handlers, as specified by ANSI / IEEE Std. 754-1985, IEEE Standard for Binary Floating-Point Arithmetic. The application trap handlers can either return substitute results, or abort processing with longjmp. The support code uses the floating-point trap handler mechanism in the ARM C library, as described in RVDS Compiler and Libraries Guide.

Note

A single VFP instruction can generate multiple floating-point traps. This is possible only if it is made up of multiple operations, as are vector instructions and multiply-accumulate instructions.

When all bounced operations have been processed the user-level exception handler returns to an address provided by the top-level Undefined Instruction handler. For imprecise exceptions this is the address of the instruction that bounced. For precise exceptions this is the address of the following instruction.

Copyright © 2005. All rights reserved.DAI0133B