8.189 --vectorize, --no_vectorize

Enables and disables the generation of NEON vector instructions directly from C or C++ code.

Default

The default is --no_vectorize.

Restrictions

The following options must be specified for loops to vectorize:

--cpu=name

Target processor must have NEON capability.

-Otime

Type of optimization to reduce execution time.

-Onum

Level of optimization. One of the following must be used:

  • -O2 High optimization. This is the default.

  • -O3 Maximum optimization.

Examples

This example invokes automatic vectorization on the Cortex-A8 processor.

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

Using the command-line options -O3 and -Otime ensures that the code achieves significant performance benefits in addition to those of vectorization.

Note

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

Related reference
8.39 --cpu=name compiler option
8.138 -Onum
8.142 -Otime
8.157 --reassociate_saturation, --no_reassociate_saturation
3 Using the NEON Vectorizing Compiler
Related information
Introducing NEON Development Article
Non-ConfidentialPDF file icon PDF versionARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.