23.12.10. FTOUI, FTOUIZ, FTOSI, and FTOSIZ

Float-to-integer conversions generate Invalid Operation exceptions rather than Overflow or Underflow exceptions. To support signed conversions with round-towards-zero rounding in the maximum range possible for C, C++, and Java compiled code, the thresholds for pessimistic bouncing are different for the various rounding modes.

Table 23.12 and Table 23.13 use the following notation:

In the VFP Response column, the response notations are:

all

These input values are bounced for all rounding modes.

S

These input values are bounced for signed conversions in all rounding modes.

SnZ

These input values are bounced for signed conversions in all rounding modes except round-towards-zero.

U

These input values are bounced for unsigned conversions in all rounding modes.

UnZ

These input values are bounced for unsigned conversions in all rounding modes except round-towards-zero.

In the Unsigned results and Signed results columns, the rounding mode notations are:

N

Round-to-nearest mode.

P

Round-towards-plus-infinity mode.

M

Round-towards-minus infinity mode.

Z

Round-towards-zero mode.

Table 23.12 shows the single-precision float-to-integer bounce range and the results returned for exceptional conditions. The exponent values shown in Table 23.12 are in biased format.

Table 23.12. Single-precision float-to-integer bounce thresholds and stored results

Floating-point valueInteger valueUnsigned resultStatusSigned resultStatusVFP11 response
NaN-0x00000000Invalid0x00000000InvalidBounce all
0x7F800000+infinity0xFFFFFFFFInvalid0x7FFFFFFFInvalidBounce all

0x7F7FFFFF to 0x4F800000

+maximum SP[1] to 232

0xFFFFFFFF

Invalid0x7FFFFFFFInvalidBounce all

0x4F7FFFFF to 0x4F000000

232 - 28 to 231

0xFFFFFF00 to 0x80000000

Valid0x7FFFFFFFInvalidBounce S UnZ

0x4EFFFFFF to 0x4E800000

231 - 27 to 230

0x7FFFFF80 to 0x40000000

Valid

0x7FFFFF80 to 0x40000000

ValidBounce SnZ

0x4E7FFFFF to 0x00000000

230 - 26 to +0

0x3FFFFFC0 to 0x00000000

Valid

0x3FFFFFC0 to 0x00000000

ValidNo bounce

0x80000000 to 0xCE7FFFFF

-0 to -230 + 26

0x00000000

Invalid[2]

0x00000000 to 0xC0000040

ValidBounce U

0xCE800000 to 0xCEFFFFFF

-230 to -231 +27

0x00000000Invalid

0xC0000000 to 0x80000080

ValidBounce U
0xCF000000-2310x00000000Invalid0x80000000ValidBounce U SnZ

0xCF000000 to 0xFF7FFFFF

-231 to -maximum SP

0x00000000Invalid0x80000000InvalidBounce all
0xFF800000-infinity0x00000000Invalid0x80000000InvalidBounce all

[1] SP = single-precision.

[2] A negative input value that rounds to a zero result returns zero and is not invalid.

Table 23.13 shows the double-precision float-to-integer bounce range and the results returned for exceptional conditions.

Table 23.13. Double-precision float-to-integer bounce thresholds and stored results

Floating-point valueInteger valueUnsigned resultStatusSigned resultStatusVFP11 response
NaN-0x00000000Invalid0x00000000InvalidBounce all
0x7FF00000 00000000+infinity0xFFFFFFFFInvalid0x7FFFFFFFInvalidBounce all

0x7FEFFFFF FFFFFFFF to 0x41F00000 00000000

+max DP[1] to  232

0xFFFFFFFFInvalid0x7FFFFFFFInvalidBounce all

0x41EFFFFF FFFFFFFF to 0x41EFFFFF FFF00000

232 - 221 to  232 - 2-1

0xFFFFFFFF N, P

0xFFFFFFFF Z, M

Invalid

Valid

0x7FFFFFFFInvalidBounce S UnZ

0x41EFFFFF FFEFFFFF to 0x41EFFFFF FFE00001

232 - 2-1 - 221 to 232 - 20 + 2-21

0xFFFFFFFF P

0xFFFFFFFF N, Z, M

Invalid

Valid

0x7FFFFFFFInvalidBounce S UnZ

0x41EFFFFF FFE00000 to 0x41E00000 00000000

232 - 20 to 231

0xFFFFFFFF to 0x80000000

Valid0x7FFFFFFFInvalidBounce S UnZ

0x41DFFFFF FFFFFFFF to 0x41DFFFFF FFE00000

231 - 222 to 231 - 2-1

0x80000000 N, P

0x7FFFFFFF Z, M

Valid

Valid

0x7FFFFFFF N, P

0x7FFFFFFF Z, M

Invalid

Valid

Bounce SnZ

0x41DFFFFF FFDFFFFF to 0x41DFFFFF FFC00001

231 - 2-1 - 2-22 to 231 - 20 + 2-22

0x80000000 P

0x7FFFFFFF N, Z, M

Valid

Valid

0x7FFFFFFF P

0x7FFFFFFF N,Z,M

Invalid

Valid

Bounce SnZ

0x41DFFFFF FFC00000 to 0x41D00000 00000000

231 - 20 to 230

0x7FFFFFFF to 0x40000000

Valid Valid

0x7FFFFFFF to 0x40000000

Valid Valid

Bounce SnZ

0x41CFFFFF FFFFFFFF to 0x00000000 00000000

230 - 223 to +0

0x40000000 N, P 0x3FFFFFFF Z, M to 0x00000000

Valid Valid Valid

0x40000000 N, P 0x3FFFFFFF Z, M to 0x00000000

Valid Valid Valid

Bounce none

0x80000000 00000000 to 0xC1CFFFFF FFFFFFFF

-0 to -230 + 2-23

0x00000000[2]Invalid

0x00000000 to 0xC0000001 Z, P 0xC0000000 N, M

Valid Valid Valid

Bounce U

0xC1D00000 00000000 to 0xC1DFFFFF FFFFFFFF

-230 to -231 + 2-22

0x00000000Invalid

0xC0000000 to 0x80000001 Z, P 0x80000000 N, M

Valid Valid Valid

Bounce U
0xC1E00000 00000000-2310x00000000Invalid0x80000000ValidBounce U SnZ

0xC1E00000 00000001 to 0xC1E00000 00100000

-231 - 2-21 to -231 - 2-1

0x00000000Invalid

0x80000000 N, Z, P 0x80000000 M

Valid Invalid

Bounce U SnZ

0xC1E00000 00100001 to 0xC1E00000 001FFFFF

-231 - 2-1 - 2-21 to 231 - 20 + 2-21

0x00000000

Invalid

0x80000000 Z, P 0x80000000 N, M

Valid Invalid

Bounce U SnZ

0xC1E00000 00200000 to 0xFFEFFFFF FFFFFFFF

231 - 20 to -max DP [1]

0x00000000Invalid0x80000000InvalidBounce all
0xFFF00000 00000000-infinity0x00000000Invalid0x00000000InvalidBounce all

[1] max DP = maximum double-precision.

[2] A negative input value that rounds to a zero result returns zero and is not invalid.

Copyright © 2005-2007 ARM Limited. All rights reserved.ARM DDI 0290G
Non-Confidential