Tool/software: TI C/C++ Compiler
Is there a recommended way to memcpy in C in the CLA? Setting a struct equal generates a slow loop:
struct S { float a,b,c } s1, s2; s1 = s2;
generates a loop with many MNOPs and for some reason chooses 16 bit movs.
C$L5: 000093da: 75A20001 MMOVZ16 MR2, *MAR1++ 000093dc: 7CE00010 MSUB32 MR0, MR0, MR1 000093de: 7FA00000 MNOP 000093e0: 7FA00000 MNOP 000093e2: 75E10001 MMOV16 *MAR0++, MR2 000093e4: 7980FFF6 MBCNDD 0xfff6, NEQ 000093e6: 7FA00000 MNOP 000093e8: 7FA00000 MNOP 000093ea: 7FA00000 MNOP
An unrolled array:
float a[3], b[3]; #pragma MUST_ITERATE(3) #pragma UNROLL(3) for (i = 0; i < 3; i++) { a[i] = b[i]; }
works pretty well but seems kind of non standard. Is there a recommended library or anything that does an efficient memcpy?