<p>Am 19.01.2014 22:50 schrieb "Nikolay Nikolov" <<a href="mailto:nickysn@users.sourceforge.net">nickysn@users.sourceforge.net</a>>:<br>
><br>
> On 01/19/2014 10:45 PM, Sven Barth wrote:<br>
>>> Can the compiler optimise this operation choosing the fastest one -<br>
>>> probably depending on the architecture x86, arm, aso.<br>
>><br>
>><br>
>> 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...<br>

><br>
> Integer multiplication by a power of 2 constant is converted to a SHL in pass 1, see nadd.pas:2869.</p>
<p>Ah, there it is. Thanks. I must have been too tired already when I looked through the code ^^</p>
<p>Regards,<br>
Sven</p>