3.2.2. Automatic vectorization

By coding in vectorizable loops instead of writing in explicit NEON instructions, code portability is preserved between processors. Performance levels similar to that of hand coded vectorization are achieved with less effort.

Example 3.1 shows the required command-line options to invoke automatic vectorization.

Example 3.1.  Automatic vectorization

armcc --vectorize --cpu=Cortex-A8 -O3 -Otime -c file.c

Enabling and disabling the vectorize option provides timing comparisons with scalar code when optimizing for improved performance using vectorization. See ‑‑[no_]vectorize for more information.

Note

You can also compile with -O2 -Otime, however, this does not give the maximum code performance.

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0350A
Non-Confidential