The return type is int or unsigned int, whatever. This is not a really
full snippet, as this function does some additions too, but that's not
important. This is in fact an inline function. Currently I've implemented it
in assembler and it seems to be working. But I finally wonder, how many
percents is my speed scaled down because of these code generations. The
immediate solution I see is replacing critical code portions with assembler.

Dan

    PS: I use CW 8.3. Is the V9 compiler generating right code in these
situations?

"Ben Combee" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> At 15:58 2003-3-20 +0200, you wrote:
> >     I am very sorry to affirm this, but the CW compiler is totally
> >out-of-situation sometimes. I really multiply 2 WORD values and it is
> >generating __lmul__ jumps for that purpose :( I also turned off common
> >subexpression elimination but no help. I don't really know how to replace
> >this lines with something to work:
> >
> >int nRoundScale;    //this is always less than 65536
> >int nDifference;       //any value
> >WORD nLow=(WORD)nDifference;
> >return ((WORD)nRoundScale)*nLow;
> >
> >     Anybody having some suggestions, other than replacing the current
> >compiler with GCC? :)
>
> Try reducing your optimization level to 2.  I think there is a current bug
> at the IR optimizer level where it is promoting 16-bit multiplies to
longer
> types.
>
> In this code snippet, what is the type being returned?  I'd like to setup
a
> reproducable case that I can use to track down this problem better.
>
> --
> 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/

Reply via email to