<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 9, 2016 at 11:00 AM, Thaddy de Koning <span dir="ltr"><<a href="mailto:thaddy@thaddy.co.uk" target="_blank">thaddy@thaddy.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">With the proper optimizations it will probably hard to improve on.<br>
Compile the code with -O4 and -s. That generates the assembler output in a<br>
*.s file.<br>
The compiler is rather good at bitmaniputations.<br></blockquote><div><br><br>I am not sure the FreePascal compiler is able to convert the code of the procedure BitsetSet(var Bits; Index: UInt32);<br> PUInt64Array(@Bits)^[Index shr 6] := PUInt64Array(@Bits)^[Index shr 6] or (Int64(1) shl (Index and 63));<br><br>into a single instruction:<br><br> bts [eax], edx<br><br><br></div></div></div></div>