29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C and C++ Implementation Details<br />

• Bitwise operations on signed integral types follow the rules that arise naturally<br />

from two's complement representation. No sign extension takes place.<br />

• Right shifts on signed quantities are arithmetic.<br />

• For values of type int,<br />

— Shifts outside the range 0 to 127 are undefined.<br />

— Left shifts of more than 31 give a result of zero.<br />

— Right shifts of more than 31 give a result of zero from a shift of an unsigned<br />

value or positive signed value. They yield –1 from a shift of a negative<br />

signed value.<br />

• For values of type long long, shifts outside the range 0 to 63 are undefined.<br />

• The remainder on integer division has the same sign as the divisor, as mandated<br />

by the ISO C99 standard.<br />

• If a value of integral type is truncated to a shorter signed integral type, the result<br />

is obtained by discarding an appropriate number of most significant bits. If the<br />

original number is too large, positive or negative, for the new type, there is no<br />

guarantee that the sign of the result is going to be the same as the original.<br />

• A conversion between integral types does not raise an exception.<br />

• Integer overflow does not raise an exception.<br />

• Integer division by zero returns zero by default.<br />

Operations on floating-point types<br />

The following statements apply to operations on floating-point types:<br />

• Normal IEEE 754 rules apply.<br />

• Rounding is to the nearest representable value by default.<br />

• Floating-point exceptions are disabled by default.<br />

Also, see --fpmode=model on page 2-39.<br />

Note<br />

The IEEE 754 standard for floating-point processing states that the default action to an<br />

exception is to proceed without a trap. You can modify floating-point error handling by<br />

tailoring the functions and definitions in fenv.h. See Tailoring error signaling, error<br />

handling, and program exit on page 2-76 for more information.<br />

5-6 Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348A<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!