This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我想请教一下,使用定点型DSP,如果操作数都是整型的,这种情况下,使用普通乘法“ * ”、除法“ / ”和使用_IQNmpy、_IQNdiv哪个执行时间更短,效率更高?
本人测试了一下,发现使用IQmath的执行时间要比相应的普通乘法“ * ”、除法“ / ”的执行时间长的多,我的测试代码如下:
long w,x,y,z;
GpioDataRegs.GPBSET.bit.GPIO32 = 1;
w=_IQ12div(_IQ12(100),_IQ12(9));
x=_IQ12mpy(_IQ12(100),_IQ12(9));
GpioDataRegs.GPBCLEAR.bit.GPIO32 = 1;
GpioDataRegs.GPBSET.bit.GPIO33 = 1;
y=100 / 9;
z=100 * 9;
GpioDataRegs.GPBCLEAR.bit.GPIO33 = 1;
然后,使用示波器观察GPIO32和GPIO33的高电平的时间,结果显示使用IQmath的执行时间要长的多,那么请问,IQmath在什么情况下,才会相对于普通算法而提高效率?(当然了,使用IQmath的结果精度要高)
通道1测试GPIO32,通道2测试GPIO33
谢谢