04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

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.

Compiler Command-line Options<br />

A number of transformations might be performed, including:<br />

• Double-precision math functions might be converted to single<br />

precision equivalents if all floating-point arguments can be exactly<br />

represented as single precision values, and the result is immediately<br />

converted to a single-precision value.<br />

This transformation is only performed when the selected library<br />

contains the single-precision equivalent functions, for example,<br />

when the selected library is rvct or aeabi_glibc.<br />

For example:<br />

float f(float a)<br />

{<br />

return sqrt(a);<br />

}<br />

is transformed to<br />

float f(float a)<br />

{<br />

return sqrtf(a);<br />

}.<br />

• Double-precision floating-point expressions that are narrowed to<br />

single-precision are evaluated in single-precision when it is<br />

beneficial to do so. For example, float y = (float)(x + 1.0) is<br />

evaluated as float y = (float)x + 1.0f.<br />

• Division by a floating-point constant is replaced by multiplication<br />

with the inverse. For example, x / 3.0 is evaluated as x * (1.0 /<br />

3.0).<br />

• It is not guaranteed that the value of errno is compliant with the ISO<br />

C or C++ standard after math functions have been called. This<br />

enables the compiler to inline the VFP square root instructions in<br />

place of calls to sqrt() or sqrtf().<br />

Note<br />

Initialization code might be required to enable the VFP. See VFP support on page 5-34<br />

in the Compiler User Guide for more information.<br />

See also<br />

• <strong>ARM</strong> Application Note 133 - Using VFP with RVDS in<br />

install_directory\RVDS\Examples\...\vfpsupport.<br />

<strong>ARM</strong> DUI 0348C Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. 2-61<br />

ID101213<br />

Non-Confidential,

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

Saved successfully!

Ooh no, something went wrong!