VFP Exception Handling
ARM DDI 0301H
Copyright © 2004-2009 ARM Limited. All rights reserved.
22-14
ID012310
Non-Confidential, Unrestricted Access
When the VFP11 coprocessor detects a potentially invalid condition, the EX flag, FPEXC[31],
and the IOC flag, FPEXC[0], are set. The IOC flag in the FPSCR register, FPSCR[0], is not set
by the hardware and must be set by the support code before calling the Invalid Operation user
trap handler.
The support code determines the exception status of all bounced instructions. If an invalid
condition exists, the Invalid Operation user trap handler is called. The source and destination
registers for the instruction are valid in the VFP11 register file.
22.6.2
Exception disabled
If the IOE bit is not set, the VFP11 coprocessor writes a default NaN into the destination register
for all operations except integer conversion operations.
Conversion of a floating-point value that is outside the range of the destination integer is an
invalid condition rather than an overflow condition. When an invalid condition exists for a
float-to-integer conversion, the VFP11 coprocessor delivers a default result to the destination
register and sets the IOC flag, FPSCR[0]. Table 22-5 lists the default results for input values
after rounding.
If the VFP11 coprocessor is not in default NaN mode, an arithmetic instruction with an SNaN
operand sets the IOC flag and causes a bounce to support code.
Note
A negative input to an unsigned conversion that does not round to a true zero in the conversion
process sets the IOC flag, FPEXC[0].
Table 22-5 Default results for invalid conversion inputs
Input value
after rounding
FTOUIS and FTOUID
FTOSIS and FTOSID
Result
FPSCR IOC flag set?
Result
FPSCR IOC flag set?
x 2
32
0xFFFFFFFF
Yes
0x7FFFFFFF
Yes
2
31
≤
x
<
2
32
Integer
No
0x7FFFFFFF
Yes
0
≤
x
<
2
31
Integer
No
Integer
No
0
≥
x
≥
–2
31
0x00000000
Yes
Integer
No
x < –2
31
0x00000000
Yes
0x80000000
Yes
NaN
0x00000000
Yes
0x00000000
Yes
+infinity
0xFFFFFFFF
Yes
0x7FFFFFFF
Yes
–infinity
0x00000000
Yes
0x80000000
Yes