You copied the Doc URL to your clipboard.

Generating NEON instructions from C or C++ code

To generate NEON instructions from C or C++ code, specify the following compiler options:

  • A target --cpu that has NEON capability, for example Cortex-A7, Cortex-A8, Cortex-A9, Cortex-A12, or Cortex-A15.

  • --vectorize to enable NEON vectorization.

  • -O2 (default) or -O3 optimization level.

  • -Otime to optimize for performance instead of code size.

You can also use --diag_warning=optimizations to obtain useful diagnostics from the compiler on what it can and cannot optimize or vectorize. For example:

armcc --cpu Cortex-A8 --vectorize -O3 -Otime --diag_warning=optimizations source.c

To run code that contains NEON instructions, you must enable both the FPU and NEON.