0
votes

I'm writing an application for NEON. Where can I find the NEON ARM intrinsics in C/C++? I want to be able to decode my code running the application on a PC.

1
stackoverflow.com/tags/neon/info has a couple links. (I have no idea what you mean by I want to be able to decode my code running the application on a PC, though. Code using NEON intrinsics can only be compiled for ARM or AArch64, so you'll need to run your code in an emulator on a PC. And "decode my code" doesn't mean anything to me, I really don't know what you mean.)Peter Cordes
Thanks Peter, and sorry if I was not clear. I would like to have the equivalent of the intrinsics written in C, for example: int16x4_t vadd_s16(int16x4_t a, int16x4_t b) { int16x4_t c; for (int i = 0; i < 4; i++) { c[i] = a[i] + b[i]; } return c; }Joe Raoul
For vadd_s16, see github.com/nemequ/simde/blob/master/simde/arm/neon/… . I'm not making in an answer because I've barely started working on NEON… The best you're going to do is probably developer.arm.com/technologies/neon/intrinsicsnemequ
Thanks nemequ for the second link, it's usefull to really understand in details each intrinsicJoe Raoul

1 Answers

0
votes

You can effectively simulate NEON intrinsics on PC using this header file: NEONvsSSE.h

In my experience it has close to 100% Arm/PC compatibility

In your solution it is possible to use definition like following to distinguish between Arm/PC versions:

#if !defined PC_VER
#include <arm_neon.h>
#else
#include "NEONvsSSE.h"
#endif