Compiler makes code under performance option. Memory is SRAM. Arrays were allocated by "new" operator. Measurements were made by system timer and factored to nanoseconds.
Do you have any idea what's wrong? Did you conduct similar tests but got faster results?
Code: Select all
float* x = matrixTest+1;
float* y = matrixTest+1+10000;
int i;
for( i = 0; i < 10000; i++ )
{
if( ! x[i] ) break; // 130 ns
if( y[0] == x[i] ) break; // 129 ns
if( y[i] == x[i] ) break; // 133 ns
if( x[i]+y[i] < 0. ) break; // 370 ns
if( y[i]-x[i] < 0. ) break; // 445 ns
if( y[i]*x[i] < 0. ) break; // 409 ns
if( y[i]/x[i] < 0. ) break; // 1381 ns
}
printf("i=%d\n",i);
Thanks