In the previous article, <use wec7's neon internal function>, it discussed the possibility of using wec7's neon internal function for code optimization. This article describes how neon commands improve the efficiency of triangles, logarithm, and exponential functions.
I. Test Platform
1. CPU: Cortex-A8 1 GHz
2. OS: wince6r3
3. complier: 1. vs2005 2. wec7
2. Test code Link
1. http://gruntthepeon.free.fr/ssemath/neon_mathfun.html
2. http://blog.csdn.net/zht9961020/article/details/7232924
Iii. Test Results
sin .. -> 0.0 millions of vector evaluations/second -> 9900 cycles/valuecos .. -> 0.0 millions of vector evaluations/second -> 10750 cycles/valueexp .. -> 0.0 millions of vector evaluations/second -> 8300 cycles/valuelog .. -> 0.0 millions of vector evaluations/second -> 9075 cycles/valuecephes_sinf .. -> 0.5 millions of vector evaluations/second -> 457 cycles/valuecephes_cosf .. -> 0.4 millions of vector evaluations/second -> 503 cycles/valuecephes_expf .. -> 0.1 millions of vector evaluations/second -> 1835 cycles/valuecephes_logf .. -> 0.2 millions of vector evaluations/second -> 950 cycles/valuesin_ps .. -> 3.4 millions of vector evaluations/second -> 73 cycles/valuecos_ps .. -> 3.3 millions of vector evaluations/second -> 74 cycles/valuesincos_ps .. -> 3.5 millions of vector evaluations/second -> 70 cycles/valueexp_ps .. -> 7.2 millions of vector evaluations/second -> 35 cycles/valuelog_ps .. -> 5.8 millions of vector evaluations/second -> 43 cycles/valuemy_sin .. -> 0.5 millions of vector evaluations/second -> 431 cycles/valuemy_cos .. -> 0.4 millions of vector evaluations/second -> 590 cycles/value
Iv. Analysis
1. 1 ~ 4 is to use the system library function, 5 ~ 8 is another library used, 9 ~ 13 was optimized using Neon. These test branches all come from the first test code link.
2. 14 ~ 15 is another library used, from the second test code Link
From the results, neon optimization has obvious advantages.