3.2 Performance benefits of compiler intrinsics

The use of compiler intrinsics offers a number of performance benefits:

  • The low-level instructions substituted for an intrinsic might be more efficient than corresponding implementations in C or C++, resulting in both reduced instruction and cycle counts. To implement the intrinsic, the compiler automatically generates the best sequence of instructions for the specified target architecture. For example, the L_add intrinsic maps directly to the ARM assembly language instruction qadd:
    QADD r0, r0, r1    /* Assuming r0 = a, r1 = b on entry */
  • More information is given to the compiler than the underlying C and C++ language is able to convey. This enables the compiler to perform optimizations and to generate instruction sequences that it could not otherwise have performed.
These performance benefits can be significant for real-time processing applications. However, care is required because the use of intrinsics can decrease code portability.
Related concepts
3.1 Compiler intrinsics
3.5 Compiler intrinsics for controlling IRQ and FIQ interrupts
3.9 Compiler support for European Telecommunications Standards Institute (ETSI) basic operations
3.11 Texas Instruments (TI) C55x intrinsics for optimizing C code
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.