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

Selecting the target processor

The Arm Compiler 6 lets you target either an architecture or a specific processor when generating code:

  • Specifying an architecture provides the greatest code compatibility. The generated code can run on any processor supporting that architecture.
  • Specifying a particular processor provides optimum performance. The compiler can use processor-specific features such as instruction scheduling to generate optimized code for that specific processor.

We consider the following armclang command-line options in this section:

  • The --target command-line option is mandatory and allows you to specify the target triple. The target triple has the form architecture-vendor-OS-abi, for example aarch64-arm-none-eabi. The available triples are limited by the compiler version (see supported triples).
  • Use the --march option to generate code for a specific architecture (for example armv8-a). The supported architectures vary according to the selected target. To see a list of all the supported architectures for the selected target, use -march=list.
  • Use the --mcpu option to generate code for a specific processor (for example cortex-a53). The supported processors vary according to the selected target. To see a list of all the supported processors for the selected target, use -mcpu=list.

You must avoid specifying both the architecture (-march) and the processor (-mcpu) because it can cause a conflict. The compiler infers the correct architecture from the processor. For example, -mcpu=cortex-a53 infers -march= armv8-a. We recommend you understand the mandatory armclang options to set these options correctly.

To configure the --target, -march and -mcpu options in Arm DS:

  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.
    Opening Project 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. Enter a value for Target (--target). In this tutorial, we specify --target=aarch64-arm-none-eabi to generate A64 instructions for AArch64 state.
  7. Enter a value for Architecture (-march) or CPU (-mcpu). Remember to only include a value for one of these two fields. In the following example, we set CPU (-mcpu) to cortex-a53 to build for a Cortex-A53 processor. Setting the CPU(-mcpu) option to cortex-A53

  8. Click Apply and Close to save the settings.

You can see a list of all supported architectures by specifying list for the Architecture (-march) setting, then building your project. The console (Window > Show View > Console) shows the list of architecture names.

Listing of -march options available in armclang

You can also see a list of all supported processors by specifying list for the CPU (-mcpu) setting, then building your project.

Listing of -mcpu options available in armclang

If the compiled program is to run on a specific Arm architecture-based processor, select the target processor. For example, to compile code to run on a Cortex-A53 processor use the CPU (-mcpu) setting cortex-a53.

Alternatively, if the compiled program is to run on different Arm processors, choose the lowest common denominator architecture appropriate for the application. Use the Architecture (-march) setting to set the architecture. For example, if you want your program to compile for Cortex-A53 and Cortex-A57 processors, you must use the -march= armv8-a option.

Previous Next