I know that Keil has spent lots of time optimizing the floating point routine, but we are hitting a performance wall in our application and we are looking for anything that will keep us in the current platform. My question has to do with trying to shave time off of a square root operation. We would be content with 4 decimal places of precision for our calculations, so is there any way to get that operation to cut short and just return the lower precision that we need.?
could you use fixed-point instead?
The standard library provides only one version of sqrt. It should be optimized for general case. If you can put up with less precision or use a simpler format for the result (say, fixed point,) then you can accelerate the calculation. The way to do that is to write your own routine for that in assembly language. Use your favourite search engine to find implementations of square root, like this one: http://www.azillionmonkeys.com/qed/sqroot.html Best luck! - Mike
The Triscend E5 has a "hardware" square-root module! Up to 32 bits, but not floating point.
Thanks for the suggestions, I will try the fixed point and see how fast I can get it. What I am really trying to do is get the hypotenuse ( = sqrt( a*a + b*b)) of two vectors. I guess a tangent lookup table might be a faster way to go. Anyone ever tried that?