I. test environment:
1. The CPU clock speed is 1 GHz. To test the vfp3 command, set the bit30 of fpexc to 1;
2. The operating system uses wince6r3
3. the compiler uses three types: vs2005, vs2008, and wec7.
Ii. Test code:
//--------------------------------------double FloatingPointArithmeticOne (DWORD i){int j;double a[256];a[0] = rand();a[1] = (i%256)+2;a[2] = a[0] + a[1];a[3] = a[2] / a[1];a[4] = a[3] - a[1];a[5] = a[4] * a[1];for (j = 0; j < 7; j++) {a[7] += a[j];}return a[7];}//--------------------------------------DWORD FloatingPointArithmetic (){DWORD dwTick;DWORD dwNow;DWORD i;DWORD j;double a = 0;dwTick = GetTickCount ();for (i = 0;; i++) {for (j = 0; j < 1000; j++) {a += FloatingPointArithmeticOne (j);}dwNow = GetTickCount ();if (dwNow - dwTick >= 1000)break;}return i;}int _tmain(int argc, _TCHAR* argv[]){DWORD ts = FloatingPointArithmetic();printf("FloatingPointArithmetic: ts = %d\n", ts);return 0;}
Iii. Test Results
1. program compiled by vs2005: use IDA to view the program. The floating point operation called by the generated code is a function in coredll, that is, pure software simulation. The ts value is 270 (times)
2. programs compiled by vs2008 and wec7: use IDA to check that the generated code calls all VFP hardware commands. However, wec7 optimizes fewer commands, the former ts is 1546 (times), and the latter is 1771 (times)
4. Others
1. Ida needs to use version 6.1, and the ARM architecture needs to be set to ARMv7-A & R, in order to correctly translate vfp3/neon instructions
2. You can use the wec7 compiler to compile by specifying the vs2008 execution program priority path, and then specify the compilation parameter "/qrarch7/qrfpe-/arch: VFPv3-D32" for compilation optimization.
3. For Assembly files, if vfp3 or neon commands are not recognized by vs2008 compilers, wec7 compilers can only be used for compilation; or pseudo commands DCD