[fpc-pascal] Optimisation : X+X or 2*X or X*2 ?

Michael Schnell mschnell at lumino.de
Mon Jan 20 10:47:48 CET 2014


On 01/19/2014 09:45 PM, Sven Barth wrote:
>
> Can't really comment on floats, but for integers the fasted to 
> multiply by 2 should be a shift left.
GCC automatically optimizes this. With the small "embedded" CPUs I 
usually use, it even converts more most multiplications and divisions 
with constants to a series of adds and shiftts.

-Michael



More information about the fpc-pascal mailing list