4

Are there any resources that would cover syntax of using NEON Assembly with GNU assembler? I've read that syntax differs from the one using RVCT assembler, but that's the only thing I can find documentation for. Are there any good resources out there to get me started?

Phonon
  • 12,549
  • 13
  • 64
  • 114

3 Answers3

4

NEON syntax is the same besides one small detail: the aligned loads/stores use @ in ARM and ,: in GAS. This is because @ is a comment symbol in GAS.

ARM:

 vld1.32         {d0-d3},   [r1@128]!
 vld1.32         {d16-d19}, [r1@128]

GAS:

 vld1.32         {d0-d3},   [r1,:128]!
 vld1.32         {d16-d19}, [r1,:128]
Igor Skochinsky
  • 24,629
  • 2
  • 72
  • 109
  • Don't you also have to use all capital letters is ARM, e.g. VLD1.32? – Phonon Jun 21 '11 at 13:06
  • 1
    No, both assemblers are case-insensitive. However, at least ARM assembler does not support mixed case: "Instruction mnemonics, directives, and symbolic register names can be written in uppercase or lowercase, but not mixed." – Igor Skochinsky Jun 21 '11 at 14:22
2

I have written some info about ARM + NEON Assembly code for GCC (including an example NEON function implementation) at http://www.shervinemami.info/armAssembly.html

Shervin Emami
  • 2,695
  • 25
  • 17
1

One thing that is not self explanatory when starting with GAS is the way to define a symbol. The way it works in ARM assembler will not work with GAS.

But in GAS you can just use #define to make a symbol for some register. Such as...

#define MyLoopCounter r0

#define MyLoopInc #32

Such that...

add MyLoopCounter,MyLoopCounter,MyLoopInc

is the same as

add r0,r0,#32

Otherwise I found that almost everything else was the same, and of course the alignment difference as already answered.

Phonon
  • 12,549
  • 13
  • 64
  • 114