Automotive Math library function execution time

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Automotive Math library function execution time

1,035件の閲覧回数
pratibhasurabhi
Contributor V

Dear Team,

I want to know the execution time of math library function(MUL,Div etc.) as compare to normal multiplication, division operation. Is the MLIB library execution time is less than normal math operation?

I have observed that MLIB_Div function takes more execution time than normal division. Is it correct?

I want to know that what are the advantages if I use the library function(MUL,Div) instead of normal operation.

Thank You in advance.

 

0 件の賞賛
返信
1 返信

1,014件の閲覧回数
petrz_
NXP Employee
NXP Employee

Hi Pratibhasurabhi,

AMMCLib fixed-point functions calculate in saturated fractional arithmetic whereas the standard C language multiplications and divisions are calculated in integer modulo arithmetic. The result of an integer multiplication can overflow which causes loss of the most significant bits. On the other hand, the fractional multiplication loses only the least significant bits of the result (i.e. rounding error) and the additional saturation operation ensures that the result never overflows. While modulo arithmetic may be faster, it is not really usable in motor control and DSP applications because overflows can cause catastrophic failure leading to a possible physical damage or safety risk. Such risk can be eliminated by using the saturated fractional arithmetic instead. MLIB functions are highly optimized and take full advantage of the capabilities of the core (e.g. hardware QMULS instruction).