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-specific Features<br />

QADD res, i, j<br />

}<br />

return res;<br />

}<br />

SeeInline assembler on page 7-2 in the Compiler User Guide for more<br />

information.<br />

Assembler labels<br />

The __asm keyword can be used to specify an assembler label for a C<br />

symbol. For example:<br />

int count __asm__("count_v1"); // export count_v1, not count<br />

See Assembler labels on page 3-20 for more information.<br />

Named register variables<br />

The __asm keyword can be used to declare a named register variable. For<br />

example:<br />

register int foo __asm("r0");<br />

See Named register variables on page 4-192 for more information.<br />

See also<br />

• asm keyword on page 3-25.<br />

4.1.5 __forceinline<br />

The __forceinline keyword forces the compiler to compile a C or C++ function inline.<br />

The semantics of __forceinline are exactly the same as those of the C++ inline<br />

keyword. The compiler attempts to inline a function qualified as __forceinline,<br />

regardless of its characteristics. However, the compiler does not inline a function if<br />

doing so causes problems. For example, a recursive function is inlined into itself only<br />

once.<br />

__forceinline is a storage class qualifier. It does not affect the type of a function.<br />

Note<br />

This keyword has the function attribute equivalent __attribute__((always_inline)).<br />

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

Non-Confidential,<br />

ID101213

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

Saved successfully!

Ooh no, something went wrong!