>
> #define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5))
>
> This is causing all the FIX_number macros to be cast to 32-bit integers,
> which forces the multiplication to be 32x32.  I don't know what's in the
> MULTIPLY16C16 macro, so maybe it undoes the cast by casting everything to
> INT16's.  If it doesn't then that could lead to __lmul__ call generation.
>
> I'm not sure why a reorder would matter, but having both tmp0 and tmp2 in
> the same scope would increase the virtual register pressure, affecting
code
> generation.  Still, the compiler shouldn't call __lmul__ unless really
needed.
>

The concerned macro is reprinted bellow and it does not perform any
conversion:

#define MULTIPLY16C16(var,const)  ((var) * (const))

I guess the compiler (muls alternative) recognized that both arguments have
short value (despite one of them being casted as long) and used more
efficient procedure.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to