Cortex-a8 vfp3 command execution speed

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.