4.6.2. Assembler

You can program the NEON unit directly in Assembly language. The consistent design of the NEON instruction set makes this less complex than you might expect. The Gnu's Not Unix (GNU) and ARM assemblers use the same instruction format, but other syntax differs.

Example 4.7. Simple NEON assembler example for GAS

	.text
	.arm
	.global double_elements
double_elements:
	vadd.i32 q0,q0,q0
	bx lr
	.end

To assemble the code in Example 4-7 using GNU Assembler, add -mfpu=neon to the assembler command line. It specifies that NEON instructions are permitted. For example:

arm-none-linux-gnueabi-as -mfpu=neon asm.s

Example 4.8. Simple NEON assembler example for ARM Compiler

	AREA RO, CODE, READONLY
	ARM
	EXPORT double_elements
double_elements

VADD.I32 Q0, Q0, Q0
BX LR
END

To assemble the code in Example 4-8 using ARM Compiler, you must specify a target processor that supports NEON instructions. For example:

armasm --cpu=Cortex-A8 asm.s
Copyright © 2014 ARM. All rights reserved.ARM DAI0425
Non-ConfidentialID080414