Stack Exchange
SIMD instructions on Raspberry pi 3
I'm trying to code a simple Vector add program but I'm having trouble finding the right instructions to run on RP3 which has a Cortex-A53 processor.
I tried using:
VADD.I8 D0, D1, D2

to add 8 8bit numbers in D1 and D2 in parallel but I get this error:
make all 
Building file: ../src/ASM.c
Invoking: Cross GCC Compiler
arm-linux-gnueabihf-gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/ASM.d" -MT"src/ASM.o" -o "src/ASM.o" "../src/ASM.c"
/tmp/ccx9brV4.s: Assembler messages:
/tmp/ccx9brV4.s:43: Error: selected FPU does not support instruction -- `vadd.i8 D0,D1,D2'
src/subdir.mk:18: recipe for target 'src/ASM.o' failed
make: * [src/ASM.o] Error 1

I don't understand why it says unsupported instruction I got the instruction from the cortex a series programmer's guide
This is the C code with the Assembly instructions inside
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
extern void asm(void);

void asm(void){
  _asm_( /* Assembly function body */
          "MOVW R0,0x1234\n"//AH
          "MOVT R0,0x5678\n"
          "MOVW R1,0x2312\n"//AL
          "MOVT R1,0x3548\n"
          "VADD.I8 D0,D1,D2"
          );
}

int main(void) {
    asm();
    return 1;

}


-mfpu=neon or -mfpu=neon-vfpv4.

@EOF please add that as an answer

BTW if you want to write an entire function in assembler, better to write it as a separate .s file, this avoids any concern about clobbering registers that the 'C' compiler might be using (e.g. if it decided to inline your function).

@EOF thanks, this worked for me after I changed VADD.I8 DO, D1, D2 to UADD R2,R1,R0
