05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The System Level Programmers’ Model<br />

B1.8.5 VFP support code<br />

A complete VFP implementation might require a software component, known as the support code. For<br />

example, if VFPv3U is implemented support code must h<strong>and</strong>le the trapped floating-point exceptions.<br />

Typically, the support code is entered through the <strong>ARM</strong> Undefined Instruction vector, when the extension<br />

hardware does not respond to a VFP instruction. This software entry is known as a bounce.<br />

When VFPv3U is implemented, the bounce mechanism is used to support trapped floating-point exceptions.<br />

Trapped floating-point exceptions, known as traps, are floating-point exceptions that an implementation<br />

passes back to application software to resolve, see Floating-point exceptions on page A2-42. The support<br />

code must catch a trapped exception <strong>and</strong> convert it into a trap h<strong>and</strong>ler call.<br />

The support code can perform other tasks, as determined by the implementation. It might be used for rare<br />

conditions, such as operations that are difficult to implement in hardware, or operations that are gate<br />

intensive in hardware. This permits consistent software behavior with varying degrees of hardware support.<br />

The division of labor between the hardware <strong>and</strong> software components of an implementation, <strong>and</strong> details of<br />

the interface between the support code <strong>and</strong> hardware are SUBARCHITECTURE DEFINED.<br />

Asynchronous bounces, serialization, <strong>and</strong> VFP exception barriers<br />

A VFP implementation can produce an asynchronous bounce, in which a VFP instruction takes the<br />

Undefined Instruction exception because support code processing is required for an earlier VFP instruction.<br />

The mechanism by which the nature of the required processing is communicated to the support code is<br />

SUBARCHITECTURE DEFINED. Typically, it involves:<br />

using the SUBARCHITECTURE DEFINED bits of the FPEXC, see The Floating-Point Exception Register<br />

(FPEXC) on page B1-68<br />

using the SUBARCHITECTURE DEFINED extension system registers, see Advanced SIMD <strong>and</strong> VFP<br />

extension system registers on page B1-66<br />

setting FPEXC.EX == 1, to indicate that the SUBARCHITECTURE DEFINED extension system registers<br />

must be saved on a context switch.<br />

An asynchronous bounce might not relate to the last VFP instruction executed before the one that took the<br />

Undefined Instruction exception. It is possible that another VFP instruction has been issued <strong>and</strong> retired<br />

before the asynchronous bounce occurs. This is possible only if this intervening instruction has no register<br />

dependencies on the VFP instruction that requires support code processing. In addition. it is possible that<br />

there are SUBARCHITECTURE DEFINED mechanisms for h<strong>and</strong>ling an intervening VFP instruction that has<br />

issued but not retired.<br />

However, VMRS <strong>and</strong> VMSR instructions that access the FPSID, FPSCR, or FPEXC registers are serializing<br />

instructions. This means they ensure that any exceptional condition in any preceding VFP instruction that<br />

requires support code processing has been detected <strong>and</strong> reflected in the extension system registers before<br />

they perform the register transfer. A VMSR instruction to the read-only FPSID register is a serializing NOP.<br />

B1-70 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!