Hi:
I need to port this code for TI 5.2.3 c compiler, the inline assembler code is made for another compiler and I have no previous experience using assembler. It is to speed up some instructions in my c code. Someone can point me to an example to convert these simple assembler instructions to TI compiler syntax?:
//-----------------------------------------------------------------------------------------
static __inline int CLZ(int x)
{
int numZeros;
__asm__ ("clz %0, %1" : "=r" (numZeros) : "r" (x) : "cc");
return numZeros;
}
//-----------------------------------------------------------------------------------------
typedef union _U64 {
Word64 w64;
struct {
// ARM ADS = little endian
unsigned int lo32;
signed int hi32;
} r;
} U64;
static __inline Word64 MADD64(Word64 sum64, int x, int y)
{
U64 u;
u.w64 = sum64;
__asm__ volatile ("smlal %0,%1,%2,%3" : "+&r" (u.r.lo32), "+&r" (u.r.hi32) : "r" (x), "r" (y) : "cc");
return u.w64;
}
//--------------------------------------------------------------------------------------------
static __inline__ int MULSHIFT32(int x, int y)
{
int zlow;
__asm__ volatile ("smull %0,%1,%2,%3" : "=&r" (zlow), "=r" (y) : "r" (x), "1" (y) : "cc");
return y;
}
//-----------------------------------------------------------------------------------------
Jose.