Am 19.01.2014 22:50 schrieb "Nikolay Nikolov" <nick...@users.sourceforge.net >: > > On 01/19/2014 10:45 PM, Sven Barth wrote: >>> Can the compiler optimise this operation choosing the fastest one - >>> probably depending on the architecture x86, arm, aso. >> >> >> It can if someone codes support for it (maybe some code generators already have such simplifications). I thought I've at least seen such code for integers (that exactly converts *2 to a shl), but I can't find it currently... > > Integer multiplication by a power of 2 constant is converted to a SHL in pass 1, see nadd.pas:2869.
Ah, there it is. Thanks. I must have been too tired already when I looked through the code ^^ Regards, Sven
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal