At 09:08 2003-2-3 +0200, you wrote:
Dan, I thought I'd replied on this subject before, but it might have just been in private email.To avoid the generation of 32 bit multiplies in release, I must change from optimisations level 4 to optimisations level 1. But there is another issue that seems not to change even after. I use an array with a 16 bit index, like:unsigned short n; for(n=0;n<NumNames;n++) //do something with ObjectNames[n] The generated code is calling the same __lmul__ routine in release, and in debug it's working correctly. What can be the cause? Should I turn off the optimisations because of this? I have these portions of code in time critical loops and they need to be fast.
I don't have any good answers for you. I've written on this topic at http://www.palmoswerks.com/2002/05/10, where I mention using 16-bit indices. You seem to be doing that, so I expect there is a problem with the IR optimizer doing promotion of the expression. Does this still occur at optimization level 2 and 3?
One quick thing you might be able to do to improve performance is to look at the size of your ObjectNames structure. If it was a power-of-two, the array address calculation could be done using shifts, which would be faster still.
If you need detailed support on issues like this in the future, I suggest you take out an incident with the Metrowerks tech support group. This will both ensure that we can track the issue and will guarantee you analysis by a Metrowerks engineer. Posting questions to a high-noise forum like this means they can be easily lost, and while I try to handle things, its really easy for me to miss a question.
--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
