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

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

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

<strong>Compiler</strong> Coding Practices<br />

• Guarding against multiple inclusion of header files on page 5-21<br />

• Methods of minimizing function parameter passing overhead on page 5-22<br />

• Functions that return multiple values through registers on page 5-23<br />

• Functions that return <strong>the</strong> same result when called with <strong>the</strong> same arguments on page 5-24<br />

• Comparison of pure and impure functions on page 5-25<br />

• Recommendation of postfix syntax when qualifying functions with <strong>ARM</strong> function<br />

modifiers on page 5-27<br />

• Inline functions on page 5-29<br />

• <strong>Compiler</strong> decisions on function inlining on page 5-30<br />

• Automatic function inlining and static functions on page 5-32<br />

• Inline functions and removal of unused out-of-line functions at link time on page 5-33<br />

• Automatic function inlining and multifile compilation on page 5-34<br />

• Restriction on overriding compiler decisions about function inlining on page 5-35<br />

• <strong>Compiler</strong> modes and inline functions on page 5-36<br />

• Inline functions in C++ and C90 mode on page 5-37<br />

• Inline functions in C99 mode on page 5-38<br />

• Inline functions and debugging on page 5-40<br />

• Types of data alignment on page 5-41<br />

• Advantages of natural data alignment on page 5-42<br />

• <strong>Compiler</strong> storage of data objects by natural byte alignment on page 5-43<br />

• Relevance of natural data alignment at compile time on page 5-44<br />

• Unaligned data access in C and C++ code on page 5-45<br />

• The __packed qualifier and unaligned data access in C and C++ code on page 5-46<br />

• Unaligned fields in structures on page 5-47<br />

• Per<strong>for</strong>mance penalty associated with marking whole structures as packed on page 5-48<br />

• Unaligned pointers in C and C++ code on page 5-49<br />

• Unaligned Load Register (LDR) instructions generated by <strong>the</strong> compiler on page 5-50<br />

• Detailed comparison of an unpacked struct, a __packed struct, and a struct with<br />

individually __packed fields on page 5-51<br />

• <strong>Compiler</strong> support <strong>for</strong> floating-point arithmetic on page 5-53<br />

• Default selection of hardware or software floating-point support on page 5-55<br />

• Example of hardware and software support differences <strong>for</strong> floating-point arithmetic on<br />

page 5-56<br />

• Vector Floating-Point (VFP) architectures on page 5-58<br />

• Limitations on hardware handling of floating-point arithmetic on page 5-59<br />

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

ID061811<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!