Netjob 发表于 2009-3-30 13:44 DSP 技术 ←返回版面 <br /><br />120楼: STM32 PK TMS320F28XX 测试报告:<br /><br />测试程序:<br /><br />#define PI 3.14159326<br />。。。。<br />。。。。<br />看看每个函数使用的CPU CYCLES数量是多少?<br /><br />CORTEX-M3: IAR编译器 器件STM32F10X<br /><br />temp=sin(3/PI); //次函数 *** 使用了 1300 cpu cycles<br />temp=sqrt(3/PI); //次函数 *** 使用了 2269 cpu cycles<br />temp=abs(3/PI); //次函数 *** 使用了 20 cpu cycles<br />temp=atan2(3.0,PI); //次函数 *** 使用了 2778 cpu cycles<br /><br />TI TMS320FC28X CCS3.3<br /><br />temp=sin(3/PI); //次函数 *** 使用了 1939 cpu cycles<br />temp=sqrt(3/PI); //次函数 *** 使用了 3365 cpu cycles<br />temp=abs(3/PI); //次函数 *** 使用了 2 cpu cycles<br />temp=atan2(3.0,PI); //次函数 *** 使用了 2679 cpu cycles<br />//-----------------------------------------------------------<br />temp=sqrt(3/PI); //用一般通用指令整数开方少于80个时钟。<br />temp=abs(3/PI); //用得较多的速度落差很明显。<br />
|