cancel
Showing results for 
Search instead for 
Did you mean: 

Does GNU ARM GCC not support the 'old' DSP intrinsics like __qadd ? I can't find a header which supports this. Are you expected to using CMIS or write your own ASM macro or am I missing something

CParr.1
Associate II
 
5 REPLIES 5
KnarfB
Principal III

#include <arm_neon.h> vqadd_* ?

CParr.1
Associate II

That's for the neon unit, not supported by M series. I'm talking about the qadd 'like' instructions as supported by M4/M7 etc

As i recall those were ARM RealView intrinsics

STM32F4xx_DSP_StdPeriph_Lib_V1.8.0\Libraries\CMSIS\Include\core_cmSimd.h

Later mapped with defines, the wrong way round for your case, but

#define __SMLSLDX             __smlsldx

#define __SEL               __sel

#define __QADD              __qadd

#define __QSUB              __qsub

With GNU/GCC doing this

__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD(uint32_t op1, uint32_t op2)

{

 uint32_t result;

 __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );

 return(result);

}

__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB(uint32_t op1, uint32_t op2)

{

 uint32_t result;

 __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) );

 return(result);

}

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
CParr.1
Associate II

OK so you have to add this yourself and its not supported directly by the GNU gcc used in STMCubdeIDE, thanks for the confirmation

Depending on the source/age you could create a similar #define translation, doing the reverse, or do a search-n-replace on the source as it is ported to the CMSIS formats.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..