Targetting processors, floating-point units, and NEON with Arm DS

Arm Development Studio (Arm DS) tutorial for selecting specific processors with Arm Compiler 6 to maximize performance, selecting Floating Point Unit (FPU) and enabling NEON.


Introduction Selecting the target processor Selecting the target FPU Enabling NEON automatic vectorization Further reading

Enabling NEON automatic vectorization

Arm NEON technology is the implementation of the Advanced SIMD architecture extension. It is a 64-bit and 128-bit hybrid SIMD technology targeted at advanced media and signal processing applications and embedded processors.

Specific NEON instructions let you use the NEON unit to perform operations in parallel on multiple lanes of data.

There are various methods of creating code that use NEON instructions:

  • Write assembly language, or use embedded assembly language in C, and use the NEON instructions directly.
  • Write in C or C++ using the NEON intrinsics.
  • Call a library routine that has been optimized to use NEON instructions.
  • Have the compiler use automatic vectorization to optimize loops for NEON.

For additional information, you can visit the Introducing Neon for Armv8-A guide.

To enable automatic vectorization, you must target a processor that has a NEON unit.

You must set an optimization level -O1 or higher to enable the generation of Advanced SIMD instructions directly from C or C++ code. To configure the optimization level in Arm DS:

  1. Select Project > Properties and expand C/C++ Build, then Settings in the Properties dialog box.
  2. On the Tool Settings tab, select Arm C Compiler 6 > Optimizations to display the code generation settings.
  3. Select the Optimization level you require. Setting Optimization level to High (-O2)
  4. Click Apply and Close to save the settings.

The --fvectorize option allows you to enable the generation of Advanced SIMD instructions directly from C or C++ code at optimization levels -O1 and higher. Depending on the optimization level, the steps to enable automatic vectorization are different:

Level -O2 or higher:
-fvectorize option is set by default when building for a NEON-capable processor.

Level -O1:

To set -fvectorize:

  1. Select your project in the Project Explorer view.
  2. To display the Properties dialog box, select Project > Properties from the main menu. You can also right-click on your project in the Project Explorer view to select Properties.
  3. Expand C/C++ Build, then Settings in the Properties dialog box.
  4. On the Tool Settings tab, select Arm C Compiler 6 > Target to display the code generation settings.
  5. Select Enable tool specific settings.
  6. Click the Vectorization (-fvectorize) box to enable.
    Enabling Vectorization (-fvectorize)
  7. Click Apply and Close to save the settings.
Previous Next