Question:
How to use "log10f_simd" function in CCES
Answer:
The functions with names ending “_simd” are not intended for calling directly from user code. The functions use a modified ABI and therefore it would be corruption of the stack. The functions are instead designed to be exploited automatically by the compiler when it is able to perform the vectorization transformation.
For example:
#include <math.h>
float x[100];
float y[100];
void fn(void) {
int i;
for (i = 0; i < 100; i++)
x[i] = log10f(y[i]);
}
Build this code with -proc ADSP-21584 -O, and look at the loop kernel and there we can see it has automatically used the log10f_simd function:
lcntr=50, do (pc,.P35L2_end) until lce;
.P35L2:
r4=dm(i3,2);
nop;
call (pc,log10f_simd.);
// -- 2 stalls --
dm(i5,2)=r0;
nop;
.P35L2_end:
nop;