29.10.2014 Views

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

ARM Compiler toolchain v4.1 for µVision Using the Compiler

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Compiler</strong> Features<br />

4.2 Per<strong>for</strong>mance benefits of compiler intrinsics<br />

The use of compiler intrinsics offers <strong>the</strong> following per<strong>for</strong>mance benefits:<br />

• The low-level instructions substituted <strong>for</strong> an intrinsic might be more efficient than<br />

corresponding implementations in C or C++, resulting in both reduced instruction and<br />

cycle counts. To implement <strong>the</strong> intrinsic, <strong>the</strong> compiler automatically generates <strong>the</strong> best<br />

sequence of instructions <strong>for</strong> <strong>the</strong> specified target architecture. For example, <strong>the</strong> L_add<br />

intrinsic maps directly to <strong>the</strong> <strong>ARM</strong> v5TE assembly language instruction qadd:<br />

QADD r0, r0, r1 /* Assuming r0 = a, r1 = b on entry */<br />

• More in<strong>for</strong>mation is given to <strong>the</strong> compiler than <strong>the</strong> underlying C and C++ language is able<br />

to convey. This enables <strong>the</strong> compiler to per<strong>for</strong>m optimizations and to generate instruction<br />

sequences that it could not o<strong>the</strong>rwise have per<strong>for</strong>med.<br />

These per<strong>for</strong>mance benefits can be significant <strong>for</strong> real-time processing applications. However,<br />

care is required because <strong>the</strong> use of intrinsics can decrease code portability.<br />

4.2.1 See also<br />

Concepts<br />

• <strong>Compiler</strong> intrinsics on page 4-3.<br />

<strong>ARM</strong> DUI 0375C Copyright © 2007-2008, 2011 <strong>ARM</strong>. All rights reserved. 4-5<br />

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!