<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"  xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:access="http://www.bloglines.com/about/specs/fac-1.0">
  <access:restriction relationship="allow" />
  <channel>
    <title>Wikispaces : chessprogramming - items matching description</title>
    <link>https://chessprogramming.wikispaces.com/space/view</link>
    <description>Filtered items at Wikispaces : chessprogramming</description>
    
    <webMaster>help@wikispaces.com (Wikispaces)</webMaster>
    <generator>https://www.wikispaces.com/</generator>
    <ttl>60</ttl>
    <atom:link href="https://chessprogramming.wikispaces.com/space/xmlo?v=rss_2_0" rel="self" type="application/rss+xml" />
    <image>
      <title>Wikispaces : chessprogramming - items matching description</title>
      <url>https://www.wikispaces.com/i/l.png</url>
      <link>https://chessprogramming.wikispaces.com/space/view</link>
      <width>140</width>
      <height>48</height>
      <description>Wikispaces</description>
    </image>

    <item>
      <title>AVX</title>
      <link>https://chessprogramming.wikispaces.com/AVX</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/AVX</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/AVX</comments>
      <pubDate>Tue, 07 Mar 2017 20:14:51 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:21:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextTocRule:22: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Advantages of AVX&quot;&gt;Advantages of AVX&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;!-- ws:start:WikiTextTocRule:23: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#AVX on non-Intel CPUs&quot;&gt;AVX on non-Intel CPUs&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Mixing AVX and SSE&quot;&gt;Mixing AVX and SSE&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#AVX2&quot;&gt;AVX2&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Manuals&quot;&gt;Manuals&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; * AVX&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Advanced Vector Extensions&lt;/strong&gt; (AVX) is a 256 bit extension to the &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE&quot;&gt;SSE&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE3&quot;&gt;SSE3&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3&quot;&gt;SSSE3&lt;/a&gt;, and &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4&quot;&gt;SSE4&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD&lt;/a&gt; instruction sets, announced by &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; in March 2008, and first released in January, 2011 with Intel&#039;s &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Sandy_Bridge_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Sandy Bridge&lt;/a&gt; architecture. With the  &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bulldozer_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Bulldozer microarchitecture&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt; is also available on &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; processors &lt;!-- ws:start:WikiTextRefRule:1:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://support.amd.com/us/Processor_TechDocs/26568_APM_v4.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AMD64 Architecture, Programmer’s Manual, Volume 4 128-Bit and 256-Bit Media Instructions&amp;lt;/a&amp;gt; (pdf)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:1 --&gt;, along with their own &lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt; extension on Bulldozer only.&lt;br /&gt;
&lt;br /&gt;
AVX supports 256-bit wide SIMD registers (YMM0-YMM7 in operating modes that are 32-bit or less, YMM0-YMM15 in 64-bit mode) to keep floating point &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;vectors&lt;/a&gt; of either 8 &lt;a class=&quot;wiki_link&quot; href=&quot;/Float&quot;&gt;floats&lt;/a&gt; or 4 &lt;a class=&quot;wiki_link&quot; href=&quot;/Double&quot;&gt;doubles&lt;/a&gt; inside one register. The lower 128 bits of the YMM registers are aliased to the respective 128-bit XMM registers. AVX employs an instruction encoding scheme using a new &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/VEX_prefix&quot; rel=&quot;nofollow&quot;&gt;VEX prefix&lt;/a&gt;, allowing a three-operand SIMD instruction format, where the destination register is distinct from the two source operands.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:3:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Advantages of AVX&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:3 --&gt;Advantages of AVX&lt;/h1&gt;
 AVX introduces expanded 256-bit versions of floating point instructions, which are typically not useful for chess programming. Though it does not yet expand the integer instructions to 256-bit, AVX does provide VEX-encoded versions of existing SSE 128-bit instructions. For instance, bitwise logical and:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;Set&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Instruction&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Operation&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;SSE2&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;strong&gt;pand&lt;/strong&gt; xmm1, xmm2/m128&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;xmm1 := xmm1 &amp;amp; xmm2&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;AVX&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;strong&gt;vpand&lt;/strong&gt; xmm1, xmm2, xmm3/m128&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;xmm1 := xmm2 &amp;amp; xmm3&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
Though AVX does not yet support 256-bit integer operations, there are some benefits to using it. 3-operand support can be used to eliminate many &amp;quot;move&amp;quot; instructions, which otherwise can take up significant execution resources.&lt;br /&gt;
&lt;br /&gt;
Additionally, when using xmm registers numbered 8 and higher, the AVX encoding of an SSE instruction is often one byte smaller, due to the more compact nature of the VEX encoding scheme. Finally, the ymm registers offer double the register space: even if the top halves aren&#039;t used for computation, they might be suitable as temporary storage space, avoiding the use of a scratch buffer or the stack.&lt;br /&gt;
&lt;br /&gt;
While AVX can do 32-byte loads and stores, no CPU (as of Sandy Bridge) actually has a 32-byte load or store unit; such loads and stores are done simply by doing two separate 16-byte memory operations internally. Thus, AVX is no faster for memory operations (yet).&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;AVX on non-Intel CPUs&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;AVX on non-Intel CPUs&lt;/h1&gt;
 AMD&#039;s &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bulldozer_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Bulldozer&lt;/a&gt; does not benefit from 3-operand in the same way that Intel&#039;s AVX-supporting CPU, Sandy Bridge, does. Bulldozer has a &amp;quot;move elimination&amp;quot; feature that resolves SIMD move instructions separately from the main execution pipeline. On Bulldozer, 3-operand support can still help reduce code size and reduce dispatch bottlenecks, but usually does not help performance much.&lt;br /&gt;
&lt;br /&gt;
Additionally, Bulldozer only has a 128-bit floating-point execution unit, so 256-bit floating point operations are no faster than 128-bit ones, and sometimes actually slower. Nevertheless, some functions might still benefit from the extra register space.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Mixing AVX and SSE&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;Mixing AVX and SSE&lt;/h1&gt;
 Besides 3-operand support, the primary difference between the AVX and SSE encodings of an SSE instruction is that the AVX version clears the unused portion of the ymm register (the top 128 bits), while the SSE version does not modify it. Intel strongly advises against mixing SSE 128-bit instructions and AVX 256-bit instructions, as this &amp;quot;mode-switching&amp;quot; can cost upwards of 70 clock cycles. However, mixing SSE 128-bit and AVX 128-bit is okay, as is mixing AVX 128-bit and AVX 256-bit.&lt;br /&gt;
&lt;br /&gt;
In order to safely switch modes, Intel recommends using &lt;strong&gt;vzeroupper&lt;/strong&gt; after using 256-bit AVX instructions and before using 128-bit SSE instructions, if the two are being used in the same program.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;AVX2&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;AVX2&lt;/h1&gt;
 &lt;em&gt;see main article &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AltiVec&quot;&gt;AltiVec&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2&quot;&gt;BMI2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/MMX&quot;&gt;MMX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE&quot;&gt;SSE&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE3&quot;&gt;SSE3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3&quot;&gt;SSSE3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4&quot;&gt;SSE4&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Manuals&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;Manuals&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/file/36945&quot; rel=&quot;nofollow&quot;&gt;Intel AVX and AVX2 Programming Reference&lt;/a&gt; (pdf)&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/26568_APM_v4.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD64 Architecture, Programmer’s Manual, Volume 4 128-Bit and 256-Bit Media Instructions&lt;/a&gt; (pdf)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Advanced_Vector_Extensions&quot; rel=&quot;nofollow&quot;&gt;Advanced Vector Extensions from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/VEX_prefix&quot; rel=&quot;nofollow&quot;&gt;VEX prefix From Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/en-us/articles/intel-software-development-emulator/&quot; rel=&quot;nofollow&quot;&gt;Intel Software Development Emulator&lt;/a&gt;, which can be used to experiment with AVX and AVX2 on a CPU that doesn&#039;t support them.&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://devgurus.amd.com/thread/98392&quot; rel=&quot;nofollow&quot;&gt;AMD and Intel incompatible - What to do?&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;AMD Developer Central&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/landingpage/IntrinsicsGuide/&quot; rel=&quot;nofollow&quot;&gt;Intel Intrinsics Guide&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;References&lt;/h1&gt;
&lt;!-- ws:start:WikiTextReferencesRule:198:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/26568_APM_v4.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD64 Architecture, Programmer’s Manual, Volume 4 128-Bit and 256-Bit Media Instructions&lt;/a&gt; (pdf)&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:198 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;AVX&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;AVX&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-AVX includeBody-AVX includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AltiVec&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AltiVec&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AMD&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AMD&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX-512&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX-512&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hyperbola+Quintessence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hyperbola Quintessence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Intel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Intel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shared+Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shared Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 11, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE5&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE5&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/TBM&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;TBM&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 28, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Windows&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Windows&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 2, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/XOP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;XOP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>AVX-512</title>
      <link>https://chessprogramming.wikispaces.com/AVX-512</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/AVX-512</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/AVX-512</comments>
      <pubDate>Tue, 08 Aug 2017 19:56:01 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; * AVX-512&lt;/strong&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextTocRule:55:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:55 --&gt;&lt;!-- ws:start:WikiTextTocRule:56: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Extensions&quot;&gt;Extensions&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:56 --&gt;&lt;!-- ws:start:WikiTextTocRule:57: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Selected Instructions&quot;&gt;Selected Instructions&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:57 --&gt;&lt;!-- ws:start:WikiTextTocRule:58: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Selected Instructions-VPTERNLOG&quot;&gt;VPTERNLOG&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:58 --&gt;&lt;!-- ws:start:WikiTextTocRule:59: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Selected Instructions-VPLZCNT&quot;&gt;VPLZCNT&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:59 --&gt;&lt;!-- ws:start:WikiTextTocRule:60: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Selected Instructions-VPOPCNT&quot;&gt;VPOPCNT&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:60 --&gt;&lt;!-- ws:start:WikiTextTocRule:61: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:61 --&gt;&lt;!-- ws:start:WikiTextTocRule:62: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Manuals&quot;&gt;Manuals&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:62 --&gt;&lt;!-- ws:start:WikiTextTocRule:63: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:63 --&gt;&lt;!-- ws:start:WikiTextTocRule:64: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Blog Postings&quot;&gt;Blog Postings&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:64 --&gt;&lt;!-- ws:start:WikiTextTocRule:65: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Compiler Support&quot;&gt;Compiler Support&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:65 --&gt;&lt;!-- ws:start:WikiTextTocRule:66: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:66 --&gt;&lt;!-- ws:start:WikiTextTocRule:67: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:67 --&gt;&lt;!-- ws:start:WikiTextTocRule:68: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:68 --&gt;&lt;strong&gt;AVX-512&lt;/strong&gt;,&lt;br /&gt;
an expansion of &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&#039;s&lt;/a&gt; the &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt; instructions using the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/EVEX_prefix&quot; rel=&quot;nofollow&quot;&gt;EVEX prefix&lt;/a&gt;, featuring &lt;strong&gt;32&lt;/strong&gt; 512-bit wide vector &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD&lt;/a&gt; registers zmm0 through zmm31, keeping either eight &lt;a class=&quot;wiki_link&quot; href=&quot;/Double&quot;&gt;doubles&lt;/a&gt; or integer &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;quad words&lt;/a&gt; such as &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboards&lt;/a&gt;, and eight (seven) dedicated mask registers which specify which vector elements are operated on and written. If the Nth bit of a vector mask register is set, then the Nth element of the destination vector is overridden with the result of the operation; otherwise, dependent of the instruction, the element is zeroed, or overridden by an element from another source register (remains unchanged if same source). A vector mask register can be set using vector compare instructions, instructions to move contents from a GP register, or a special subset of vector mask arithmetic instructions.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:31:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Extensions&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:31 --&gt;Extensions&lt;/h1&gt;
 AVX-512 consists of multiple extensions not all meant to be supported by all AVX-512 capable processors. Only the core extension AVX-512F (AVX-512 Foundation) is required by all implementations &lt;!-- ws:start:WikiTextRefRule:3:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/AVX-512&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AVX-512 from Wikipedia&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:3 --&gt; AVX-512F and AVX-512CD were first implemented in the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Xeon_Phi&quot; rel=&quot;nofollow&quot;&gt;Xeon Phi&lt;/a&gt; processor and coprocessor known by the code name &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Xeon_Phi#Knights_Landing&quot; rel=&quot;nofollow&quot;&gt;Knights Landing&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:6:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://software.intel.com/en-us/blogs/additional-avx-512-instructions&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Additional AVX-512 instructions | Intel® Developer Zone&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://software.intel.com/en-us/user/335550&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;James Reinders&amp;lt;/a&amp;gt;, July 17, 2014&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:6 --&gt; , launched on June 20, 2016.&lt;br /&gt;
&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;Extension&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Description&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Architecture&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/CPUID#EAX.3D7.2C_ECX.3D0:_Extended_Features&quot; rel=&quot;nofollow&quot;&gt;CPUID 7&lt;/a&gt;&lt;br /&gt;
Reg:Bit &lt;!-- ws:start:WikiTextRefRule:9:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://www.heise.de/ct/zcontent/17/16-hocmsmeta/1501873687265857/ct.1617.016-017.qxp_table_29578.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AVX512 table&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Heinz_Heise&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Heise&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:9 --&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512F&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;Foundation&lt;br /&gt;
&lt;/td&gt;
        &lt;td rowspan=&quot;4&quot;&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Xeon_Phi#Knights_Landing&quot; rel=&quot;nofollow&quot;&gt;Knights Landing&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;EBX:16&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512CD&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;Conflict Detection Instructions&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;EBX:28&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512ER&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;Exponential and Reciprocal Instructions&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;EBX:27&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512PF&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;Prefetch Instructions&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;EBX:26&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512BW&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;Byte&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;Word&lt;/a&gt; Instructions&lt;br /&gt;
&lt;/td&gt;
        &lt;td rowspan=&quot;3&quot;&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Skylake_(microarchitecture)&quot; rel=&quot;nofollow&quot;&gt;Skylake X&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;EBX:30&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512DQ&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;Doubleword&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;Quadword&lt;/a&gt; Instructions&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;EBX:17&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512VL&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;Vector Length Extensions&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;EBX:31&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512IFMA&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;Integer Fused Multiply Add&lt;br /&gt;
&lt;/td&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Cannonlake&quot; rel=&quot;nofollow&quot;&gt;Cannonlake&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;EBX:21&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512VBMI&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;Vector Byte Manipulation Instructions&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;ECX:01&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512VPOPCNTDQ&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;Vector &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;Population Count&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td rowspan=&quot;3&quot;&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Xeon_Phi#Knights_Mill&quot; rel=&quot;nofollow&quot;&gt;Knights Mill&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;ECX:14&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512-4VNNIW&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;Vector &lt;a class=&quot;wiki_link&quot; href=&quot;/Neural%20Networks&quot;&gt;Neural Network&lt;/a&gt; Instructions&lt;br /&gt;
Word variable precision&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;EDX:02&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;AVX-512-4FMAPS&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;Fused Multiply Accumulation&lt;br /&gt;
Packed Single precision&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;EDX:03&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:33:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Selected Instructions&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:33 --&gt;Selected Instructions&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:35:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Selected Instructions-VPTERNLOG&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:35 --&gt;VPTERNLOG&lt;!-- ws:start:WikiTextAnchorRule:69:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@VPTERNLOG&amp;quot; title=&amp;quot;Anchor: VPTERNLOG&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;VPTERNLOG&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:69 --&gt;&lt;/h2&gt;
 AVX-512F features the instruction VPTERNLOGQ (or VPTERNLOGD) to perform bitwise &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Ternary_operation&quot; rel=&quot;nofollow&quot;&gt;ternary logic&lt;/a&gt;, for instance to &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations&quot;&gt;operate&lt;/a&gt; on vectors of &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboards&lt;/a&gt;. Three input vectors are bitwise &lt;a class=&quot;wiki_link&quot; href=&quot;/Combinatorial%20Logic&quot;&gt;combined&lt;/a&gt; by an operation determined by an immediate byte operand (&lt;strong&gt;imm8&lt;/strong&gt;), whose 256 possible values corresponds with the boolean output vector of the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Truth_table&quot; rel=&quot;nofollow&quot;&gt;truth table&lt;/a&gt; for all eight combinations of the three input bits, as demonstrated with some selected imm8 values in the table below &lt;!-- ws:start:WikiTextRefRule:12:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://0x80.pl/articles/avx512-ternary-functions.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AVX512: ternary functions evaluation&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Wojciech%20Mu%C5%82a&amp;quot;&amp;gt;Wojciech Muła&amp;lt;/a&amp;gt;, March 03, 2015&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:12 --&gt; &lt;!-- ws:start:WikiTextRefRule:14:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Intel® Architecture Instruction Set Extensions Programming Reference&amp;lt;/a&amp;gt; (pdf) 5.3 TERNARY BIT VECTOR LOGIC TABLE&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:14 --&gt; :&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th colspan=&quot;4&quot;&gt;Input&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th colspan=&quot;22&quot;&gt;Output of Operations&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;imm8&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0x00&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0x01&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0x16&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0x17&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0x28&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0x80&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0x88&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0x96&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0xca&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0xe8&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0xfe&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0xff&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;#&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;a&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;b&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;c&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;C-exp&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;false&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;~(a|b|c)&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;a?~(b|c):b^c&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;minor(a,b,c)&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;c&amp;amp;(a^b)&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;a&amp;amp;b&amp;amp;c&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;b&amp;amp;c&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;a^b^c&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;a?b:c&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Majority&quot;&gt;major&lt;/a&gt;(a,b,c)&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;a|b|c&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;true&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;0&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;1&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;2&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;3&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;4&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;5&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;6&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th&gt;7&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

Following VPTERNLOGQ intrinsics are declared, where the maskz version sets unmasked destination quad word elements to zero, while the mask version copies unmasked elements from s:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;__m512i _mm512_ternarylogic_epi64(__m512i a, __m512i b, __m512i c, int imm8);&amp;lt;br/&amp;gt;__m512i _mm512_maskz_ternarylogic_epi64( __mmask8 m, __m512i a, __m512i b, __m512i c, int imm8);&amp;lt;br/&amp;gt;__m512i _mm512_mask_ternarylogic_epi64(__m512i s, __mmask8 m, __m512i a, __m512i b, __m512i c, int imm8);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;__m512i _mm512_ternarylogic_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m512i a, __m512i b, __m512i c, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; imm8&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
__m512i _mm512_maskz_ternarylogic_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; __mmask8 m, __m512i a, __m512i b, __m512i c, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; imm8&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
__m512i _mm512_mask_ternarylogic_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m512i s, __mmask8 m, __m512i a, __m512i b, __m512i c, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; imm8&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:70:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@VPLZCNT&amp;quot; title=&amp;quot;Anchor: VPLZCNT&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;VPLZCNT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:70 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:37:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Selected Instructions-VPLZCNT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:37 --&gt;VPLZCNT&lt;/h2&gt;
 AVX-512CD has Vector &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#LeadingZeroCount&quot;&gt;Leading Zero Count&lt;/a&gt; - VPLZCNTQ counts leading zeroes on a vector of eight bitboards in parallel &lt;!-- ws:start:WikiTextRefRule:16:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://www.google.com/patents/US9372692&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Patent US9372692 - Methods, apparatus, instructions, and logic to provide permute controls with leading zero count functionality - Google Patent Search&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:16 --&gt; - using following intrinsics &lt;!-- ws:start:WikiTextRefRule:18:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://hjlebbink.github.io/x86doc/html/VPLZCNTD_Q.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;VPLZCNTD/Q—Count the Number of Leading Zero Bits for Packed Dword, Packed Qword Values&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:18 --&gt;, where the maskz version sets unmasked destination elements to zero, while the mask version copies unmasked elements from s:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;__m512i _mm512_lzcnt_epi64(__m512i a);&amp;lt;br/&amp;gt;__m512i _mm512_maskz_lzcnt_epi64(__mmask8 m, __m512i a);&amp;lt;br/&amp;gt;__m512i _mm512_mask_lzcnt_epi64(__m512i s, __mmask8 m, __m512i a);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;__m512i _mm512_lzcnt_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m512i a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
__m512i _mm512_maskz_lzcnt_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__mmask8 m, __m512i a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
__m512i _mm512_mask_lzcnt_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m512i s, __mmask8 m, __m512i a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:71:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@VPOPCNT&amp;quot; title=&amp;quot;Anchor: VPOPCNT&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;VPOPCNT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:71 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:39:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Selected Instructions-VPOPCNT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:39 --&gt;VPOPCNT&lt;/h2&gt;
The future AVX-512VPOPCNTDQ extension has a vector &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;population count&lt;/a&gt; instruction to count one bits of either 16 32-bit double words (VPOPCNTD) or 8 64-bit quad words aka bitboards (VPOPCNTQ) in parallel &lt;!-- ws:start:WikiTextRefRule:20:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://github.com/WojciechMula/sse-popcount/blob/master/popcnt-avx512-harley-seal.cpp&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;sse-popcount/popcnt-avx512-harley-seal.cpp at master · WojciechMula/sse-popcount · GitHub&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-8&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:20 --&gt; &lt;!-- ws:start:WikiTextRefRule:29:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Wojciech%20Mu%C5%82a&amp;quot;&amp;gt;Wojciech Muła&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://dblp.uni-trier.de/pers/hd/k/Kurz:Nathan&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Nathan Kurz&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://github.com/lemire&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Daniel Lemire&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2016&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Faster Population Counts Using AVX2 Instructions&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://arxiv.org/abs/1611.07612&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;arXiv:1611.07612&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-9&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-9&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:29 --&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:41:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:41 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AltiVec&quot;&gt;AltiVec&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:43:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Manuals&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:43 --&gt;Manuals&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf&quot; rel=&quot;nofollow&quot;&gt;Intel® Architecture Instruction Set Extensions Programming Reference&lt;/a&gt; (pdf)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:45:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:45 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AVX-512&quot; rel=&quot;nofollow&quot;&gt;AVX-512 from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.intel.com/content/www/us/en/architecture-and-technology/avx-512-overview.html&quot; rel=&quot;nofollow&quot;&gt;Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Overview&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/intel-isa-extensions&quot; rel=&quot;nofollow&quot;&gt;Intel Instruction Set Architecture Extensions&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:47:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc8&quot;&gt;&lt;a name=&quot;External Links-Blog Postings&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:47 --&gt;Blog Postings&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/blogs/2013/avx-512-instructions&quot; rel=&quot;nofollow&quot;&gt;AVX-512 instructions | Intel® Developer Zone&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/user/335550&quot; rel=&quot;nofollow&quot;&gt;James Reinders&lt;/a&gt;, July 23, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/blog/read.php?i=288&quot; rel=&quot;nofollow&quot;&gt;Future instruction set: AVX-512&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;, October, 09, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/blogs/additional-avx-512-instructions&quot; rel=&quot;nofollow&quot;&gt;Additional AVX-512 instructions | Intel® Developer Zone&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/user/335550&quot; rel=&quot;nofollow&quot;&gt;James Reinders&lt;/a&gt;, July 17, 2014&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/blogs/2014/07/24/processing-arrays-of-bits-with-intel-advanced-vector-extensions-512-intel-avx-512&quot; rel=&quot;nofollow&quot;&gt;Processing Arrays of Bits with Intel® Advanced Vector Extensions 512 (Intel® AVX-512) | Intel® Developer Zone&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/user/123920&quot; rel=&quot;nofollow&quot;&gt;Thomas Willhalm&lt;/a&gt;, July 24, 2014&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.hpcwire.com/2017/06/29/reinders-avx-512-may-hidden-gem-intel-xeon-scalable-processors/&quot; rel=&quot;nofollow&quot;&gt;AVX-512 May Be a Hidden Gem” in Intel Xeon Scalable Processors&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/user/335550&quot; rel=&quot;nofollow&quot;&gt;James Reinders&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.hpcwire.com/&quot; rel=&quot;nofollow&quot;&gt;HPCwire&lt;/a&gt;, June 29, 2017&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:49:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc9&quot;&gt;&lt;a name=&quot;External Links-Compiler Support&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:49 --&gt;Compiler Support&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/sites/landingpage/IntrinsicsGuide/#techs=AVX_512&quot; rel=&quot;nofollow&quot;&gt;Intel Intrinsics Guide - AVX-512&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://gcc.gnu.org/wiki/cauldron2014?action=AttachFile&amp;amp;do=get&amp;amp;target=Cauldron14_AVX-512_Vector_ISA_Kirill_Yukhin_20140711.pdf&quot; rel=&quot;nofollow&quot;&gt;Intel® Advanced Vector Extensions 2015/2016 Support in GNU Compiler Collection&lt;/a&gt; (pdf) by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.linkedin.com/in/kirill-yukhin-1158374/&quot; rel=&quot;nofollow&quot;&gt;Kirill Yukhin&lt;/a&gt;, July 2014&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://colfaxresearch.com/knl-avx512/&quot; rel=&quot;nofollow&quot;&gt;Guide to Automatic Vectorization with Intel AVX-512 Instructions in Knights Landing Processors - Colfax Research&lt;/a&gt;, May 11, 2016&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://blogs.msdn.microsoft.com/vcblog/2017/07/11/microsoft-visual-studio-2017-supports-intel-avx-512/&quot; rel=&quot;nofollow&quot;&gt;Microsoft Visual Studio 2017 Supports Intel® AVX-512 | Visual C++ Team Blog&lt;/a&gt; by Eric Battalio, July 11, 2017&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:51:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc10&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:51 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:1316:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AVX-512&quot; rel=&quot;nofollow&quot;&gt;AVX-512 from Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/blogs/additional-avx-512-instructions&quot; rel=&quot;nofollow&quot;&gt;Additional AVX-512 instructions | Intel® Developer Zone&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/user/335550&quot; rel=&quot;nofollow&quot;&gt;James Reinders&lt;/a&gt;, July 17, 2014&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.heise.de/ct/zcontent/17/16-hocmsmeta/1501873687265857/ct.1617.016-017.qxp_table_29578.html&quot; rel=&quot;nofollow&quot;&gt;AVX512 table&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Heinz_Heise&quot; rel=&quot;nofollow&quot;&gt;Heise&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://0x80.pl/articles/avx512-ternary-functions.html&quot; rel=&quot;nofollow&quot;&gt;AVX512: ternary functions evaluation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&lt;/a&gt;, March 03, 2015&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf&quot; rel=&quot;nofollow&quot;&gt;Intel® Architecture Instruction Set Extensions Programming Reference&lt;/a&gt; (pdf) 5.3 TERNARY BIT VECTOR LOGIC TABLE&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.google.com/patents/US9372692&quot; rel=&quot;nofollow&quot;&gt;Patent US9372692 - Methods, apparatus, instructions, and logic to provide permute controls with leading zero count functionality - Google Patent Search&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://hjlebbink.github.io/x86doc/html/VPLZCNTD_Q.html&quot; rel=&quot;nofollow&quot;&gt;VPLZCNTD/Q—Count the Number of Leading Zero Bits for Packed Dword, Packed Qword Values&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-8&quot;&gt;&lt;a href=&quot;#cite_ref-8&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://github.com/WojciechMula/sse-popcount/blob/master/popcnt-avx512-harley-seal.cpp&quot; rel=&quot;nofollow&quot;&gt;sse-popcount/popcnt-avx512-harley-seal.cpp at master · WojciechMula/sse-popcount · GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-9&quot;&gt;&lt;a href=&quot;#cite_ref-9&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://dblp.uni-trier.de/pers/hd/k/Kurz:Nathan&quot; rel=&quot;nofollow&quot;&gt;Nathan Kurz&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://github.com/lemire&quot; rel=&quot;nofollow&quot;&gt;Daniel Lemire&lt;/a&gt; (&lt;strong&gt;2016&lt;/strong&gt;). &lt;em&gt;Faster Population Counts Using AVX2 Instructions&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://arxiv.org/abs/1611.07612&quot; rel=&quot;nofollow&quot;&gt;arXiv:1611.07612&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:1316 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:53:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc11&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:53 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:02:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;AVX-512&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;AVX-512&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-AVX-512 includeBody-AVX-512 includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AltiVec&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AltiVec&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX-512&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX-512&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BitScan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BitScan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DirGolem&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DirGolem&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Population+Count&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Population Count&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE5&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE5&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Wojciech+Mu%C5%82a&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Wojciech Muła&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/XOP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;XOP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:02 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Bitboard Serialization</title>
      <link>https://chessprogramming.wikispaces.com/Bitboard+Serialization</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Bitboard+Serialization</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Bitboard+Serialization</comments>
      <pubDate>Wed, 24 Dec 2014 12:09:43 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * Bitboard Serialization&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:137:&amp;lt;a href=&amp;quot;http://www.mcescher.com/Gallery/back-bmp/LW331.jpg&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Encounter.jpg/157874735/276x206/Encounter.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;height: 206px; width: 276px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://www.mcescher.com/Gallery/back-bmp/LW331.jpg&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Encounter.jpg/157874735/276x206/Encounter.jpg&quot; alt=&quot;Encounter.jpg&quot; title=&quot;Encounter.jpg&quot; style=&quot;height: 206px; width: 276px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:137 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;Bitboard Serialization&lt;/strong&gt; refers to the transformation of a bitboard with up to 64 one-bits set into a list of up to 64 bit-indices aka &lt;a class=&quot;wiki_link&quot; href=&quot;/Squares&quot;&gt;square indices&lt;/a&gt; of a &lt;a class=&quot;wiki_link&quot; href=&quot;/8x8%20Board&quot;&gt;8x8 board&lt;/a&gt; - for instance to process &lt;a class=&quot;wiki_link&quot; href=&quot;/Target%20Square&quot;&gt;move-target&lt;/a&gt; sets for &lt;a class=&quot;wiki_link&quot; href=&quot;/Move%20Generation&quot;&gt;move generation&lt;/a&gt;. This is done in two phases, isolating none-empty &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Subset&quot; rel=&quot;nofollow&quot;&gt;subsets&lt;/a&gt; and then transforming those more versatile subsets into lists, either bit by bit, by applying a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Bisection&quot; rel=&quot;nofollow&quot;&gt;bisection&lt;/a&gt; scheme, where finally &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;words&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;bytes&lt;/a&gt; may act as index of a pre-calculated database, or by &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table#PerfectHashing&quot;&gt;perfect hashing&lt;/a&gt; of square lists by subsets with a limited maximum popularity, for instance move-target sets of a &lt;a class=&quot;wiki_link&quot; href=&quot;/King&quot;&gt;king&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Knight&quot;&gt;knight&lt;/a&gt; even with &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table#MinimalPerfectHashing&quot;&gt;minimal perfect hashing&lt;/a&gt;.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Arts#Escher&quot;&gt;M. C. Escher&lt;/a&gt;, Encounter, 1944 &lt;!-- ws:start:WikiTextRefRule:15:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.mcescher.com/Gallery/gallery-back.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Picture gallery &amp;amp;quot;Back in Holland 1941 - 1954&amp;amp;quot;&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.mcescher.com/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The Official M.C. Escher Website&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:15 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:71:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:71 --&gt;&lt;!-- ws:start:WikiTextTocRule:72: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Isolating Subsets&quot;&gt;Isolating Subsets&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:72 --&gt;&lt;!-- ws:start:WikiTextTocRule:73: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Isolating Subsets-Single Bits&quot;&gt;Single Bits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:73 --&gt;&lt;!-- ws:start:WikiTextTocRule:74: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Isolating Subsets-Multiple Bits&quot;&gt;Multiple Bits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:74 --&gt;&lt;!-- ws:start:WikiTextTocRule:75: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Converting Sets to Lists&quot;&gt;Converting Sets to Lists&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:75 --&gt;&lt;!-- ws:start:WikiTextTocRule:76: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Converting Sets to Lists-Square Index Serialization&quot;&gt;Square Index Serialization&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:76 --&gt;&lt;!-- ws:start:WikiTextTocRule:77: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Converting Sets to Lists-Square Index Serialization-Scanning Forward&quot;&gt;Scanning Forward&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:77 --&gt;&lt;!-- ws:start:WikiTextTocRule:78: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Converting Sets to Lists-Square Index Serialization-Scanning Reverse&quot;&gt;Scanning Reverse&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:78 --&gt;&lt;!-- ws:start:WikiTextTocRule:79: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Converting Sets to Lists-Square Index Serialization-Scanning with Reset&quot;&gt;Scanning with Reset&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:79 --&gt;&lt;!-- ws:start:WikiTextTocRule:80: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Converting Sets to Lists-Square Index Serialization-Intrinsic Version&quot;&gt;Intrinsic Version&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:80 --&gt;&lt;!-- ws:start:WikiTextTocRule:81: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Converting Sets to Lists-Square Index Serialization-Black or White&quot;&gt;Black or White&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:81 --&gt;&lt;!-- ws:start:WikiTextTocRule:82: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Converting Sets to Lists-Square Index Serialization-STL Iterator&quot;&gt;STL Iterator&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:82 --&gt;&lt;!-- ws:start:WikiTextTocRule:83: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Converting Sets to Lists-Hashing Multiple Bits&quot;&gt;Hashing Multiple Bits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:83 --&gt;&lt;!-- ws:start:WikiTextTocRule:84: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:84 --&gt;&lt;!-- ws:start:WikiTextTocRule:85: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:85 --&gt;&lt;!-- ws:start:WikiTextTocRule:86: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:86 --&gt;&lt;!-- ws:start:WikiTextTocRule:87: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:87 --&gt;&lt;!-- ws:start:WikiTextTocRule:88: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:88 --&gt;&lt;!-- ws:start:WikiTextTocRule:89: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:89 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:37:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Isolating Subsets&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:37 --&gt;Isolating Subsets&lt;/h1&gt;
 The process of isolating subsets is performed by &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt;, for single populated subsets with the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheTwosComplement&quot;&gt;two&#039;s complement&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:39:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Isolating Subsets-Single Bits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:39 --&gt;Single Bits&lt;/h2&gt;
 This obvious loop approach is similar to &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#BrianKernighansway&quot;&gt;Brian Kernighan&#039;s way&lt;/a&gt; to count the number of one-bits by consecutively isolating and clearing the LS1B:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;while ( x ) {&amp;lt;br/&amp;gt;   U64 ls1b = x &amp;amp;amp; -x; // isolate LS1B&amp;lt;br/&amp;gt;   ...&amp;lt;br/&amp;gt;   x &amp;amp;amp;= x-1; // reset LS1B&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; x &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 ls1b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;x&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// isolate LS1B&lt;/span&gt;
   ...
   &lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// reset LS1B&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;or with likely the same generated assembly:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;if ( x ) do {&amp;lt;br/&amp;gt;   U64 ls1b = x &amp;amp;amp; -x; // isolate LS1B&amp;lt;br/&amp;gt;   ...&amp;lt;br/&amp;gt;} while ( x &amp;amp;amp;= x-1 );&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; x &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 ls1b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;x&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// isolate LS1B&lt;/span&gt;
   ...
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;Of course we may also reset the LS1B by&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;   x ^= ls1b; // reset LS1B&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;   x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ls1b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// reset LS1B&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;but todays processors like to gain more parallelism to calculate independent expressions.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:41:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Isolating Subsets-Multiple Bits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:41 --&gt;Multiple Bits&lt;/h2&gt;
 Isolating none-empty subsets with possibly multiple one-bits can be applied by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Divide_and_conquer_algorithm&quot; rel=&quot;nofollow&quot;&gt;divide and conquer&lt;/a&gt;, that is to divide the bitboard or &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;quad word&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Recursion&quot;&gt;recursively&lt;/a&gt; into smaller items, two &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;double words&lt;/a&gt;, consisting of two &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;words&lt;/a&gt; and those again of two &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;bytes&lt;/a&gt;. Word and byte-wide isolated subsets may then act as an index of a pre-calculated lookup table to convert those subsets to adequate data-structures, most likely lists with up to sixteen or eight elements.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:43:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Converting Sets to Lists&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:43 --&gt;Converting Sets to Lists&lt;/h1&gt;
 &lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:45:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Converting Sets to Lists-Square Index Serialization&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:45 --&gt;Square Index Serialization&lt;/h2&gt;
 For most applications LS1B-isolation alone is not appropriate, but the conversion from the exponential bitboard centric world to the scalar square centric world, also called &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;bit-scanning&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:47:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Converting Sets to Lists-Square Index Serialization-Scanning Forward&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:47 --&gt;Scanning Forward&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;if ( x ) do {&amp;lt;br/&amp;gt;   int idx = bitScanForward(x); // square index from 0..63&amp;lt;br/&amp;gt;   *list++ = foo(idx, ...);&amp;lt;br/&amp;gt;} while (x &amp;amp;amp;= x-1); // reset LS1B&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; x &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; idx &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// square index from 0..63&lt;/span&gt;
   &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;list&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; foo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;idx, ...&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// reset LS1B&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;Per definition bitScanForward reveals the index of LS1B.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:49:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Converting Sets to Lists-Square Index Serialization-Scanning Reverse&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:49 --&gt;Scanning Reverse&lt;/h3&gt;
 If - for some reason - we like to traverse the sets in reverse or unknown order anyway, we can not (or don&#039;t want to) rely on the independent LS1B reset.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;if ( x ) do {&amp;lt;br/&amp;gt;   int idx = bitScanReverse(x); // square index from 0..63&amp;lt;br/&amp;gt;   *list++ = foo(idx, ...);&amp;lt;br/&amp;gt;} while (x ^= powOf2[idx]) ; // or 1ULL &amp;amp;lt;&amp;amp;lt; idx -&amp;amp;gt; reset found bit&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; x &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; idx &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bitScanReverse&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// square index from 0..63&lt;/span&gt;
   &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;list&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; foo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;idx, ...&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; powOf2&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;idx&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// or 1ULL &amp;lt;&amp;lt; idx -&amp;gt; reset found bit&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:51:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Converting Sets to Lists-Square Index Serialization-Scanning with Reset&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:51 --&gt;Scanning with Reset&lt;/h3&gt;
 A win of abstraction is to use a combined &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#BitscanwithReset&quot;&gt;bitscan with reset&lt;/a&gt; found bit routine. This is fine. But probably harder for compilers to generate optimal code in the if-do-while-sense, where reset last bit already sets the zero-flag. If you don&#039;t care on such micro-optimizations, this is the preferred control structure.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;while ( x ) {&amp;lt;br/&amp;gt;   int idx = bitScanAndReset(&amp;amp;amp;x); // square index from 0..63&amp;lt;br/&amp;gt;   *list++ = foo(idx, ...);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; x &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; idx &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bitScanAndReset&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// square index from 0..63&lt;/span&gt;
   &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;list&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; foo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;idx, ...&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;One may even don&#039;t care about the order.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:53:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Converting Sets to Lists-Square Index Serialization-Intrinsic Version&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:53 --&gt;Intrinsic Version&lt;/h3&gt;
 If bitscan is able to properly handle empty sets - leaving an value outside the 0..63 range (like leading or trailing zero count), we may think about to skip the leading while condition and to break on bitscan(x) &amp;gt; 63 for instance. That was not recommend - since the reset leaves the condition en-passant, and the computational cost of an additional bitscan or zero count was higher. If you like to play the optimization game, it might be fine for &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Intel_Core_2&quot; rel=&quot;nofollow&quot;&gt;Core 2 duo&lt;/a&gt; thought - using &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;bitscan&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;bittestandreset&lt;/a&gt; intrinsics or wrappers - if kept all in registers of course.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;while (_BitScanForward64(&amp;amp;amp;idx, x)) { // or reverse&amp;lt;br/&amp;gt;   *list++ = foo(idx, ...);&amp;lt;br/&amp;gt;   _bittestandreset64(&amp;amp;amp;x, idx);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_BitScanForward64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;idx, x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// or reverse&lt;/span&gt;
   &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;list&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; foo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;idx, ...&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   _bittestandreset64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;x, idx&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;The loop is intended to look like this in &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly&quot;&gt;assembly&lt;/a&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;; input rdx - move target set&amp;lt;br/&amp;gt;;       ecx - move from aspects&amp;lt;br/&amp;gt;;       rdi - pointer to movelist&amp;lt;br/&amp;gt;   std           ; set direction flag&amp;lt;br/&amp;gt;   bsf  rax, rdx ; scan first to-bit&amp;lt;br/&amp;gt;   jz   over     ; jump if no more moves&amp;lt;br/&amp;gt;loop:&amp;lt;br/&amp;gt;   btr  rdx, rax ; reset found bit&amp;lt;br/&amp;gt;   or   eax, ecx ; combine to- with from-square&amp;lt;br/&amp;gt;   stosw         ; store 16-bit move *rdi++ = move&amp;lt;br/&amp;gt;   bsf  rax, rdx ; scan next to-bit&amp;lt;br/&amp;gt;   jnz  loop     ; jump if more moves&amp;lt;br/&amp;gt;over:&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;; input rdx - move target set
;       ecx - move from aspects
;       rdi - pointer to movelist
   std           ; set direction flag
   bsf  rax, rdx ; scan first to-bit
   jz   over     ; jump if no more moves
loop:
   btr  rdx, rax ; reset found bit
   or   eax, ecx ; combine to- with from-square
   stosw         ; store 16-bit move *rdi++ = move
   bsf  rax, rdx ; scan next to-bit
   jnz  loop     ; jump if more moves
over:&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:90:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BlackorWhite&amp;quot; title=&amp;quot;Anchor: BlackorWhite&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BlackorWhite&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:90 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:55:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Converting Sets to Lists-Square Index Serialization-Black or White&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:55 --&gt;Black or White&lt;/h3&gt;
 With bitboard serialization one minor problem is the relative order in &lt;a class=&quot;wiki_link&quot; href=&quot;/Move%20Generation&quot;&gt;move generation&lt;/a&gt; considering &lt;a class=&quot;wiki_link&quot; href=&quot;/Side%20to%20move&quot;&gt;side to move&lt;/a&gt;. Bsf scans the board in a1..h1, a2..h2, a8..h8 order, assuming &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations#LittleEndianRankFileMapping&quot;&gt;little-endian rank-file mapping&lt;/a&gt;, which might be the desired order for an attacking black player. Traversing white pieces and target squares the same way may result in asymmetries and different search behavior of &lt;a class=&quot;wiki_link&quot; href=&quot;/Color%20Flipping&quot;&gt;color flipped positions&lt;/a&gt;. Despite other features considered in &lt;a class=&quot;wiki_link&quot; href=&quot;/Move%20Ordering&quot;&gt;move ordering&lt;/a&gt;, the initial order in generation has more or less influence. Therefore, it is desired to traverse the &amp;quot;white&amp;quot; bitboards with priority for the black back-rank as well &lt;!-- ws:start:WikiTextRefRule:19:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;amp;p=289344&amp;amp;amp;t=29611&amp;amp;amp;sid=74848128f12e45f8883a87c3e6729f75&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Alternatives to History Heuristics&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Robert%20Hyatt&amp;quot;&amp;gt;Robert Hyatt&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, September 02, 2009&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:19 --&gt; . This might be done by bitscan reverse, which covers the rank symmetry, but also mirrors the files. Another alternative is to traverse a &lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating#FlipVertically&quot;&gt;vertically flipped&lt;/a&gt; &amp;quot;white&amp;quot; bitboard, which can be done outside the do-while loop by a &amp;quot;conditional&amp;quot; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;byte swap&lt;/a&gt;, and requires one further register and xor per loop cycle, which might be combined with other stuff, f.i. the &lt;a class=&quot;wiki_link&quot; href=&quot;/Origin%20Square&quot;&gt;from square&lt;/a&gt; of a move:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;if ( x ) {&amp;lt;br/&amp;gt;   U64 m = (U64)color - 1; // e.g. -1 if white, 0 for black&amp;lt;br/&amp;gt;   int o = (int)m &amp;amp;amp; 56;&amp;lt;br/&amp;gt;   x = x ^ ((x ^ flipVertical(x)) &amp;amp;amp; m); // conditional flip&amp;lt;br/&amp;gt;   do {&amp;lt;br/&amp;gt;      int idx = bitScanForward(x) ^ o; // square index from 0..63&amp;lt;br/&amp;gt;      *list++ = foo(idx , ...);&amp;lt;br/&amp;gt;   } while (x &amp;amp;amp;= x-1); // reset LS1B&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; x &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 m &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;color &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// e.g. -1 if white, 0 for black&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; o &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;m &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; flipVertical&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; m&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// conditional flip&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; idx &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; o&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// square index from 0..63&lt;/span&gt;
      &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;list&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; foo&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;idx , ...&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// reset LS1B&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:91:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@STLIterator&amp;quot; title=&amp;quot;Anchor: STLIterator&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;STLIterator&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:91 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:57:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc10&quot;&gt;&lt;a name=&quot;Converting Sets to Lists-Square Index Serialization-STL Iterator&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:57 --&gt;STL Iterator&lt;/h3&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Rein%20Halbersma&quot;&gt;Rein Halbersma&lt;/a&gt; has written a prototype of a &lt;a class=&quot;wiki_link&quot; href=&quot;/Generic%20Programming&quot;&gt;generic&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++11&lt;/a&gt; bitset &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp#Template&quot;&gt;template&lt;/a&gt; that can be used to traverse a set in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Iterator#C.2B.2B&quot; rel=&quot;nofollow&quot;&gt;STL iterator&lt;/a&gt; style, hiding bitscan and reset &lt;!-- ws:start:WikiTextRefRule:21:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://liveworkspace.org/code/41EaZl$203&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;LiveWorkSpace(IDE online): C++-3.2 (clang++): 41EaZl&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:21 --&gt; &lt;!-- ws:start:WikiTextRefRule:25:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=47414&amp;amp;amp;start=4&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: C vs ASM&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Rein%20Halbersma&amp;quot;&amp;gt;Rein Halbersma&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;,  March 05, 2013&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:25 --&gt; ...&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;typedef bit_set&amp;amp;lt;int64_t, 1&amp;amp;gt; bitset;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;void testLoop(int* p, const bitset &amp;amp;amp; x) {&amp;lt;br/&amp;gt;  for (auto it = x.begin(); it != x.end(); ++it)&amp;lt;br/&amp;gt;    *p++ = *it;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;/* or std::copy */&amp;lt;br/&amp;gt;void testCopy(int* p, const bitset &amp;amp;amp; x) {&amp;lt;br/&amp;gt;  std::copy(x.begin(), x.end(), p); &amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; bit_set&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int64_t&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; bitset&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; testLoop&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; p, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; bitset &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;auto&lt;/span&gt; it &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x.&lt;span class=&quot;me1&quot;&gt;begin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; it &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x.&lt;span class=&quot;me1&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;it&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;p&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;it&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;coMULTI&quot;&gt;/* or std::copy */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; testCopy&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; p, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; bitset &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  std&lt;span class=&quot;sy4&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;copy&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x.&lt;span class=&quot;me1&quot;&gt;begin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, x.&lt;span class=&quot;me1&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, p&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;... which yields in following &lt;a class=&quot;wiki_link&quot; href=&quot;/X86-64&quot;&gt;X86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly&quot;&gt;assembly&lt;/a&gt;, almost identical for the iterator loop and std::copy  &lt;!-- ws:start:WikiTextRefRule:27:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://gcc.godbolt.org/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;GCC Explorer&amp;lt;/a&amp;gt; with g++ 4.7 compiler, options -std=c++11 -O3 -march=k8-sse3 -fverbose-asm &amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:27 --&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;; testLoop(int*, bit_set&amp;amp;lt;long, 1ul&amp;amp;gt;):&amp;lt;br/&amp;gt;  test  rsi, rsi&amp;lt;br/&amp;gt;  jne   .L13&amp;lt;br/&amp;gt;.L7:&amp;lt;br/&amp;gt;  ret&amp;lt;br/&amp;gt;.L13:&amp;lt;br/&amp;gt;  bsf   rax, rsi&amp;lt;br/&amp;gt;  mov   DWORD PTR [rdi], eax&amp;lt;br/&amp;gt;  lea   rax, [rsi-1]&amp;lt;br/&amp;gt;  add   rdi, 4&amp;lt;br/&amp;gt;  and   rsi, rax&amp;lt;br/&amp;gt;  jne   .L13&amp;lt;br/&amp;gt;  jmp   .L7&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;; testLoop(int*, bit_set&amp;lt;long, 1ul&amp;gt;):
  test  rsi, rsi
  jne   .L13
.L7:
  ret
.L13:
  bsf   rax, rsi
  mov   DWORD PTR [rdi], eax
  lea   rax, [rsi-1]
  add   rdi, 4
  and   rsi, rax
  jne   .L13
  jmp   .L7&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:92:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@HashingMultipleBits&amp;quot; title=&amp;quot;Anchor: HashingMultipleBits&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;HashingMultipleBits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:92 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:59:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc11&quot;&gt;&lt;a name=&quot;Converting Sets to Lists-Hashing Multiple Bits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:59 --&gt;Hashing Multiple Bits&lt;/h2&gt;
 Similar to the idea to hash occupancies in &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;kindergarten bitboards&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;magic bitboards&lt;/a&gt;, one may hash certain move-target subsets of one piece in one run, to lookup tables with pre-calculated moves-lists &lt;!-- ws:start:WikiTextRefRule:31:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=487844&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Subject: sliding move generation idea with bitboards&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Gerd%20Isenberg&amp;quot;&amp;gt;Gerd Isenberg&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, February 19, 2006&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:31 --&gt; . Sounds like doing up to eight bitscans in parallel. The idea is to muliply-shift-lookup a move-target bitboard, to do an almost branch-less &lt;a class=&quot;wiki_link&quot; href=&quot;/Move%20Generation&quot;&gt;move-generation&lt;/a&gt; with pre-calculated moves inside &lt;a class=&quot;wiki_link&quot; href=&quot;/Move%20List&quot;&gt;move-lists&lt;/a&gt;. For instance king- and knight-moves &lt;!-- ws:start:WikiTextRefRule:35:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;amp;t=6099&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Magic Knight- and King-Move Generation&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Gerd%20Isenberg&amp;quot;&amp;gt;Gerd Isenberg&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Forum&amp;lt;/a&amp;gt;, Januar 11, 2007&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:35 --&gt; as well as moves of sliding pieces per line:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;moveTarget = KingAttacks[sq] &amp;amp;amp; ~(ownPieces | attackedSquares);&amp;lt;br/&amp;gt;idx = (moveTarget * kingMagic[sq]) &amp;amp;gt;&amp;amp;gt; kingShift[sq]);&amp;lt;br/&amp;gt;movelists = kingMoveLists[sq];&amp;lt;br/&amp;gt;movelist  = movelists[idx];&amp;lt;br/&amp;gt;moveCpy(target, movelist, movelist-&amp;amp;gt;n);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;moveTarget &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; KingAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ownPieces &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; attackedSquares&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
idx &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;moveTarget &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; kingMagic&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; kingShift&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
movelists &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; kingMoveLists&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
movelist  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; movelists&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;idx&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
moveCpy&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;target, movelist, movelist&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;n&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;A king in a corner may have up to three moves. Thus there are 2^3 == 8 possible move-lists.&lt;br /&gt;
For instance for a king on a1 (number of moves: vector of moves):&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;0:{empty}&amp;lt;br/&amp;gt;1:{a1-b1}&amp;lt;br/&amp;gt;1:{a1-a2}&amp;lt;br/&amp;gt;1:{a1-b2}&amp;lt;br/&amp;gt;2:{a1-b1,a1-a2}&amp;lt;br/&amp;gt;2:{a1-b1,a1-b2}&amp;lt;br/&amp;gt;2:{a1-a2,a1-b2}&amp;lt;br/&amp;gt;3:{a1-b1,a1-a2,a1-b2}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;0:{empty}
1:{a1-b1}
1:{a1-a2}
1:{a1-b2}
2:{a1-b1,a1-a2}
2:{a1-b1,a1-b2}
2:{a1-a2,a1-b2}
3:{a1-b1,a1-a2,a1-b2}&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;Kings on edges have 5 potential target squares, thus there are 32 possible move-lists. All other kings have 8 all the 8 neighbors with up to 256 move-lists. Similar move-list enumeration is possible with knights and others. All possible move-target subsets of kings and knights for all 64 from-squares are &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table#MinimalPerfectHashing&quot;&gt;perfectly minimal hashtable&lt;/a&gt; with a magic factor of four one-bits set. 10016 possible king-move-lists and 5520 knight-move-lists. To reduce memory one may offset the sets to a &amp;quot;normalized&amp;quot; source square per king, knight and sliding piece line, implying some vector arithmetic in the board centric world considering the offset.&lt;br /&gt;
&lt;br /&gt;
The less populated move-target subsets are, the less efficient this hashing technique. This might become a problem since bitboard move-generation is essentially about subsets of moves with certain properties, like most importantly fast winning captures at &lt;a class=&quot;wiki_link&quot; href=&quot;/Node%20Types#CUT&quot;&gt;Cut-nodes&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:61:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc12&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:61 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Move%20Generation&quot;&gt;Move Generation&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Belle#Hardware&quot;&gt;Belle | Hardware Move Generation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Move%20Ordering&quot;&gt;Move Ordering&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pieces%20versus%20Directions&quot;&gt;Pieces versus Directions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Table-driven%20Move%20Generation&quot;&gt;Table-driven Move Generation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Traversing%20Subsets%20of%20a%20Set&quot;&gt;Traversing Subsets of a Set&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:63:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc13&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:63 --&gt;Forum Posts&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=487844&quot; rel=&quot;nofollow&quot;&gt;Subject: sliding move generation idea with bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 19, 2006&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=6099&quot; rel=&quot;nofollow&quot;&gt;Magic Knight- and King-Move Generation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, Januar 11, 2007&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=47414&amp;amp;start=4&quot; rel=&quot;nofollow&quot;&gt;Re: C vs ASM&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Rein%20Halbersma&quot;&gt;Rein Halbersma&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;,  March 05, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=54704&quot; rel=&quot;nofollow&quot;&gt;Symmetric move generation using bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Lasse%20Hansen&quot;&gt;Lasse Hansen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 20, 2014 » &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;BitScan&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:65:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc14&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:65 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Serialization&quot; rel=&quot;nofollow&quot;&gt;Serialization from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:67:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc15&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:67 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:265:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.mcescher.com/Gallery/gallery-back.htm&quot; rel=&quot;nofollow&quot;&gt;Picture gallery &amp;quot;Back in Holland 1941 - 1954&amp;quot;&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.mcescher.com/&quot; rel=&quot;nofollow&quot;&gt;The Official M.C. Escher Website&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=289344&amp;amp;t=29611&amp;amp;sid=74848128f12e45f8883a87c3e6729f75&quot; rel=&quot;nofollow&quot;&gt;Re: Alternatives to History Heuristics&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Hyatt&quot;&gt;Robert Hyatt&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 02, 2009&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://liveworkspace.org/code/41EaZl$203&quot; rel=&quot;nofollow&quot;&gt;LiveWorkSpace(IDE online): C++-3.2 (clang++): 41EaZl&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=47414&amp;amp;start=4&quot; rel=&quot;nofollow&quot;&gt;Re: C vs ASM&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Rein%20Halbersma&quot;&gt;Rein Halbersma&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;,  March 05, 2013&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://gcc.godbolt.org/&quot; rel=&quot;nofollow&quot;&gt;GCC Explorer&lt;/a&gt; with g++ 4.7 compiler, options -std=c++11 -O3 -march=k8-sse3 -fverbose-asm &lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=487844&quot; rel=&quot;nofollow&quot;&gt;Subject: sliding move generation idea with bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 19, 2006&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=6099&quot; rel=&quot;nofollow&quot;&gt;Magic Knight- and King-Move Generation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Forum&lt;/a&gt;, Januar 11, 2007&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:265 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:69:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc16&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:69 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:013:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Bitboard Serialization&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Bitboard Serialization&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Bitboard_Serialization includeBody-Bitboard%20Serialization includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tfoot class=&quot;includeBacklinksFooter&quot;&gt;
    &lt;tr&gt;
      &lt;td colspan=&quot;5&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/page/links/Bitboard+Serialization&quot;&gt;More Links&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tfoot&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Backtracking&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Backtracking&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bison&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bison&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 29, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Serialization&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Serialization&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BitScan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BitScan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Blockers+and+Beyond&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Blockers and Beyond&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 21, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Brainless&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Brainless&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Checks+and+Pinned+Pieces+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Checks and Pinned Pieces (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 14, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CHEOPS&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CHEOPS&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 18, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Color+Flipping&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Color Flipping&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Crafty&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Crafty&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double+and+Triple+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double and Triple (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 12, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gibbon&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gibbon&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 23, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gk&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gk&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Iteration&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Iteration&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Joker+IT&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Joker IT&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Knight+Pattern&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Knight Pattern&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 23, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Lasse+Hansen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Lasse Hansen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 1, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Linked+List&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Linked List&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Move+Generation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Move Generation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 29, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/NoraGrace&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;NoraGrace&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 23, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Open+Pawns+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Open Pawns (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Passed+Pawns+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Passed Pawns (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 23, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Pushes+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Pushes (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Piece-Sets&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Piece-Sets&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pieces+versus+Directions&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pieces versus Directions&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 6, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Population+Count&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Population Count&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Praetorian&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Praetorian&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 21, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rein+Halbersma&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rein Halbersma&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 22, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Reverse+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Reverse Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ryan+Mack&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ryan Mack&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 18, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rybka&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rybka&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Pieces&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Pieces&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Spector&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Spector&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tinker&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tinker&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Traversing+Subsets+of+a+Set&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Traversing Subsets of a Set&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 14, 2016&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:013 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>BitScan</title>
      <link>https://chessprogramming.wikispaces.com/BitScan</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/BitScan</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/BitScan</comments>
      <pubDate>Sun, 10 Sep 2017 15:44:37 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * BitScan&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:1479:&amp;lt;a href=&amp;quot;http://www.mcescher.com/Gallery/back-bmp/LW344.jpg&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Eye.jpg/157874885/187x141/Eye.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;height: 141px; width: 187px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://www.mcescher.com/Gallery/back-bmp/LW344.jpg&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Eye.jpg/157874885/187x141/Eye.jpg&quot; alt=&quot;Eye.jpg&quot; title=&quot;Eye.jpg&quot; style=&quot;height: 141px; width: 187px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1479 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;BitScan&lt;/strong&gt;,&lt;br /&gt;
a function that determines the bit-index of the least significant 1 &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit&quot;&gt;bit&lt;/a&gt; (&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;LS1B&lt;/a&gt;) or the most significant 1 &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit&quot;&gt;bit&lt;/a&gt; (&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheMostSignificantOneBitMS1B&quot;&gt;MS1B&lt;/a&gt;) in an integer such as &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboards&lt;/a&gt;. If exactly one bit is set in an unsigned integer, representing a numerical value of a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Power_of_two&quot; rel=&quot;nofollow&quot;&gt;power of two&lt;/a&gt;, this is equivalent to a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Binary_logarithm&quot; rel=&quot;nofollow&quot;&gt;base-2 logarithm&lt;/a&gt;. Many implementations have been devised since the advent of bitboards, as described on this page, and some &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#EngineSamples&quot;&gt;implementation samples&lt;/a&gt; of concrete &lt;a class=&quot;wiki_link&quot; href=&quot;/Open%20Source%20Engines&quot;&gt;open source engines&lt;/a&gt; listed for didactic purpose.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Arts#Escher&quot;&gt;M. C. Escher&lt;/a&gt;, Eye, 1946 &lt;!-- ws:start:WikiTextRefRule:25:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.mcescher.com/Gallery/gallery-back.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Picture gallery &amp;amp;quot;Back in Holland 1941 - 1954&amp;amp;quot;&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.mcescher.com/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The Official M.C. Escher Website&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:25 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:241:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:241 --&gt;&lt;!-- ws:start:WikiTextTocRule:242: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Hardware vs. Software&quot;&gt;Hardware vs. Software&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:242 --&gt;&lt;!-- ws:start:WikiTextTocRule:243: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Non Empty Sets&quot;&gt;Non Empty Sets&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:243 --&gt;&lt;!-- ws:start:WikiTextTocRule:244: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Bitscan forward&quot;&gt;Bitscan forward&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:244 --&gt;&lt;!-- ws:start:WikiTextTocRule:245: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan forward-Trailing Zero Count&quot;&gt;Trailing Zero Count&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:245 --&gt;&lt;!-- ws:start:WikiTextTocRule:246: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan forward-De Bruijn Multiplication&quot;&gt;De Bruijn Multiplication&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:246 --&gt;&lt;!-- ws:start:WikiTextTocRule:247: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Bitscan forward-De Bruijn Multiplication-With isolated LS1B&quot;&gt;With isolated LS1B&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:247 --&gt;&lt;!-- ws:start:WikiTextTocRule:248: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Bitscan forward-De Bruijn Multiplication-With separated LS1B&quot;&gt;With separated LS1B&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:248 --&gt;&lt;!-- ws:start:WikiTextTocRule:249: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan forward-Matt Taylor&#039;s Folding trick&quot;&gt;Matt Taylor&#039;s Folding trick&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:249 --&gt;&lt;!-- ws:start:WikiTextTocRule:250: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan forward-Walter Faxon&#039;s magic Bitscan&quot;&gt;Walter Faxon&#039;s magic Bitscan&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:250 --&gt;&lt;!-- ws:start:WikiTextTocRule:251: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan forward-Bitscan by Modulo&quot;&gt;Bitscan by Modulo&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:251 --&gt;&lt;!-- ws:start:WikiTextTocRule:252: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan forward-Divide and Conquer&quot;&gt;Divide and Conquer&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:252 --&gt;&lt;!-- ws:start:WikiTextTocRule:253: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan forward-Double conversion of LS1B&quot;&gt;Double conversion of LS1B&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:253 --&gt;&lt;!-- ws:start:WikiTextTocRule:254: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan forward-Index of LS1B by Popcount&quot;&gt;Index of LS1B by Popcount&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:254 --&gt;&lt;!-- ws:start:WikiTextTocRule:255: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Bitscan reverse&quot;&gt;Bitscan reverse&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:255 --&gt;&lt;!-- ws:start:WikiTextTocRule:256: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan reverse-Divide and Conquer&quot;&gt;Divide and Conquer&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:256 --&gt;&lt;!-- ws:start:WikiTextTocRule:257: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan reverse-Tribute to Frank Zappa&quot;&gt;Tribute to Frank Zappa&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:257 --&gt;&lt;!-- ws:start:WikiTextTocRule:258: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan reverse-De Bruijn Multiplication&quot;&gt;De Bruijn Multiplication&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:258 --&gt;&lt;!-- ws:start:WikiTextTocRule:259: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan reverse-Double conversion&quot;&gt;Double conversion&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:259 --&gt;&lt;!-- ws:start:WikiTextTocRule:260: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitscan reverse-Leading Zero Count&quot;&gt;Leading Zero Count&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:260 --&gt;&lt;!-- ws:start:WikiTextTocRule:261: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Bitscan versus Zero Count&quot;&gt;Bitscan versus Zero Count&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:261 --&gt;&lt;!-- ws:start:WikiTextTocRule:262: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Bitscan with Reset&quot;&gt;Bitscan with Reset&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:262 --&gt;&lt;!-- ws:start:WikiTextTocRule:263: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Generalized Bitscan&quot;&gt;Generalized Bitscan&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:263 --&gt;&lt;!-- ws:start:WikiTextTocRule:264: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Processor Instructions for Bitscans&quot;&gt;Processor Instructions for Bitscans&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:264 --&gt;&lt;!-- ws:start:WikiTextTocRule:265: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Processor Instructions for Bitscans-x86&quot;&gt;x86&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:265 --&gt;&lt;!-- ws:start:WikiTextTocRule:266: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Processor Instructions for Bitscans-x86-Emulating Intrinsics&quot;&gt;Emulating Intrinsics&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:266 --&gt;&lt;!-- ws:start:WikiTextTocRule:267: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Processor Instructions for Bitscans-x86-Intrinsics versus asm&quot;&gt;Intrinsics versus asm&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:267 --&gt;&lt;!-- ws:start:WikiTextTocRule:268: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Processor Instructions for Bitscans-x86-Bsf/Bsr x86-64 Timings&quot;&gt;Bsf/Bsr x86-64 Timings&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:268 --&gt;&lt;!-- ws:start:WikiTextTocRule:269: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Processor Instructions for Bitscans-x86-Bsf/Bsr behavior with zero source&quot;&gt;Bsf/Bsr behavior with zero source&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:269 --&gt;&lt;!-- ws:start:WikiTextTocRule:270: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Processor Instructions for Bitscans-ARM&quot;&gt;ARM&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:270 --&gt;&lt;!-- ws:start:WikiTextTocRule:271: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Engine Samples&quot;&gt;Engine Samples&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:271 --&gt;&lt;!-- ws:start:WikiTextTocRule:272: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:272 --&gt;&lt;!-- ws:start:WikiTextTocRule:273: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Publications&quot;&gt;Publications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:273 --&gt;&lt;!-- ws:start:WikiTextTocRule:274: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:274 --&gt;&lt;!-- ws:start:WikiTextTocRule:275: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Forum Posts-1996 ...&quot;&gt;1996 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:275 --&gt;&lt;!-- ws:start:WikiTextTocRule:276: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Forum Posts-2000 ...&quot;&gt;2000 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:276 --&gt;&lt;!-- ws:start:WikiTextTocRule:277: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Forum Posts-2005 ...&quot;&gt;2005 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:277 --&gt;&lt;!-- ws:start:WikiTextTocRule:278: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Forum Posts-2010 ...&quot;&gt;2010 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:278 --&gt;&lt;!-- ws:start:WikiTextTocRule:279: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Forum Posts-2015 ...&quot;&gt;2015 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:279 --&gt;&lt;!-- ws:start:WikiTextTocRule:280: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:280 --&gt;&lt;!-- ws:start:WikiTextTocRule:281: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:281 --&gt;&lt;!-- ws:start:WikiTextTocRule:282: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:282 --&gt;&lt;!-- ws:start:WikiTextTocRule:283: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:283 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:159:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Hardware vs. Software&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:159 --&gt;Hardware vs. Software&lt;/h1&gt;
 For recent &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; architectures like &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_Core_2&quot; rel=&quot;nofollow&quot;&gt;Core 2 duo&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AMD_K10&quot; rel=&quot;nofollow&quot;&gt;K10&lt;/a&gt;, one should use the &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#bsfbsr&quot;&gt;Processor Instructions for Bitscans&lt;/a&gt; via intrinsics or &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#InlineAssembly&quot;&gt;inline assembly&lt;/a&gt;, see &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#x86Timing&quot;&gt;x86-64 timing&lt;/a&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium_4&quot; rel=&quot;nofollow&quot;&gt;P4&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Athlon_64&quot; rel=&quot;nofollow&quot;&gt;K8&lt;/a&gt; have rather slow bitscan-instructions. K8 uses so called &lt;em&gt;vector path instructions&lt;/em&gt; &lt;!-- ws:start:WikiTextRefRule:28:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.chip-architect.com/news/2003_09_21_Detailed_Architecture_of_AMDs_64bit_Core.html#1.3&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Chip Architect: Detailed Architecture of AMD&#039;s Opteron - 1.3 A third class of Instructions&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.chip-architect.com/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Hans de Vries&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:28 --&gt; with 9 or 11 cycles latency, even blocking other processor resources. For these processors, specially K8 with already fast multiplication, the &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#DeBruijnMultiplation&quot;&gt;De Bruijn Multiplication&lt;/a&gt; (64-bit mode) or &lt;a class=&quot;wiki_link&quot; href=&quot;/Matt%20Taylor&quot;&gt;Matt Taylor&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#MattTaylorsFoldingtrick&quot;&gt;Folded 32-bit Multiplication&lt;/a&gt; (32-bit mode) might be the right choice. Other routines mentioned might be advantageous on certain architectures, specially with slow integer multiplications.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:161:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Non Empty Sets&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:161 --&gt;Non Empty Sets&lt;/h1&gt;
 Bitscan is most often used in &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboard%20Serialization&quot;&gt; serializing bitboards&lt;/a&gt;, and is therefor - due to a leading while-condition - not called with empty sets. Until stated otherwise, most mentioned bitscan-routines in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;/&lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; have the same prototype and assume none empty sets as actual parameter.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:284:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Bitscanforward&amp;quot; title=&amp;quot;Anchor: Bitscanforward&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Bitscanforward&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:284 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:163:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Bitscan forward&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:163 --&gt;Bitscan forward&lt;/h1&gt;
 A bitscan &lt;strong&gt;forward&lt;/strong&gt; is used to find the index of the &lt;strong&gt;least&lt;/strong&gt; significant 1 bit (&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;LS1B&lt;/a&gt;).&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:285:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@TrailingZeroCount&amp;quot; title=&amp;quot;Anchor: TrailingZeroCount&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;TrailingZeroCount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:285 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:165:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Bitscan forward-Trailing Zero Count&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:165 --&gt;Trailing Zero Count&lt;/h2&gt;
 Bitscan forward is identical with a &lt;strong&gt;Trailing Zero Count&lt;/strong&gt; for none empty sets, possibly available as machine instruction on some architectures, for instance the &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; bit-manipulation expansion set &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:286:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@DeBruijnMultiplation&amp;quot; title=&amp;quot;Anchor: DeBruijnMultiplation&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;DeBruijnMultiplation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:286 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:167:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Bitscan forward-De Bruijn Multiplication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:167 --&gt;De Bruijn Multiplication&lt;/h2&gt;
 The &lt;strong&gt;De Bruijn&lt;/strong&gt; bitscan was devised in 1997, according to &lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Donald Knuth&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:36:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Donald%20Knuth&amp;quot;&amp;gt;Donald Knuth&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2009&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The Art of Computer Programming&amp;lt;/a&amp;gt;, Volume 4, Fascicle 1: Bitwise tricks &amp;amp;amp; techniques&amp;lt;/em&amp;gt;, as &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www-cs-faculty.stanford.edu/%7Eknuth/fasc1a.ps.gz&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Pre-Fascicle 1a postscript&amp;lt;/a&amp;gt;, p 10&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:36 --&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#MartinLaeuter&quot;&gt;Martin Läuter&lt;/a&gt;, and independently by &lt;a class=&quot;wiki_link&quot; href=&quot;/Charles%20Leiserson&quot;&gt;Charles Leiserson&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Harald%20Prokop&quot;&gt;Harald Prokop&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Keith%20H.%20Randall&quot;&gt;Keith H. Randall&lt;/a&gt; a few month later &lt;!-- ws:start:WikiTextRefRule:45:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Charles%20Leiserson&amp;quot;&amp;gt;Charles E. Leiserson&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Harald%20Prokop&amp;quot;&amp;gt;Harald Prokop&amp;lt;/a&amp;gt; and &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Keith%20H.%20Randall&amp;quot;&amp;gt;Keith H. Randall&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1998&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Using de Bruijn Sequences to Index a 1 in a Computer Word&amp;lt;/em&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://supertech.csail.mit.edu/papers/debruijn.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;pdf&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:45 --&gt; &lt;!-- ws:start:WikiTextRefRule:48:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=212586&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;amp;quot;Using de Bruijn Sequences to Index a 1 in a Computer Word&amp;amp;quot;&amp;lt;/a&amp;gt; discussion in &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, February 08, 2002&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:48 --&gt; , to determine the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;LS1B&lt;/a&gt; index by &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table#MinimalPerfectHashing&quot;&gt;minimal perfect hashing&lt;/a&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/De%20Bruijn%20sequence&quot;&gt;De Bruijn sequences&lt;/a&gt; were named after the Dutch mathematician &lt;a class=&quot;wiki_link&quot; href=&quot;/Nicolaas%20de%20Bruijn&quot;&gt;Nicolaas de Bruijn&lt;/a&gt;. Interestingly sequences with the binary alphabet were already investigated by the French mathematician &lt;strong&gt;Camille Flye Sainte-Marie&lt;/strong&gt; in 1894, but later &amp;quot;forgotten&amp;quot; and re-investigated and generalized by De Bruijn and &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#Ehrenfest&quot;&gt;Tanja van Ardenne-Ehrenfest&lt;/a&gt; half a century later &lt;!-- ws:start:WikiTextRefRule:55:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Nicolaas%20de%20Bruijn&amp;quot;&amp;gt;N. G. de Bruijn&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1975&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Acknowledgement of priority to C. Flye Sainte-Marie on the counting of circular arrangements of 2n zeros and ones that show each n-letter word exactly once&amp;lt;/em&amp;gt;. Technical Report, Technische Hogeschool Eindhoven, available as &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://alexandria.tue.nl/repository/books/252901.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;pdf reprint&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:55 --&gt; .&lt;br /&gt;
&lt;br /&gt;
A 64-bit De Bruijn sequence contains 64-overlapped unique 6-bit sequences, thus a circle of 64 bits, where five leading zeros overlap five hidden &amp;quot;trailing&amp;quot; zeros. There are 2&lt;span style=&quot;vertical-align: super;
font-size: 80%;&quot;&gt;26&lt;/span&gt; = 67108864 odd sequences with 6 leading binary zeros and 2&lt;span style=&quot;vertical-align: super;
font-size: 80%;&quot;&gt;26&lt;/span&gt; even sequences with 5 leading binary zeros, which may be calculated from the odd ones by shifting left one. &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:169:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Bitscan forward-De Bruijn Multiplication-With isolated LS1B&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:169 --&gt;With isolated LS1B&lt;/h3&gt;
A multiplication with a power of two value (the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BIsolation&quot;&gt;isolated LS1B&lt;/a&gt;) acts like a left shift by it&#039;s exponent. Thus, if we multiply a 64-bit De Bruijn sequence with the isolated LS1B, we get a unique six bit subsequence inside the most significant bits. To obtain the bit-index we need to extract these upper six bits by shifting right the product, to lookup an &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;array&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;const int index64[64] = {&amp;lt;br/&amp;gt;    0,  1, 48,  2, 57, 49, 28,  3,&amp;lt;br/&amp;gt;   61, 58, 50, 42, 38, 29, 17,  4,&amp;lt;br/&amp;gt;   62, 55, 59, 36, 53, 51, 43, 22,&amp;lt;br/&amp;gt;   45, 39, 33, 30, 24, 18, 12,  5,&amp;lt;br/&amp;gt;   63, 47, 56, 27, 60, 41, 37, 16,&amp;lt;br/&amp;gt;   54, 35, 52, 21, 44, 32, 23, 11,&amp;lt;br/&amp;gt;   46, 26, 40, 15, 34, 20, 31, 10,&amp;lt;br/&amp;gt;   25, 14, 19,  9, 13,  8,  7,  6&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanForward&amp;lt;br/&amp;gt; * @author Martin Läuter (1997)&amp;lt;br/&amp;gt; *         Charles E. Leiserson&amp;lt;br/&amp;gt; *         Harald Prokop&amp;lt;br/&amp;gt; *         Keith H. Randall&amp;lt;br/&amp;gt; * &amp;amp;quot;Using de Bruijn Sequences to Index a 1 in a Computer Word&amp;amp;quot;&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @precondition bb != 0&amp;lt;br/&amp;gt; * @return index (0..63) of least significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanForward(U64 bb) {&amp;lt;br/&amp;gt;   const U64 debruijn64 = C64(0x03f79d71b4cb0a89);&amp;lt;br/&amp;gt;   assert (bb != 0);&amp;lt;br/&amp;gt;   return index64[((bb &amp;amp;amp; -bb) * debruijn64) &amp;amp;gt;&amp;amp;gt; 58];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; index64&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;48&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;57&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;49&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;28&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;61&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;38&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;29&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;17&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;62&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;55&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;59&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;36&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;53&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;51&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;43&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;22&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;45&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;39&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;33&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;18&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;47&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;27&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;41&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;37&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;54&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;35&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;52&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;21&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;44&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;23&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;46&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;34&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;14&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;19&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanForward
 * @author Martin Läuter (1997)
 *         Charles E. Leiserson
 *         Harald Prokop
 *         Keith H. Randall
 * &amp;quot;Using de Bruijn Sequences to Index a 1 in a Computer Word&amp;quot;
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @return index (0..63) of least significant one bit
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 debruijn64 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x03f79d71b4cb0a89&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; index64&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; debruijn64&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
See also how to &lt;a class=&quot;wiki_link&quot; href=&quot;/De%20Bruijn%20Sequence%20Generator&quot;&gt;Generate your &amp;quot;private&amp;quot; De Bruijn Bitscan Routine&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:287:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@KimWalisch&amp;quot; title=&amp;quot;Anchor: KimWalisch&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;KimWalisch&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:287 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:171:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Bitscan forward-De Bruijn Multiplication-With separated LS1B&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:171 --&gt;With separated LS1B&lt;/h3&gt;
Instead of the classical &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BIsolation&quot;&gt;LS1B isolation&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Kim%20Walisch&quot;&gt;Kim Walisch&lt;/a&gt; proposed the faster &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ExclusiveOr&quot;&gt;xor&lt;/a&gt; with the ones&#039; decrement. The separation &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BSeparation&quot;&gt;bb ^ (bb-1)&lt;/a&gt; contains all bits set including and below the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;LS1B&lt;/a&gt;. The 2&lt;span style=&quot;vertical-align: super;
font-size: 80%;&quot;&gt;22&lt;/span&gt; (4,194,304) upper De Bruijn sequences of the 2&lt;span style=&quot;vertical-align: super;
font-size: 80%;&quot;&gt;26&lt;/span&gt; available leave unique 6-bit indices. Using LS1B separation takes advantage of the x86 lea instruction, which saves the move instruction and unlike negate, has no data dependency on the flag register. Kim reported a 10 to 15 percent faster execution (compilers: g++-4.7 -O2, clang++-3.1 -O2, x86_64) than the traditional 64-bit De Bruijn bitscan on &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Nehalem_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Nehalem&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Sandy_Bridge_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Sandy Bridge&lt;/a&gt; CPUs. &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;const int index64[64] = {&amp;lt;br/&amp;gt;    0, 47,  1, 56, 48, 27,  2, 60,&amp;lt;br/&amp;gt;   57, 49, 41, 37, 28, 16,  3, 61,&amp;lt;br/&amp;gt;   54, 58, 35, 52, 50, 42, 21, 44,&amp;lt;br/&amp;gt;   38, 32, 29, 23, 17, 11,  4, 62,&amp;lt;br/&amp;gt;   46, 55, 26, 59, 40, 36, 15, 53,&amp;lt;br/&amp;gt;   34, 51, 20, 43, 31, 22, 10, 45,&amp;lt;br/&amp;gt;   25, 39, 14, 33, 19, 30,  9, 24,&amp;lt;br/&amp;gt;   13, 18,  8, 12,  7,  6,  5, 63&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanForward&amp;lt;br/&amp;gt; * @author Kim Walisch (2012)&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @precondition bb != 0&amp;lt;br/&amp;gt; * @return index (0..63) of least significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanForward(U64 bb) {&amp;lt;br/&amp;gt;   const U64 debruijn64 = C64(0x03f79d71b4cb0a89);&amp;lt;br/&amp;gt;   assert (bb != 0);&amp;lt;br/&amp;gt;   return index64[((bb ^ (bb-1)) * debruijn64) &amp;amp;gt;&amp;amp;gt; 58];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; index64&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;47&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;48&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;27&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;57&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;49&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;41&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;37&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;28&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;61&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;54&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;35&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;52&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;21&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;44&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;38&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;29&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;23&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;17&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;62&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;46&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;55&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;59&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;36&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;53&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;34&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;51&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;43&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;22&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;45&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;39&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;14&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;33&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;19&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;18&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanForward
 * @author Kim Walisch (2012)
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @return index (0..63) of least significant one bit
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 debruijn64 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x03f79d71b4cb0a89&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; index64&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; debruijn64&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:288:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@MattTaylorsFoldingtrick&amp;quot; title=&amp;quot;Anchor: MattTaylorsFoldingtrick&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;MattTaylorsFoldingtrick&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:288 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:173:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Bitscan forward-Matt Taylor&#039;s Folding trick&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:173 --&gt;Matt Taylor&#039;s Folding trick&lt;/h2&gt;
 A 32-bit friendly implementation to find the the bit-index of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;LS1B&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Matt%20Taylor&quot;&gt;Matt Taylor&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:59:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/de9546cd019bd72b/f46209f47d2a7ddb?lnk=gst&amp;amp;amp;q=Matt+Taylor+magic#f46209f47d2a7ddb&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Bit magic&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Matt%20Taylor&amp;quot;&amp;gt;Matt Taylor&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://groups.google.com/group/comp.lang.asm.x86/topics&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;comp.lang.asm.x86&amp;lt;/a&amp;gt;, June 26, 2003&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:59 --&gt;. The &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ExclusiveOr&quot;&gt;xor&lt;/a&gt; with the ones&#039; decrement, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BSeparation&quot;&gt;bb ^ (bb-1)&lt;/a&gt; contains all bits set including and below the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;LS1B&lt;/a&gt;. The 32-bit xor-difference of both halves yields either the complement of the upper half, or the lower half otherwise. Some samples:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;ls1b&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;bb ^ (bb-1)&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;folded&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;63&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0xffffffffffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000000&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;62&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x7fffffffffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x80000000&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;59&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x0fffffffffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0xf0000000&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;32&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000001ffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0xfffffffe&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;31&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000000ffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0xffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;30&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x000000007fffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x7fffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x0000000000000001&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000001&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
Even if this folded &amp;quot;LS1B&amp;quot; contains multiple consecutive one-bits, the multiplication is De Bruijn like. There are only two magic 32-bit constants with the combined property of 32- and 64-bit De Bruijn sequences to apply this &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table#MinimalPerfectHashing&quot;&gt;minimal perfect hashing&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;const int lsb_64_table[64] =&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   63, 30,  3, 32, 59, 14, 11, 33,&amp;lt;br/&amp;gt;   60, 24, 50,  9, 55, 19, 21, 34,&amp;lt;br/&amp;gt;   61, 29,  2, 53, 51, 23, 41, 18,&amp;lt;br/&amp;gt;   56, 28,  1, 43, 46, 27,  0, 35,&amp;lt;br/&amp;gt;   62, 31, 58,  4,  5, 49, 54,  6,&amp;lt;br/&amp;gt;   15, 52, 12, 40,  7, 42, 45, 16,&amp;lt;br/&amp;gt;   25, 57, 48, 13, 10, 39,  8, 44,&amp;lt;br/&amp;gt;   20, 47, 38, 22, 17, 37, 36, 26&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanForward&amp;lt;br/&amp;gt; * @author Matt Taylor (2003)&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @precondition bb != 0&amp;lt;br/&amp;gt; * @return index (0..63) of least significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanForward(U64 bb) {&amp;lt;br/&amp;gt;   unsigned int folded;&amp;lt;br/&amp;gt;   assert (bb != 0);&amp;lt;br/&amp;gt;   bb ^= bb - 1;&amp;lt;br/&amp;gt;   folded = (int) bb ^ (bb &amp;amp;gt;&amp;amp;gt; 32);&amp;lt;br/&amp;gt;   return lsb_64_table[folded * 0x78291ACF &amp;amp;gt;&amp;amp;gt; 26];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; lsb_64_table&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;59&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;14&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;33&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;55&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;19&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;21&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;34&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;61&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;29&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;53&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;51&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;23&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;41&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;18&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;28&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;43&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;46&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;27&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;35&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;62&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;49&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;54&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;52&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;45&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;57&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;48&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;39&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;44&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;47&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;38&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;22&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;17&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;37&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;36&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanForward
 * @author Matt Taylor (2003)
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @return index (0..63) of least significant one bit
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; folded&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   bb &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   folded &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; lsb_64_table&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;folded &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x78291ACF&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;A slightly modified version may take one &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt;-register less in 32-bit mode, but calculates bb-1 twice:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int bitScanForwardM(BitBoard bb) {&amp;lt;br/&amp;gt;   unsigned int folded;&amp;lt;br/&amp;gt;   assert (bb != 0);&amp;lt;br/&amp;gt;   folded  = (int)((bb ^ (bb-1)) &amp;amp;gt;&amp;amp;gt; 32);&amp;lt;br/&amp;gt;   folded ^= (int)( bb ^ (bb-1)); // lea&amp;lt;br/&amp;gt;   return lsb_64_table[folded * 0x78291ACF &amp;amp;gt;&amp;amp;gt; 26];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForwardM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;BitBoard bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; folded&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   folded  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   folded &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// lea&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; lsb_64_table&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;folded &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x78291ACF&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;with this VC6 generated &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly&quot;&gt;assembly&lt;/a&gt; to compare:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;bitScanForward PROC NEAR                   bitScanForwardM PROC NEAR&amp;lt;br/&amp;gt;   mov  ecx, DWORD PTR _bb$[esp-4]            mov  eax, DWORD PTR _bb$[esp-4]&amp;lt;br/&amp;gt;   mov  eax, DWORD PTR _bb$[esp]              mov  ecx, eax&amp;lt;br/&amp;gt;   mov  edx, ecx                              add  ecx, -1&amp;lt;br/&amp;gt;   push esi                                   mov  ecx, DWORD PTR _bb$[esp]&amp;lt;br/&amp;gt;   add  edx, -1                               mov  edx, ecx&amp;lt;br/&amp;gt;   mov  esi, eax                              adc  edx, -1&amp;lt;br/&amp;gt;   adc  esi, -1                               xor  edx, ecx&amp;lt;br/&amp;gt;   xor  ecx, edx                              lea  ecx, DWORD PTR [eax-1]&amp;lt;br/&amp;gt;   xor  eax, esi                              xor  edx, ecx&amp;lt;br/&amp;gt;   pop  esi&amp;lt;br/&amp;gt;   xor  eax, ecx                              xor  edx, eax&amp;lt;br/&amp;gt;   imul eax, 78291acfH                        imul edx, 78291acfH&amp;lt;br/&amp;gt;   shr  eax, 26                               shr  edx, 26&amp;lt;br/&amp;gt;   mov  eax, DWORD PTR _lsb_64_table[eax*4]   mov  eax, DWORD PTR _lsb_64_table[edx*4]&amp;lt;br/&amp;gt;   ret  0                                     ret  0&amp;lt;br/&amp;gt;bitScanForward ENDP                        bitScanForward ENDP&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;bitScanForward PROC NEAR                   bitScanForwardM PROC NEAR
   mov  ecx, DWORD PTR _bb$[esp-4]            mov  eax, DWORD PTR _bb$[esp-4]
   mov  eax, DWORD PTR _bb$[esp]              mov  ecx, eax
   mov  edx, ecx                              add  ecx, -1
   push esi                                   mov  ecx, DWORD PTR _bb$[esp]
   add  edx, -1                               mov  edx, ecx
   mov  esi, eax                              adc  edx, -1
   adc  esi, -1                               xor  edx, ecx
   xor  ecx, edx                              lea  ecx, DWORD PTR [eax-1]
   xor  eax, esi                              xor  edx, ecx
   pop  esi
   xor  eax, ecx                              xor  edx, eax
   imul eax, 78291acfH                        imul edx, 78291acfH
   shr  eax, 26                               shr  edx, 26
   mov  eax, DWORD PTR _lsb_64_table[eax*4]   mov  eax, DWORD PTR _lsb_64_table[edx*4]
   ret  0                                     ret  0
bitScanForward ENDP                        bitScanForward ENDP&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:289:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@WalterFaxonsmagicBitscan&amp;quot; title=&amp;quot;Anchor: WalterFaxonsmagicBitscan&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;WalterFaxonsmagicBitscan&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:289 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:175:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Bitscan forward-Walter Faxon&#039;s magic Bitscan&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:175 --&gt;Walter Faxon&#039;s magic Bitscan&lt;/h2&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/Walter%20Faxon&quot;&gt;Walter Faxon&#039;s&lt;/a&gt; 32-bit friendly magic bitscan &lt;!-- ws:start:WikiTextRefRule:63:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=265635&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Another hacky method for bitboard bit extraction&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Walter%20Faxon&amp;quot;&amp;gt;Walter Faxon&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, November 17, 2002&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-8&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:63 --&gt; uses a fast none minimal &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table#PerfectHashing&quot;&gt;perfect hashing&lt;/a&gt; function:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;const char LSB_64_table[154] =&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;#define __ 0&amp;lt;br/&amp;gt;   22,__,__,__,30,__,__,38,18,__, 16,15,17,__,46, 9,19, 8, 7,10,&amp;lt;br/&amp;gt;   0, 63, 1,56,55,57, 2,11,__,58, __,__,20,__, 3,__,__,59,__,__,&amp;lt;br/&amp;gt;   __,__,__,12,__,__,__,__,__,__, 4,__,__,60,__,__,__,__,__,__,&amp;lt;br/&amp;gt;   __,__,__,__,21,__,__,__,29,__, __,37,__,__,__,13,__,__,45,__,&amp;lt;br/&amp;gt;   __,__, 5,__,__,61,__,__,__,53, __,__,__,__,__,__,__,__,__,__,&amp;lt;br/&amp;gt;   28,__,__,36,__,__,__,__,__,__, 44,__,__,__,__,__,27,__,__,35,&amp;lt;br/&amp;gt;   __,52,__,__,26,__,43,34,25,23, 24,33,31,32,42,39,40,51,41,14,&amp;lt;br/&amp;gt;   __,49,47,48,__,50, 6,__,__,62, __,__,__,54&amp;lt;br/&amp;gt;#undef __&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanForward&amp;lt;br/&amp;gt; * @author Walter Faxon, slightly modified&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @precondition bb != 0&amp;lt;br/&amp;gt; * @return index (0..63) of least significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanForward(U64 bb)&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   unsigned int t32;&amp;lt;br/&amp;gt;   assert(bb);&amp;lt;br/&amp;gt;   bb  ^= bb - 1;&amp;lt;br/&amp;gt;   t32  = (int)bb ^ (int)(bb &amp;amp;gt;&amp;amp;gt; 32);&amp;lt;br/&amp;gt;   t32 ^= 0x01C5FC81;&amp;lt;br/&amp;gt;   t32 +=  t32 &amp;amp;gt;&amp;amp;gt; 16;&amp;lt;br/&amp;gt;   t32 -= (t32 &amp;amp;gt;&amp;amp;gt; 8) + 51;&amp;lt;br/&amp;gt;   return LSB_64_table [t32 &amp;amp;amp; 255]; // 0..63&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; LSB_64_table&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;154&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#define __ 0&lt;/span&gt;
   &lt;span class=&quot;nu0&quot;&gt;22&lt;/span&gt;,__,__,__,&lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;,__,__,&lt;span class=&quot;nu0&quot;&gt;38&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;18&lt;/span&gt;,__, &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;17&lt;/span&gt;,__,&lt;span class=&quot;nu0&quot;&gt;46&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;19&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;55&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;57&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;,__,&lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;, __,__,&lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;,__, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;,__,__,&lt;span class=&quot;nu0&quot;&gt;59&lt;/span&gt;,__,__,
   __,__,__,&lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;,__,__,__,__,__,__, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;,__,__,&lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;,__,__,__,__,__,__,
   __,__,__,__,&lt;span class=&quot;nu0&quot;&gt;21&lt;/span&gt;,__,__,__,&lt;span class=&quot;nu0&quot;&gt;29&lt;/span&gt;,__, __,&lt;span class=&quot;nu0&quot;&gt;37&lt;/span&gt;,__,__,__,&lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;,__,__,&lt;span class=&quot;nu0&quot;&gt;45&lt;/span&gt;,__,
   __,__, &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;,__,__,&lt;span class=&quot;nu0&quot;&gt;61&lt;/span&gt;,__,__,__,&lt;span class=&quot;nu0&quot;&gt;53&lt;/span&gt;, __,__,__,__,__,__,__,__,__,__,
   &lt;span class=&quot;nu0&quot;&gt;28&lt;/span&gt;,__,__,&lt;span class=&quot;nu0&quot;&gt;36&lt;/span&gt;,__,__,__,__,__,__, &lt;span class=&quot;nu0&quot;&gt;44&lt;/span&gt;,__,__,__,__,__,&lt;span class=&quot;nu0&quot;&gt;27&lt;/span&gt;,__,__,&lt;span class=&quot;nu0&quot;&gt;35&lt;/span&gt;,
   __,&lt;span class=&quot;nu0&quot;&gt;52&lt;/span&gt;,__,__,&lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;,__,&lt;span class=&quot;nu0&quot;&gt;43&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;34&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;23&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;33&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;39&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;51&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;41&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;14&lt;/span&gt;,
   __,&lt;span class=&quot;nu0&quot;&gt;49&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;47&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;48&lt;/span&gt;,__,&lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;,__,__,&lt;span class=&quot;nu0&quot;&gt;62&lt;/span&gt;, __,__,__,&lt;span class=&quot;nu0&quot;&gt;54&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#undef __&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanForward
 * @author Walter Faxon, slightly modified
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @return index (0..63) of least significant one bit
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; t32&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   bb  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   t32  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   t32 &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x01C5FC81&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   t32 &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  t32 &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   t32 &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;t32 &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;51&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; LSB_64_table &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;t32 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 0..63&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;A slightly modified version may take one &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt;-register less in 32-bit mode, but calculates bb-1 twice:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int bitScanForward(U64 bb)&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   int t32 = 0x01C5FC81;&amp;lt;br/&amp;gt;   assert(bb);&amp;lt;br/&amp;gt;   t32 ^= (int)((bb ^ (bb-1)) &amp;amp;gt;&amp;amp;gt; 32);&amp;lt;br/&amp;gt;   t32 ^= (int)( bb ^ (bb-1)); // lea&amp;lt;br/&amp;gt;   t32 += t32 &amp;amp;gt;&amp;amp;gt; 16;&amp;lt;br/&amp;gt;   t32 -=(t32 &amp;amp;gt;&amp;amp;gt;  8) + 51;&amp;lt;br/&amp;gt;   return LSB_64_table [t32 &amp;amp;amp; 255];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; t32 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x01C5FC81&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   t32 &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   t32 &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// lea&lt;/span&gt;
   t32 &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; t32 &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   t32 &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;t32 &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;51&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; LSB_64_table &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;t32 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;The initial &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BSeparation&quot;&gt;LS1B separation&lt;/a&gt; by bb ^ (bb-1) and folding is equivalent to &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#MattTaylorsFoldingtrick&quot;&gt;Matt&#039;s&lt;/a&gt;,&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;ls1b&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;bb ^ (bb-1)&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;folded&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;63&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0xffffffffffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000000&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;62&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x7fffffffffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x80000000&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;59&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x0fffffffffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0xf0000000&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;32&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000001ffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0xfffffffe&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;31&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000000ffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0xffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;30&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x000000007fffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x7fffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x0000000000000001&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000001&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

while Walter originally resets the LS1B, yielding in a cyclic index wrap:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;LS1B&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;(bb &amp;amp; (bb-1)) ^ (bb-1)&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;folded&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x0000000000000000&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000000&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;63&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x7fffffffffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x80000000&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;60&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x0fffffffffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0xf0000000&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;33&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000001ffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0xfffffffe&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;32&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000000ffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0xffffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;31&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x000000007fffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x7fffffff&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x0000000000000001&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;tt&gt;0x00000001&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextAnchorRule:290:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BitscanByModulo&amp;quot; title=&amp;quot;Anchor: BitscanByModulo&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BitscanByModulo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:290 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:177:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Bitscan forward-Bitscan by Modulo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:177 --&gt;Bitscan by Modulo&lt;/h2&gt;
 Another idea is to apply a &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Modulo&quot;&gt;modulo&lt;/a&gt; (remainder of a division) operation of the isolated &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;LS1B&lt;/a&gt; by the prime number 67 &lt;!-- ws:start:WikiTextRefRule:67:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/d5dbf08c66e83517#&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;bitboard 2^i mod 67 is unique&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Stefan%20Plenkner&amp;quot;&amp;gt;Stefan Plenkner&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;rgcc&amp;lt;/a&amp;gt;, August 6, 1996&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-9&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-9&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:67 --&gt; &lt;!-- ws:start:WikiTextRefRule:76:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Pablo%20San%20Segundo&amp;quot;&amp;gt;Pablo San Segundo&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Ram%C3%B3n%20Gal%C3%A1n&amp;quot;&amp;gt;Ramón Galán&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2005&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.actapress.com/Abstract.aspx?paperId=18953&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Bitboards: A New Approach&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.informatik.uni-trier.de/%7Eley/db/conf/aia/aia2005.html#SegundoG05&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AIA 2005&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-10&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-10&quot;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:76 --&gt; . The remainder 0..66 can be used to &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table#PerfectHashing&quot;&gt;perfectly hash&lt;/a&gt; the bit-index table. Three gaps are 0, 17, and 34, so the mod 67 can make a branchless trailing zero count:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;Bit-Index&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Bitboard&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;mod 67&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;-&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000001&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000002&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;2&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000004&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;4&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;3&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000008&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;8&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;4&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000010&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;16&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;5&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000020&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;6&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000040&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;64&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;7&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000080&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;61&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;8&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000100&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;55&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;9&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000200&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;43&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;10&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000400&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;19&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;11&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000000800&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;38&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;12&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000001000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;9&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;13&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000002000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;18&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;14&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000004000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;36&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;15&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000008000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;5&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;16&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000010000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;10&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;17&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000020000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;20&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;18&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000040000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;40&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;19&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000080000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;13&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;20&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000100000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;26&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;21&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000200000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;52&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;22&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000400000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;37&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;23&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000000800000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;7&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;24&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000001000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;14&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;25&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000002000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;28&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;26&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000004000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;56&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;27&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000008000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;45&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;28&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000010000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;23&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;29&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000020000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;46&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;30&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000040000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;25&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;31&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000080000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;50&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;32&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000100000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;33&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;33&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000200000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;66&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;34&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000400000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;65&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;35&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000000800000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;63&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;36&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000001000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;59&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;37&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000002000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;51&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;38&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000004000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;35&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;39&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000008000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;40&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000010000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;6&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;41&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000020000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;12&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;42&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000040000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;24&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;43&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000080000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;48&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;44&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000100000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;29&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;45&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000200000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;58&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;46&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000400000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;49&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;47&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0000800000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;31&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;48&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0001000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;62&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;49&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0002000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;57&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;50&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0004000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;47&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;51&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0008000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;27&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;52&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0010000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;54&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;53&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0020000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;41&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;54&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0040000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;15&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;55&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0080000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;30&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;56&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0100000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;60&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;57&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0200000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;53&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;58&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0400000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;39&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;59&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x0800000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;11&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;60&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x1000000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;22&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;61&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x2000000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;44&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;62&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x4000000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;21&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;63&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x8000000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;42&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt; * trailingZeroCount&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @return index (0..63) of least significant one bit, 64 if bb is zero&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int trailingZeroCount(U64 bb) {&amp;lt;br/&amp;gt;   static const int lookup67[67+1] = {&amp;lt;br/&amp;gt;      64,  0,  1, 39,  2, 15, 40, 23,&amp;lt;br/&amp;gt;       3, 12, 16, 59, 41, 19, 24, 54,&amp;lt;br/&amp;gt;       4, -1, 13, 10, 17, 62, 60, 28,&amp;lt;br/&amp;gt;      42, 30, 20, 51, 25, 44, 55, 47,&amp;lt;br/&amp;gt;       5, 32, -1, 38, 14, 22, 11, 58,&amp;lt;br/&amp;gt;      18, 53, 63,  9, 61, 27, 29, 50,&amp;lt;br/&amp;gt;      43, 46, 31, 37, 21, 57, 52,  8,&amp;lt;br/&amp;gt;      26, 49, 45, 36, 56,  7, 48, 35,&amp;lt;br/&amp;gt;       6, 34, 33, -1 };&amp;lt;br/&amp;gt;   return lookup67[(bb &amp;amp;amp; -bb) % 67];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * trailingZeroCount
 * @param bb bitboard to scan
 * @return index (0..63) of least significant one bit, 64 if bb is zero
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; trailingZeroCount&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; lookup67&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;67&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;39&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;23&lt;/span&gt;,
       &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;59&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;41&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;19&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;54&lt;/span&gt;,
       &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;17&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;62&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;28&lt;/span&gt;,
      &lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;51&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;44&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;55&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;47&lt;/span&gt;,
       &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;, &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;38&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;14&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;22&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;,
      &lt;span class=&quot;nu0&quot;&gt;18&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;53&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;61&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;27&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;29&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;,
      &lt;span class=&quot;nu0&quot;&gt;43&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;46&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;37&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;21&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;57&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;52&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;,
      &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;49&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;45&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;36&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;48&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;35&lt;/span&gt;,
       &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;34&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;33&lt;/span&gt;, &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; lookup67&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;67&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;Since div/mod is an expensive instruction, a &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Modulo&quot;&gt;modulo by a constant&lt;/a&gt; is likely replaced by reciprocal fixed point multiplication to get the quotient and a second multiplication and difference to get the remainder. Compared with De Bruijn multiplication it is still too slow.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:179:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc10&quot;&gt;&lt;a name=&quot;Bitscan forward-Divide and Conquer&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:179 --&gt;Divide and Conquer&lt;/h2&gt;
 This is a broad group of bitscans that test in succession, like the trailing zero count based on &lt;a class=&quot;wiki_link&quot; href=&quot;/Reinhard%20Scharnagl&quot;&gt;Reinhard Scharnagl&#039;s&lt;/a&gt; proposal &lt;!-- ws:start:WikiTextRefRule:80:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;amp;t=3141&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Best BitBoard LSB funktion?&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Reinhard%20Scharnagl&amp;quot;&amp;gt;Reinhard Scharnagl&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Programming Forum&amp;lt;/a&amp;gt;, July 20, 2005&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-11&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-11&quot;&gt;[11]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:80 --&gt; :&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt; * trailingZeroCount&amp;lt;br/&amp;gt; *  like bitScanForward for none empty sets&amp;lt;br/&amp;gt; * @author Reinhard Scharnagl&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @return index (0..64)&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;unsigned char lsbRS[256] = {&amp;lt;br/&amp;gt;    8, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,&amp;lt;br/&amp;gt;    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;int trailingZeroCount(U64 b) {&amp;lt;br/&amp;gt;  unsigned buf;&amp;lt;br/&amp;gt;  int acc = 0;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;  if ((buf = (unsigned)b) == 0) {&amp;lt;br/&amp;gt;    buf = (unsigned)(b &amp;amp;gt;&amp;amp;gt; 32);&amp;lt;br/&amp;gt;    acc = 32;&amp;lt;br/&amp;gt;  }&amp;lt;br/&amp;gt;  if ((unsigned short)buf == 0) {&amp;lt;br/&amp;gt;    buf &amp;amp;gt;&amp;amp;gt;= 16;&amp;lt;br/&amp;gt;    acc += 16;&amp;lt;br/&amp;gt;  }&amp;lt;br/&amp;gt;  if ((unsigned char)buf == 0) {&amp;lt;br/&amp;gt;    buf &amp;amp;gt;&amp;amp;gt;= 8;&amp;lt;br/&amp;gt;    acc += 8;&amp;lt;br/&amp;gt;  }&amp;lt;br/&amp;gt;  return acc + lsbRS[buf &amp;amp;amp; 0xff];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * trailingZeroCount
 *  like bitScanForward for none empty sets
 * @author Reinhard Scharnagl
 * @param bb bitboard to scan
 * @return index (0..64)
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; lsbRS&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,
    &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; trailingZeroCount&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; buf&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; acc &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
  &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;buf &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    buf &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    acc &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;buf &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    buf &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    acc &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;buf &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    buf &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    acc &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; acc &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; lsbRS&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;buf &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;What about direct calculation? On &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; this is a chain of test, set and lea instructions:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanForward&amp;lt;br/&amp;gt; * @author Gerd Isenberg&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @precondition bb != 0&amp;lt;br/&amp;gt; * @return index (0..63) of least significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanForward(U64 bb) {&amp;lt;br/&amp;gt;   unsigned int lsb;&amp;lt;br/&amp;gt;   assert (bb != 0);&amp;lt;br/&amp;gt;   bb &amp;amp;amp;= -bb; // LS1B-Isolation&amp;lt;br/&amp;gt;   lsb = (unsigned)bb&amp;lt;br/&amp;gt;       | (unsigned)(bb&amp;amp;gt;&amp;amp;gt;32);&amp;lt;br/&amp;gt;   return (((((((((((unsigned)(bb&amp;amp;gt;&amp;amp;gt;32) !=0)  * 2)&amp;lt;br/&amp;gt;                 + ((lsb &amp;amp;amp; 0xffff0000) !=0)) * 2)&amp;lt;br/&amp;gt;                 + ((lsb &amp;amp;amp; 0xff00ff00) !=0)) * 2)&amp;lt;br/&amp;gt;                 + ((lsb &amp;amp;amp; 0xf0f0f0f0) !=0)) * 2)&amp;lt;br/&amp;gt;                 + ((lsb &amp;amp;amp; 0xcccccccc) !=0)) * 2)&amp;lt;br/&amp;gt;                 + ((lsb &amp;amp;amp; 0xaaaaaaaa) !=0);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanForward
 * @author Gerd Isenberg
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @return index (0..63) of least significant one bit
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; lsb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// LS1B-Isolation&lt;/span&gt;
   lsb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;bb
       &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                 &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lsb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xffff0000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                 &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lsb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff00ff00&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                 &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lsb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xf0f0f0f0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                 &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lsb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xcccccccc&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                 &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lsb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xaaaaaaaa&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:291:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@DoubleConversionofLS1B&amp;quot; title=&amp;quot;Anchor: DoubleConversionofLS1B&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;DoubleConversionofLS1B&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:291 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:181:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc11&quot;&gt;&lt;a name=&quot;Bitscan forward-Double conversion of LS1B&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:181 --&gt;Double conversion of LS1B&lt;/h2&gt;
 Assuming 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Double&quot;&gt;doubles&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/little-endian&quot;&gt;little-endian&lt;/a&gt; structure (&lt;em&gt;not portable&lt;/em&gt;). We convert the isolated &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;LS1B&lt;/a&gt; to a double and interprete the exponent:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanForward&amp;lt;br/&amp;gt; * @author Gerd Isenberg&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @return index (0..63) of least significant one bit&amp;lt;br/&amp;gt; *         -1023 if passing zero&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanForward(U64 bb)&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   union {&amp;lt;br/&amp;gt;      double d;&amp;lt;br/&amp;gt;      struct {&amp;lt;br/&amp;gt;         unsigned int mantissal : 32;&amp;lt;br/&amp;gt;         unsigned int mantissah : 20;&amp;lt;br/&amp;gt;         unsigned int exponent : 11;&amp;lt;br/&amp;gt;         unsigned int sign : 1;&amp;lt;br/&amp;gt;      };&amp;lt;br/&amp;gt;   } ud;&amp;lt;br/&amp;gt;   ud.d = (double)(bb &amp;amp;amp; -bb); // isolated LS1B to double&amp;lt;br/&amp;gt;   return ud.exponent - 1023;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanForward
 * @author Gerd Isenberg
 * @param bb bitboard to scan
 * @return index (0..63) of least significant one bit
 *         -1023 if passing zero
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;union&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      &lt;span class=&quot;kw4&quot;&gt;double&lt;/span&gt; d&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
         &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; mantissal &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; mantissah &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; exponent &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sign &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; ud&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   ud.&lt;span class=&quot;me1&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;double&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// isolated LS1B to double&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; ud.&lt;span class=&quot;me1&quot;&gt;exponent&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1023&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:183:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc12&quot;&gt;&lt;a name=&quot;Bitscan forward-Index of LS1B by Popcount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:183 --&gt;Index of LS1B by Popcount&lt;/h2&gt;
 If we have a fast &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;population-count&lt;/a&gt; instruction, we can count the trailing zeros of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;LS1B&lt;/a&gt; after subtracting one:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;// precondition bb != 0&amp;lt;br/&amp;gt;int bitScanForward(U64 bb) {&amp;lt;br/&amp;gt;   assert (bb != 0);&amp;lt;br/&amp;gt;   return popCount( (bb &amp;amp;amp; -bb) - 1 );&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// precondition bb != 0&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; popCount&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:292:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Bitscanreverse&amp;quot; title=&amp;quot;Anchor: Bitscanreverse&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Bitscanreverse&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:292 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:185:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc13&quot;&gt;&lt;a name=&quot;Bitscan reverse&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:185 --&gt;Bitscan reverse&lt;/h1&gt;
 A bitscan &lt;strong&gt;reverse&lt;/strong&gt; is used to find the index of the &lt;strong&gt;most&lt;/strong&gt; significant 1 bit (&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheMostSignificantOneBitMS1B&quot;&gt;MS1B&lt;/a&gt;). For non empty sets it is equivalent to &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Floor_and_ceiling_functions&quot; rel=&quot;nofollow&quot;&gt;floor&lt;/a&gt; of the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Binary_logarithm&quot; rel=&quot;nofollow&quot;&gt;base-2 logarithm&lt;/a&gt;. MS1B isolalation or separation is more expensive than LS1B isolalation or separation, due to the LS1B related &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheTwosComplement&quot;&gt;Two&#039;s complement&lt;/a&gt; tricks are not applicable. However, beside Divide and Conquer and Double conversion, Bitscan reverse with MS1B separation is mentioned.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:187:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc14&quot;&gt;&lt;a name=&quot;Bitscan reverse-Divide and Conquer&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:187 --&gt;Divide and Conquer&lt;/h2&gt;
 As introduced by &lt;a class=&quot;wiki_link&quot; href=&quot;/Eugene%20Nalimov&quot;&gt;Eugene Nalimov&lt;/a&gt; in 2000, for an &lt;a class=&quot;wiki_link&quot; href=&quot;/Itanium&quot;&gt;IA-64&lt;/a&gt; version of &lt;a class=&quot;wiki_link&quot; href=&quot;/Crafty&quot;&gt;Crafty&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:84:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=124712&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Will the Itanium have a BSF or BSR instruction?&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Eugene%20Nalimov&amp;quot;&amp;gt;Eugene Nalimov&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, August 16, 2000&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-12&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-12&quot;&gt;[12]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:84 --&gt; &lt;!-- ws:start:WikiTextRefRule:88:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=38777&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;ms1bTable array in Eugene Nalimovs bitScanReverse&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Stef%20Luijten&amp;quot;&amp;gt;Stef Luijten&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, April 17, 2011&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-13&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-13&quot;&gt;[13]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:88 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanReverse&amp;lt;br/&amp;gt; * @author Eugene Nalimov&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @return index (0..63) of most significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanReverse(U64 bb)&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   int result = 0;&amp;lt;br/&amp;gt;   if (bb &amp;amp;gt; 0xFFFFFFFF) {&amp;lt;br/&amp;gt;      bb &amp;amp;gt;&amp;amp;gt;= 32;&amp;lt;br/&amp;gt;      result = 32;&amp;lt;br/&amp;gt;   }&amp;lt;br/&amp;gt;   if (bb &amp;amp;gt; 0xFFFF) {&amp;lt;br/&amp;gt;      bb &amp;amp;gt;&amp;amp;gt;= 16;&amp;lt;br/&amp;gt;      result += 16;&amp;lt;br/&amp;gt;   }&amp;lt;br/&amp;gt;   if (bb &amp;amp;gt; 0xFF) {&amp;lt;br/&amp;gt;      bb &amp;amp;gt;&amp;amp;gt;= 8;&amp;lt;br/&amp;gt;      result += 8;&amp;lt;br/&amp;gt;   }&amp;lt;br/&amp;gt;   return result + ms1bTable[bb];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanReverse
 * @author Eugene Nalimov
 * @param bb bitboard to scan
 * @return index (0..63) of most significant one bit
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanReverse&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xFFFFFFFF&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xFFFF&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      result &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xFF&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      result &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; result &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; ms1bTable&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:293:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@FrankZappa&amp;quot; title=&amp;quot;Anchor: FrankZappa&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;FrankZappa&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:293 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:189:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc15&quot;&gt;&lt;a name=&quot;Bitscan reverse-Tribute to Frank Zappa&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:189 --&gt;Tribute to Frank Zappa&lt;/h2&gt;
 A branchless and little bit obfuscated version of the devide and conquer bitScanReverse with in-register-lookup &lt;!-- ws:start:WikiTextRefRule:92:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=472455&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;just another reverse bitscan&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Gerd%20Isenberg&amp;quot;&amp;gt;Gerd Isenberg&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, December 22, 2005&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-14&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-14&quot;&gt;[14]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:92 --&gt; - as tribute to &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#FrankZappa&quot;&gt;Frank Zappa&lt;/a&gt; with identifiers from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Freak_Out!&quot; rel=&quot;nofollow&quot;&gt;Freak Out!&lt;/a&gt; (1966), &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Hot_Rats&quot; rel=&quot;nofollow&quot;&gt;Hot Rats&lt;/a&gt; (1969), &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Waka/Jawaka&quot; rel=&quot;nofollow&quot;&gt;Waka/Jawaka&lt;/a&gt; (1972), &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Sofa_%28Frank_Zappa_song%29&quot; rel=&quot;nofollow&quot;&gt;Sofa&lt;/a&gt; (1975), &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/One_Size_Fits_All_%28Frank_Zappa_album%29&quot; rel=&quot;nofollow&quot;&gt;One Size Fits All&lt;/a&gt; (1975), &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Sheik_Yerbouti&quot; rel=&quot;nofollow&quot;&gt;Sheik Yerbouti&lt;/a&gt; (1979), and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Jazz_from_Hell&quot; rel=&quot;nofollow&quot;&gt;Jazz from Hell&lt;/a&gt; (1986):&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:13:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;typedef unsigned __int64 OneSizeFits;&amp;lt;br/&amp;gt;typedef unsigned int HotRats;&amp;lt;br/&amp;gt;const HotRats s      =   0;&amp;lt;br/&amp;gt;const HotRats heik   = 457;&amp;lt;br/&amp;gt;const HotRats y      =   1;&amp;lt;br/&amp;gt;const HotRats e      =   2;&amp;lt;br/&amp;gt;const HotRats r      =   3;&amp;lt;br/&amp;gt;const HotRats b      =   4;&amp;lt;br/&amp;gt;const HotRats o      =   5;&amp;lt;br/&amp;gt;const HotRats u      =   8;&amp;lt;br/&amp;gt;const HotRats t      =  16;&amp;lt;br/&amp;gt;const HotRats i      =  32;&amp;lt;br/&amp;gt;const HotRats     ka = (1&amp;amp;lt;&amp;amp;lt; 4)-1;&amp;lt;br/&amp;gt;const HotRats   waka = (1&amp;amp;lt;&amp;amp;lt; 8)-1;&amp;lt;br/&amp;gt;const HotRats jawaka = (1&amp;amp;lt;&amp;amp;lt;16)-1;&amp;lt;br/&amp;gt;const HotRats jazzFromHell = 0-(16*3*heik);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;HotRats freakOut(OneSizeFits all) {&amp;lt;br/&amp;gt;   HotRats so,fa;&amp;lt;br/&amp;gt;   fa   = (HotRats)(all &amp;amp;gt;&amp;amp;gt; i);&amp;lt;br/&amp;gt;   so   = (fa!=s)       &amp;amp;lt;&amp;amp;lt; o;&amp;lt;br/&amp;gt;   fa  ^= (HotRats) all &amp;amp;amp; (fa!=s)-y;&amp;lt;br/&amp;gt;   so  ^= (jawaka &amp;amp;lt; fa) &amp;amp;lt;&amp;amp;lt; b;&amp;lt;br/&amp;gt;   fa &amp;amp;gt;&amp;amp;gt;= (jawaka &amp;amp;lt; fa) &amp;amp;lt;&amp;amp;lt; b;&amp;lt;br/&amp;gt;   so  ^= (  waka - fa) &amp;amp;gt;&amp;amp;gt; t    &amp;amp;amp; u;&amp;lt;br/&amp;gt;   fa &amp;amp;gt;&amp;amp;gt;= (  waka - fa) &amp;amp;gt;&amp;amp;gt; t    &amp;amp;amp; u;&amp;lt;br/&amp;gt;   so  ^= (    ka - fa) &amp;amp;gt;&amp;amp;gt; u    &amp;amp;amp; b;&amp;lt;br/&amp;gt;   fa &amp;amp;gt;&amp;amp;gt;= (    ka - fa) &amp;amp;gt;&amp;amp;gt; u    &amp;amp;amp; b;&amp;lt;br/&amp;gt;   so  ^=  jazzFromHell &amp;amp;gt;&amp;amp;gt; e*fa &amp;amp;amp; r;&amp;lt;br/&amp;gt;   return so;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 OneSizeFits&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; HotRats&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats s      &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats heik   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;457&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats y      &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats e      &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats r      &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats b      &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats o      &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats u      &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats t      &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats i      &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats     ka &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats   waka &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats jawaka &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; HotRats jazzFromHell &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;heik&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
HotRats freakOut&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;OneSizeFits all&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   HotRats so,fa&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   fa   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;HotRats&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;all &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; i&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   so   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;fa&lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;       &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; o&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   fa  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;HotRats&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; all &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;fa&lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;y&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   so  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;jawaka &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; fa&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   fa &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;jawaka &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; fa&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   so  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;  waka &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; fa&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; t    &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; u&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   fa &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;  waka &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; fa&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; t    &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; u&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   so  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;    ka &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; fa&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; u    &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   fa &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;    ka &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; fa&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; u    &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   so  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  jazzFromHell &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; e&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;fa &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; r&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; so&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:13 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:294:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@FillDeBruijn&amp;quot; title=&amp;quot;Anchor: FillDeBruijn&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;FillDeBruijn&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:294 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:191:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc16&quot;&gt;&lt;a name=&quot;Bitscan reverse-De Bruijn Multiplication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:191 --&gt;De Bruijn Multiplication&lt;/h2&gt;
While the &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#FrankZappa&quot;&gt;tribute&lt;/a&gt; to &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#FrankZappa&quot;&gt;Frank Zappa&lt;/a&gt; is quite 32-bit friendly &lt;!-- ws:start:WikiTextRefRule:96:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=472762&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;final version - homage to FZ&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Gerd%20Isenberg&amp;quot;&amp;gt;Gerd Isenberg&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, December 23, 2005&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-15&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-15&quot;&gt;[15]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:96 --&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Kim%20Walisch&quot;&gt;Kim Walisch&lt;/a&gt; suggested to use the &lt;a class=&quot;wiki_link&quot; href=&quot;/Parallel%20Prefix%20Algorithms&quot;&gt;parallel prefix fill&lt;/a&gt; for a &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheMostSignificantOneBitMS1B&quot;&gt;MS1B&lt;/a&gt; separation with the same &lt;a class=&quot;wiki_link&quot; href=&quot;/De%20Bruijn%20sequence&quot;&gt;De Bruijn&lt;/a&gt; multiplication and lookup as in his &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#KimWalisch&quot;&gt;bitScanForward&lt;/a&gt; routine with &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BSeparation&quot;&gt;separated LS1B&lt;/a&gt;, with less instructions in 64-bit mode. A log base 2 method was already devised by Eric Cole on January 8, 2006, and shaved off rounded up to one less than the next power of 2 by Mark Dickinson &lt;!-- ws:start:WikiTextRefRule:98:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://ep2012.europython.eu/conference/p/mark-dickinson&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;EuroPython 2012: Florence, July 2–8 | Mark Dickinson&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-16&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-16&quot;&gt;[16]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:98 --&gt; on December 10, 2009, as published in Sean Eron Anderson&#039;s &lt;em&gt;Bit Twiddling Hacks&lt;/em&gt; for 32-bit integers &lt;!-- ws:start:WikiTextRefRule:102:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Find the log base 2 of an N-bit integer in O(lg(N)) operations with multiply and lookup&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://graphics.stanford.edu/%7Eseander/bithacks.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Bit Twiddling Hacks&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://graphics.stanford.edu/%7Eseander/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Sean Eron Anderson&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-17&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-17&quot;&gt;[17]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:102 --&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:14:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;const int index64[64] = {&amp;lt;br/&amp;gt;    0, 47,  1, 56, 48, 27,  2, 60,&amp;lt;br/&amp;gt;   57, 49, 41, 37, 28, 16,  3, 61,&amp;lt;br/&amp;gt;   54, 58, 35, 52, 50, 42, 21, 44,&amp;lt;br/&amp;gt;   38, 32, 29, 23, 17, 11,  4, 62,&amp;lt;br/&amp;gt;   46, 55, 26, 59, 40, 36, 15, 53,&amp;lt;br/&amp;gt;   34, 51, 20, 43, 31, 22, 10, 45,&amp;lt;br/&amp;gt;   25, 39, 14, 33, 19, 30,  9, 24,&amp;lt;br/&amp;gt;   13, 18,  8, 12,  7,  6,  5, 63&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanReverse&amp;lt;br/&amp;gt; * @authors Kim Walisch, Mark Dickinson&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @precondition bb != 0&amp;lt;br/&amp;gt; * @return index (0..63) of most significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanReverse(U64 bb) {&amp;lt;br/&amp;gt;   const U64 debruijn64 = C64(0x03f79d71b4cb0a89);&amp;lt;br/&amp;gt;   assert (bb != 0);&amp;lt;br/&amp;gt;   bb |= bb &amp;amp;gt;&amp;amp;gt; 1; &amp;lt;br/&amp;gt;   bb |= bb &amp;amp;gt;&amp;amp;gt; 2;&amp;lt;br/&amp;gt;   bb |= bb &amp;amp;gt;&amp;amp;gt; 4;&amp;lt;br/&amp;gt;   bb |= bb &amp;amp;gt;&amp;amp;gt; 8;&amp;lt;br/&amp;gt;   bb |= bb &amp;amp;gt;&amp;amp;gt; 16;&amp;lt;br/&amp;gt;   bb |= bb &amp;amp;gt;&amp;amp;gt; 32;&amp;lt;br/&amp;gt;   return index64[(bb * debruijn64) &amp;amp;gt;&amp;amp;gt; 58];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; index64&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;47&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;48&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;27&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;57&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;49&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;41&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;37&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;28&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;61&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;54&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;35&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;52&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;21&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;44&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;38&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;29&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;23&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;17&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;62&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;46&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;55&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;59&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;36&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;53&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;34&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;51&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;43&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;22&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;45&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;25&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;39&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;14&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;33&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;19&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;,
   &lt;span class=&quot;nu0&quot;&gt;13&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;18&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;,  &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanReverse
 * @authors Kim Walisch, Mark Dickinson
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @return index (0..63) of most significant one bit
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanReverse&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 debruijn64 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x03f79d71b4cb0a89&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   bb &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; 
   bb &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   bb &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   bb &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   bb &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   bb &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; index64&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; debruijn64&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:14 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:295:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@DoubleConversionBSR&amp;quot; title=&amp;quot;Anchor: DoubleConversionBSR&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;DoubleConversionBSR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:295 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:193:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc17&quot;&gt;&lt;a name=&quot;Bitscan reverse-Double conversion&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:193 --&gt;Double conversion&lt;/h2&gt;
 Assuming 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Double&quot;&gt;doubles&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/little-endian&quot;&gt;little-endian&lt;/a&gt; structure (&lt;em&gt;not portable&lt;/em&gt;!). Conversion to a double, interpreting the exponent. To avoid possible rounding errors, some lower bits may be cleared.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:15:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanReverse&amp;lt;br/&amp;gt; * @author Gerd Isenberg&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @return index (0..63) of most significant one bit&amp;lt;br/&amp;gt; *         -1023 if passing zero&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanReverse(U64 bb)&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   union {&amp;lt;br/&amp;gt;      double d;&amp;lt;br/&amp;gt;      struct {&amp;lt;br/&amp;gt;         unsigned int mantissal : 32;&amp;lt;br/&amp;gt;         unsigned int mantissah : 20;&amp;lt;br/&amp;gt;         unsigned int exponent : 11;&amp;lt;br/&amp;gt;         unsigned int sign : 1;&amp;lt;br/&amp;gt;      };&amp;lt;br/&amp;gt;   } ud;&amp;lt;br/&amp;gt;   ud.d = (double)(bb &amp;amp;amp; ~(bb &amp;amp;gt;&amp;amp;gt; 32));  // avoid rounding error&amp;lt;br/&amp;gt;   return ud.exponent - 1023;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanReverse
 * @author Gerd Isenberg
 * @param bb bitboard to scan
 * @return index (0..63) of most significant one bit
 *         -1023 if passing zero
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanReverse&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;union&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      &lt;span class=&quot;kw4&quot;&gt;double&lt;/span&gt; d&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
         &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; mantissal &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; mantissah &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; exponent &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
         &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sign &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; ud&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   ud.&lt;span class=&quot;me1&quot;&gt;d&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;double&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// avoid rounding error&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; ud.&lt;span class=&quot;me1&quot;&gt;exponent&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1023&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:15 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:296:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@LeadingZeroCount&amp;quot; title=&amp;quot;Anchor: LeadingZeroCount&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;LeadingZeroCount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:296 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:195:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc18&quot;&gt;&lt;a name=&quot;Bitscan reverse-Leading Zero Count&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:195 --&gt;Leading Zero Count&lt;/h2&gt;
 Some processors have a fast leading zero count instruction. The &lt;a class=&quot;wiki_link&quot; href=&quot;/Motorola&quot;&gt;Motorola&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/68020&quot;&gt;68020&lt;/a&gt; has a &lt;em&gt;bit field find first one&lt;/em&gt; instruction (BFFFO), which actually performs an up to 32-bit &lt;em&gt;Leading Zero Count&lt;/em&gt; &lt;!-- ws:start:WikiTextRefRule:104:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www-scm.tees.ac.uk/users/a.clements/BF/BF.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;68020 Bit Field Instructions&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-18&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-18&quot;&gt;[18]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:104 --&gt; . &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AMD_K10&quot; rel=&quot;nofollow&quot;&gt;K10&lt;/a&gt; has &lt;em&gt;lzcnt&lt;/em&gt; as part of the &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4#SSE4a&quot;&gt;SSE4a&lt;/a&gt; extension &lt;!-- ws:start:WikiTextRefRule:106:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/SSE4#SSE4a&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;SSE4a from Wikipedia&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-19&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-19&quot;&gt;[19]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:106 --&gt; &lt;!-- ws:start:WikiTextRefRule:108:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/bb384809.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;__lzcnt16, __lzcnt, __lzcnt64&amp;lt;/a&amp;gt; Visual C++ Language Reference&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-20&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-20&quot;&gt;[20]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:108 --&gt; , &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt; has &lt;em&gt;lzcnt&lt;/em&gt; as well, while &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512#VPLZCNT&quot;&gt;AVX-512CD&lt;/a&gt; even features leading zero count on vectors of eight bitbaords.&lt;br /&gt;
&lt;br /&gt;
One can replace bitScanReverse of non empty sets by leadingZeroCount xor 63. Like trailing zero count, it returns 64 for empty sets, and might therefor save the leading condition in some applications.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:297:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BitscanversusZeroCount&amp;quot; title=&amp;quot;Anchor: BitscanversusZeroCount&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BitscanversusZeroCount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:297 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:197:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc19&quot;&gt;&lt;a name=&quot;Bitscan versus Zero Count&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:197 --&gt;Bitscan versus Zero Count&lt;/h1&gt;
 While the presented bitscan routines are suited to work only on none empty sets and return a value-range from 0 to 63 as bit-index, leading or trailing zero-count instructions or routines leave 64 for empty sets. Zero-counting has a immanent property of dealing correctly with empty sets - while it likely takes a conditional branch to implement this semantic in bit-scanning.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:16:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int trailingZeroCount(U64 bb) {&amp;lt;br/&amp;gt;    if ( bb )&amp;lt;br/&amp;gt;       return bitScanForward(bb);&amp;lt;br/&amp;gt;    return 64;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;int leadingZeroCount(U64 bb) {&amp;lt;br/&amp;gt;    if ( bb )&amp;lt;br/&amp;gt;       return bitScanReverse(bb) ^ 63;&amp;lt;br/&amp;gt;    return 64;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; trailingZeroCount&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; bb &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
       &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; leadingZeroCount&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; bb &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
       &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; bitScanReverse&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:16 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:298:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BitscanwithReset&amp;quot; title=&amp;quot;Anchor: BitscanwithReset&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BitscanwithReset&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:298 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:199:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc20&quot;&gt;&lt;a name=&quot;Bitscan with Reset&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:199 --&gt;Bitscan with Reset&lt;/h1&gt;
 While &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboard%20Serialization&quot;&gt;traversing sets&lt;/a&gt;, one may combine bitscanning with reset found bit. That implies passing the bitboard per reference or pointer, and tends to confuse compilers to keep all inside registers inside a typical serialization loop &lt;!-- ws:start:WikiTextRefRule:112:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=283655&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Bitscan&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Matt%20Taylor&amp;quot;&amp;gt;Matt Taylor&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, February 11, 2003&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-21&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-21&quot;&gt;[21]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:112 --&gt; .&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:17:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int bitScanForwardWithReset(U64 &amp;amp;amp;bb) { // also called dropForward&amp;lt;br/&amp;gt;    int idx = bitScanForward(bb);&amp;lt;br/&amp;gt;    bb &amp;amp;amp;= bb - 1; // reset bit outside&amp;lt;br/&amp;gt;    return idx;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForwardWithReset&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// also called dropForward&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; idx &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// reset bit outside&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; idx&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:17 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:299:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@GeneralizedBitscan&amp;quot; title=&amp;quot;Anchor: GeneralizedBitscan&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;GeneralizedBitscan&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:299 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:201:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc21&quot;&gt;&lt;a name=&quot;Generalized Bitscan&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:201 --&gt;Generalized Bitscan&lt;/h1&gt;
 This generalized bitscan uses a boolean parameter to scan reverse or forward. It relies on bitScanReverse, but conditionally masks the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;LS1B&lt;/a&gt; in case of scanning forward. It might be used in the &lt;a class=&quot;wiki_link&quot; href=&quot;/Classical%20Approach&quot;&gt;classical approach&lt;/a&gt; to get positive or negative ray directions with one generalized routine.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:18:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt; /**&amp;lt;br/&amp;gt; * generalized bitScan&amp;lt;br/&amp;gt; * @author Gerd Isenberg&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @precondition bb != 0&amp;lt;br/&amp;gt; * @param reverse, true bitScanReverse, false bitScanForward&amp;lt;br/&amp;gt; * @return index (0..63) of least/most significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt; int bitScan(U64 bb, bool reverse) {&amp;lt;br/&amp;gt;    U64 rMask;&amp;lt;br/&amp;gt;    assert (bb != 0);&amp;lt;br/&amp;gt;    rMask = -(U64)reverse;&amp;lt;br/&amp;gt;    bb &amp;amp;amp;= -bb | rMask;&amp;lt;br/&amp;gt;    return bitScanReverse(bb);&amp;lt;br/&amp;gt; }&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt; &lt;span class=&quot;coMULTI&quot;&gt;/**
 * generalized bitScan
 * @author Gerd Isenberg
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @param reverse, true bitScanReverse, false bitScanForward
 * @return index (0..63) of least/most significant one bit
 */&lt;/span&gt;
 &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScan&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb, &lt;span class=&quot;kw4&quot;&gt;bool&lt;/span&gt; reverse&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    U64 rMask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    rMask &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;reverse&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;bb &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; rMask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; bitScanReverse&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:18 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:300:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@bsfbsr&amp;quot; title=&amp;quot;Anchor: bsfbsr&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;bsfbsr&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:300 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:203:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc22&quot;&gt;&lt;a name=&quot;Processor Instructions for Bitscans&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:203 --&gt;Processor Instructions for Bitscans&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:205:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc23&quot;&gt;&lt;a name=&quot;Processor Instructions for Bitscans-x86&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:205 --&gt;x86&lt;/h2&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; processors have &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;bitscan instructions&lt;/a&gt; and can be accessed with compilers today through either &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#InlineAssembly&quot;&gt;inline assembly&lt;/a&gt; or compiler intrinsics. For the Microsoft/Intel C compiler, the intrinsics can be accessed by including and using the instructions &lt;em&gt;_BitScanForward64&lt;/em&gt; &lt;!-- ws:start:WikiTextRefRule:114:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/wfd9z0bb%28v=VS.100%29.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_BitScanForward, _BitScanForward64&amp;lt;/a&amp;gt; Visual C++ Language Reference&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-22&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-22&quot;&gt;[22]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:114 --&gt; , &lt;em&gt;_BitScanReverse64&lt;/em&gt; &lt;!-- ws:start:WikiTextRefRule:116:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/fbxyd7zd%28v=VS.100%29.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_BitScanReverse, _BitScanReverse64&amp;lt;/a&amp;gt; Visual C++ Language Reference&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-23&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-23&quot;&gt;[23]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:116 --&gt; or _lzcnt64 &lt;!-- ws:start:WikiTextRefRule:118:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/bb384809.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;__lzcnt16, __lzcnt, __lzcnt64&amp;lt;/a&amp;gt; Visual C++ Language Reference&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-24&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-24&quot;&gt;[24]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:118 --&gt; .&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:19:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;unsigned char_BitScanForward64(unsigned long * Index,  unsigned __int64 Mask);&amp;lt;br/&amp;gt;unsigned char _BitScanReverse64(unsigned long * Index,  unsigned __int64 Mask);&amp;lt;br/&amp;gt;unsigned __int64 __lzcnt64(unsigned __int64 value); // AMD K10 only see CPUID&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; char_BitScanForward64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; Index,  &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 Mask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; _BitScanReverse64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; Index,  &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 Mask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 __lzcnt64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 value&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// AMD K10 only see CPUID&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:19 --&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Linux&quot;&gt;Linux&lt;/a&gt; provides library functions &lt;!-- ws:start:WikiTextRefRule:120:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://linux.die.net/man/3/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Section 3: library functions - Linux man pages&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-25&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-25&quot;&gt;[25]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:120 --&gt; , find first bit set (ffsll) in a word leaves an index of 1..64, and zero of no bit is set &lt;!-- ws:start:WikiTextRefRule:122:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://linux.die.net/man/3/ffsll&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;ffsll(3): find first bit set in word - Linux man page&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-26&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-26&quot;&gt;[26]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:122 --&gt; . &lt;a class=&quot;wiki_link&quot; href=&quot;/Free%20Software%20Foundation#GCC&quot;&gt;GCC&lt;/a&gt; 4.4.5 further has the Built-in Function &lt;em&gt;_builtin_ffsll&lt;/em&gt; for finding the least significant one bit, &lt;em&gt;_builtin_ctzll&lt;/em&gt; for trailing, and &lt;em&gt;_builtin_clzll&lt;/em&gt; for leading zero count &lt;!-- ws:start:WikiTextRefRule:124:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://gcc.gnu.org/onlinedocs/gcc-4.4.5/gcc/Other-Builtins.html#Other-Builtins&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Other Builtins - Using the GNU Compiler Collection (GCC)&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-27&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-27&quot;&gt;[27]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:124 --&gt; :&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:20:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/* Returns one plus the index of the least significant 1-bit of x, or if x is zero, returns zero */&amp;lt;br/&amp;gt;int __builtin_ffsll (unsigned long long);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/* Returns the number of trailing 0-bits in x, starting at the least significant bit position.&amp;lt;br/&amp;gt;   If x is 0, the result is undefined */&amp;lt;br/&amp;gt;int __builtin_ctzll (unsigned long long);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/* Returns the number of leading 0-bits in x, starting at the most significant bit position.&amp;lt;br/&amp;gt;   If x is 0, the result is undefined */&amp;lt;br/&amp;gt;int __builtin_clzll (unsigned long long);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/* Returns one plus the index of the least significant 1-bit of x, or if x is zero, returns zero */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; __builtin_ffsll &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/* Returns the number of trailing 0-bits in x, starting at the least significant bit position.
   If x is 0, the result is undefined */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; __builtin_ctzll &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/* Returns the number of leading 0-bits in x, starting at the most significant bit position.
   If x is 0, the result is undefined */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; __builtin_clzll &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:20 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:207:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc24&quot;&gt;&lt;a name=&quot;Processor Instructions for Bitscans-x86-Emulating Intrinsics&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:207 --&gt;Emulating Intrinsics&lt;/h3&gt;
 For the GNU C compiler, the intrinsics can be emulated with &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#InlineAssembly&quot;&gt;inline assembly&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:128:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=388787&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Nalimov: bsf/bsr intrinsics implementation still not optimal&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Eugene%20Nalimov&amp;quot;&amp;gt;Eugene Nalimov&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, September 23, 2004&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-28&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-28&quot;&gt;[28]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:128 --&gt; .&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:21:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;//These processor instructions work only for 64-bit processors&amp;lt;br/&amp;gt;#ifdef _MSC_VER&amp;lt;br/&amp;gt;    #include &amp;amp;lt;intrin.h&amp;amp;gt;&amp;lt;br/&amp;gt;    #ifdef _WIN64&amp;lt;br/&amp;gt;        #pragma intrinsic(_BitScanForward64)&amp;lt;br/&amp;gt;        #pragma intrinsic(_BitScanReverse64)&amp;lt;br/&amp;gt;        #define USING_INTRINSICS&amp;lt;br/&amp;gt;    #endif&amp;lt;br/&amp;gt;#elif defined(__GNUC__) &amp;amp;amp;&amp;amp;amp; defined(__LP64__)&amp;lt;br/&amp;gt;    static INLINE unsigned char _BitScanForward64(unsigned long* Index, U64 Mask)&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        U64 Ret;&amp;lt;br/&amp;gt;        __asm__&amp;lt;br/&amp;gt;        (&amp;lt;br/&amp;gt;            &amp;amp;quot;bsfq %[Mask], %[Ret]&amp;amp;quot;&amp;lt;br/&amp;gt;            :[Ret] &amp;amp;quot;=r&amp;amp;quot; (Ret)&amp;lt;br/&amp;gt;            :[Mask] &amp;amp;quot;mr&amp;amp;quot; (Mask)&amp;lt;br/&amp;gt;        );&amp;lt;br/&amp;gt;        *Index = (unsigned long)Ret;&amp;lt;br/&amp;gt;        return Mask?1:0;&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;    static INLINE unsigned char _BitScanReverse64(unsigned long* Index, U64 Mask)&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;        U64 Ret;&amp;lt;br/&amp;gt;        __asm__&amp;lt;br/&amp;gt;        (&amp;lt;br/&amp;gt;            &amp;amp;quot;bsrq %[Mask], %[Ret]&amp;amp;quot;&amp;lt;br/&amp;gt;            :[Ret] &amp;amp;quot;=r&amp;amp;quot; (Ret)&amp;lt;br/&amp;gt;            :[Mask] &amp;amp;quot;mr&amp;amp;quot; (Mask)&amp;lt;br/&amp;gt;        );&amp;lt;br/&amp;gt;        *Index = (unsigned long)Ret;&amp;lt;br/&amp;gt;        return Mask?1:0;&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;    #define USING_INTRINSICS&amp;lt;br/&amp;gt;#endif&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;co1&quot;&gt;//These processor instructions work only for 64-bit processors&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#ifdef _MSC_VER&lt;/span&gt;
    &lt;span class=&quot;co2&quot;&gt;#include &amp;lt;intrin.h&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;co2&quot;&gt;#ifdef _WIN64&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#pragma intrinsic(_BitScanForward64)&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#pragma intrinsic(_BitScanReverse64)&lt;/span&gt;
        &lt;span class=&quot;co2&quot;&gt;#define USING_INTRINSICS&lt;/span&gt;
    &lt;span class=&quot;co2&quot;&gt;#endif&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#elif defined(__GNUC__) &amp;amp;&amp;amp; defined(__LP64__)&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; INLINE &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; _BitScanForward64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; Index, U64 Mask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        U64 Ret&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        __asm__
        &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;
            &lt;span class=&quot;st0&quot;&gt;&amp;quot;bsfq %[Mask], %[Ret]&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Ret&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;=r&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Ret&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Mask&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;mr&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Mask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;Index &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;Ret&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; Mask&lt;span class=&quot;sy4&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; INLINE &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; _BitScanReverse64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; Index, U64 Mask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        U64 Ret&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        __asm__
        &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;
            &lt;span class=&quot;st0&quot;&gt;&amp;quot;bsrq %[Mask], %[Ret]&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Ret&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;=r&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Ret&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;Mask&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;mr&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Mask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;Index &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;Ret&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; Mask&lt;span class=&quot;sy4&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;co2&quot;&gt;#define USING_INTRINSICS&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#endif&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:21 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:209:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc25&quot;&gt;&lt;a name=&quot;Processor Instructions for Bitscans-x86-Intrinsics versus asm&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:209 --&gt;Intrinsics versus asm&lt;/h3&gt;
 Alternatively, rather than to emulate the intrinsics one might use the standard prototype, by using intrinsics or &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#InlineAssembly&quot;&gt;inline assembly&lt;/a&gt; for &lt;a class=&quot;wiki_link&quot; href=&quot;/Free%20Software%20Foundation#GCC&quot;&gt;GCC&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:131:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.jjj.de/fxt/fxtbook.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Matters Computational - ideas, algorithms, source code&amp;lt;/a&amp;gt; (pdf) Ideas and Source Code by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#Arndt&amp;quot;&amp;gt;Jörg Arndt&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-29&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-29&quot;&gt;[29]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:131 --&gt; :&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:22:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;#ifdef USE_X86INTRINSICS&amp;lt;br/&amp;gt;#include &amp;amp;lt;intrin.h&amp;amp;gt;&amp;lt;br/&amp;gt;#pragma intrinsic(_BitScanForward64)&amp;lt;br/&amp;gt;#pragma intrinsic(_BitScanReverse64)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanForward&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @precondition bb != 0&amp;lt;br/&amp;gt; * @return index (0..63) of least significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanForward(U64 x) {&amp;lt;br/&amp;gt;   unsigned long index;&amp;lt;br/&amp;gt;   assert (x != 0);&amp;lt;br/&amp;gt;   _BitScanForward64(&amp;amp;amp;index, x);&amp;lt;br/&amp;gt;   return (int) index;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanReverse&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @precondition bb != 0&amp;lt;br/&amp;gt; * @return index (0..63) of most significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanReverse(U64 x) {&amp;lt;br/&amp;gt;   unsigned long index;&amp;lt;br/&amp;gt;   assert (x != 0);&amp;lt;br/&amp;gt;   _BitScanReverse64(&amp;amp;amp;index, x);&amp;lt;br/&amp;gt;   return (int) index;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;#else&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanForward&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @precondition bb != 0&amp;lt;br/&amp;gt; * @return index (0..63) of least significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanForward(U64 x) {&amp;lt;br/&amp;gt;   assert (x != 0);&amp;lt;br/&amp;gt;   asm (&amp;amp;quot;bsfq %0, %0&amp;amp;quot; : &amp;amp;quot;=r&amp;amp;quot; (x) : &amp;amp;quot;0&amp;amp;quot; (x));&amp;lt;br/&amp;gt;   return (int) x;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/**&amp;lt;br/&amp;gt; * bitScanReverse&amp;lt;br/&amp;gt; * @param bb bitboard to scan&amp;lt;br/&amp;gt; * @precondition bb != 0&amp;lt;br/&amp;gt; * @return index (0..63) of most significant one bit&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int bitScanReverse(U64 x) {&amp;lt;br/&amp;gt;   assert (x != 0);&amp;lt;br/&amp;gt;   asm (&amp;amp;quot;bsrl %0, %0&amp;amp;quot; : &amp;amp;quot;=r&amp;amp;quot; (x) : &amp;amp;quot;0&amp;amp;quot; (x));&amp;lt;br/&amp;gt;   return (int) x;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;#endif&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#ifdef USE_X86INTRINSICS&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#include &amp;lt;intrin.h&amp;gt;&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#pragma intrinsic(_BitScanForward64)&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#pragma intrinsic(_BitScanReverse64)&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanForward
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @return index (0..63) of least significant one bit
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; index&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   _BitScanForward64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;index, x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; index&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanReverse
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @return index (0..63) of most significant one bit
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanReverse&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; index&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   _BitScanReverse64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;index, x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; index&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#else&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanForward
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @return index (0..63) of least significant one bit
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanForward&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   asm &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;bsfq %0, %0&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;=r&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; x&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/**
 * bitScanReverse
 * @param bb bitboard to scan
 * @precondition bb != 0
 * @return index (0..63) of most significant one bit
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; bitScanReverse&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   asm &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;bsrl %0, %0&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;=r&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; x&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#endif&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:22 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:301:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@x86Timing&amp;quot; title=&amp;quot;Anchor: x86Timing&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;x86Timing&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:301 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:211:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc26&quot;&gt;&lt;a name=&quot;Processor Instructions for Bitscans-x86-Bsf/Bsr x86-64 Timings&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:211 --&gt;Bsf/Bsr x86-64 Timings&lt;/h3&gt;
 The instruction latency and reciprocal throughput &lt;!-- ws:start:WikiTextRefRule:134:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.agner.org/optimize/instruction_tables.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Instruction tables, Lists of instruction latencies, throughputs and microoperation breakdowns for Intel and AMD CPU&#039;s&amp;lt;/a&amp;gt; (pdf) by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.agner.org/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Agner Fog&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-30&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-30&quot;&gt;[30]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:134 --&gt; heavily differs between various &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; architectures:&lt;br /&gt;
&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;Architecture Stepping&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Instruction(s)&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Latency / Cycles&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Reciprocal Throughput&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td colspan=&quot;4&quot; style=&quot;text-align: left;&quot;&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Athlon_64&quot; rel=&quot;nofollow&quot;&gt;K8&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:136:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://support.amd.com/us/Processor_TechDocs/25112.PDF&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Software Optimization Guide for AMD64 Processors&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-31&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-31&quot;&gt;[31]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:136 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSF reg16/32/64, mreg16/32/64&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;Vector Path 8/8/9&lt;br /&gt;
&lt;/td&gt;
        &lt;td colspan=&quot;2&quot; style=&quot;text-align: right;&quot;&gt;8/8/9&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSR reg16/32/64, mreg16/32/64&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;Vector Path 11&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;11&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td rowspan=&quot;3&quot;&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AMD_K10&quot; rel=&quot;nofollow&quot;&gt;K10&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:138:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://support.amd.com/us/Processor_TechDocs/40546.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Software Optimization Guide for AMD Family 10h and 12h Processors&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-32&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-32&quot;&gt;[32]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:138 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSF reg, reg&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;Vector Path 4&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;4&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSR reg, reg&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;Vector Path 4&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;4&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4#ABM&quot;&gt;LZCNT&lt;/a&gt; reg, reg&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;Direct Path single 2&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td colspan=&quot;4&quot; style=&quot;text-align: left;&quot;&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:140:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.intel.com/design/processor/manuals/248966.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Intel 64 and IA32 Architectures Optimization Reference Manual&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-33&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-33&quot;&gt;[33]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:140 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_Atom&quot; rel=&quot;nofollow&quot;&gt;ATOM&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSF/BSR&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;16&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;15&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NetBurst_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;NetBurst&lt;/a&gt; 0F_3H&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSF/BSR&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;16&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;4&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;NetBurst 0F_2H&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSF/BSR&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;8&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Core_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Core&lt;/a&gt; 06_0EH&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSF/BSR&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;65 nm Intel Core 06_0FH&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSF/BSR&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Enhanced Intel Core 06_17H&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSF/BSR&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Enhanced Intel Core 06_1DH&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSF/BSR&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Nehalem_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Nehalem&lt;/a&gt; 06_1AH&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSF/BSR&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td rowspan=&quot;3&quot;&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Sandy_Bridge&quot; rel=&quot;nofollow&quot;&gt;Sandy Bridge&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Ivy_Bridge_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Ivy Bridge&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Haswell_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Haswell&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:142:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://users.atw.hu/instlatx64/GenuineIntel00306C3_Haswell_InstLatX64.txt&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Haswell Instructions Latency&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-34&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-34&quot;&gt;[34]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:142 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;BSF/BSR&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1#LZCNT&quot;&gt;LZCNT&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1#LZCNT&quot;&gt;TZCNT&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;3&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:213:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc27&quot;&gt;&lt;a name=&quot;Processor Instructions for Bitscans-x86-Bsf/Bsr behavior with zero source&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:213 --&gt;Bsf/Bsr behavior with zero source&lt;/h3&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; specify different behavior. In praxis there seems no difference so far. However, as long as Intel docs explicitly state content undefined, it is recommend to don&#039;t rely on a pre-initialized content of that target register, if the source is zero.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Intel : &lt;tt&gt;If the content of the source operand is 0, the content of the destination operand is undefined.&lt;/tt&gt; &lt;!-- ws:start:WikiTextRefRule:144:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.intel.com/Assets/PDF/manual/253666.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 2A: Instruction Set Reference, A-M&amp;lt;/a&amp;gt; (pdf) BSF—Bit Scan Forward 3-87&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-35&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-35&quot;&gt;[35]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:144 --&gt;&lt;/li&gt;&lt;li&gt;AMD: &lt;tt&gt;If the second operand contains 0, the instruction sets ZF to 1 and does not change the contents of the destination register.&lt;/tt&gt; &lt;!-- ws:start:WikiTextRefRule:146:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://support.amd.com/us/Processor_TechDocs/24594_APM_v3.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AMD64 Architecture Programmer’s Manual Volume 3: General-Purpose and System Instructions&amp;lt;/a&amp;gt; (pdf) Bit Scan Forward pg. 111&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-36&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-36&quot;&gt;[36]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:146 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:215:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc28&quot;&gt;&lt;a name=&quot;Processor Instructions for Bitscans-ARM&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:215 --&gt;ARM&lt;/h2&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/ARM&quot;&gt;ARM&lt;/a&gt; has &lt;em&gt;CLZ&lt;/em&gt; (Count Leading Zeros) instruction for 32-bit integers. ARM instruction is available in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0100i/index.html&quot; rel=&quot;nofollow&quot;&gt;ARMv5&lt;/a&gt; and above, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/ARM_architecture#Thumb&quot; rel=&quot;nofollow&quot;&gt;32-bit Thumb instruction&lt;/a&gt; is available in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0100i/index.html&quot; rel=&quot;nofollow&quot;&gt;ARMv6T2&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0100i/index.html&quot; rel=&quot;nofollow&quot;&gt;ARMv7&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:148:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0379a/Cihjgjed.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;ARM Information Center &amp;amp;gt; General data processing instructions &amp;amp;gt; CLZ&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-37&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-37&quot;&gt;[37]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:148 --&gt; , the C-intrinsic is called &lt;em&gt;_builtin_clz&lt;/em&gt; &lt;!-- ws:start:WikiTextRefRule:150:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0376a/CJAEJGJD.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;ARM Information Center &amp;amp;gt; Instruction intrinsics &amp;amp;gt; __builtin_clz&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-38&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-38&quot;&gt;[38]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:150 --&gt; &lt;!-- ws:start:WikiTextRefRule:152:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://developer.apple.com/mac/library/documentation/DeveloperTools/gcc-4.0.1/gcc/Other-Builtins.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Other Builtins - Using the GNU Compiler Collection (GCC)&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-39&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-39&quot;&gt;[39]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:152 --&gt; &lt;!-- ws:start:WikiTextRefRule:156:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=31228&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Bit Scan (equivalent to ASM instructions bsr and bsf)&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Pascal%20Georges&amp;quot;&amp;gt;Pascal Georges&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, December 24, 2009&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-40&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-40&quot;&gt;[40]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:156 --&gt; .&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:302:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@EngineSamples&amp;quot; title=&amp;quot;Anchor: EngineSamples&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;EngineSamples&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:302 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:217:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc29&quot;&gt;&lt;a name=&quot;Engine Samples&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:217 --&gt;Engine Samples&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Amundsen#BitScan&quot;&gt;BitScan in Amundsen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Chess%200.5#BitScan&quot;&gt;BitScan in Chess 0.5&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/CookieCat#BitScan&quot;&gt;BitScan in CookieCat&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Crafty#BitScan&quot;&gt;BitScan in Crafty&lt;/a&gt; (23.5)&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Gibbon#BitScan&quot;&gt;BitScan in Gibbon&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Gk#BitScan&quot;&gt;BitScan in Gk&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/HeavyChess#BitScan&quot;&gt;BitScan in HeavyChess&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Kurt#BitScan&quot;&gt;BitScan in Kurt&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Murka#BitScan&quot;&gt;BitScan in Murka&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Prophet#BitScan&quot;&gt;BitScan in Prophet&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/RedQueen#BitScan&quot;&gt;BitScan in RedQueen&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Spector#BitScan&quot;&gt;BitScan in Spector&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Tucano#BitScan&quot;&gt;BitScan in Tucano&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:219:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc30&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:219 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboard%20Serialization&quot;&gt;Bitboard Serialization&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pablo%20San%20Segundo#BITSCAN&quot;&gt;BITSCAN&lt;/a&gt;, a &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp#Libraries&quot;&gt;C++ library&lt;/a&gt; for bitstrings by &lt;a class=&quot;wiki_link&quot; href=&quot;/Pablo%20San%20Segundo&quot;&gt;Pablo San Segundo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling&quot;&gt;Bit-Twiddling&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/De%20Bruijn%20Sequence%20Generator&quot;&gt;De Bruijn Sequence Generator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Java-Bitscan&quot;&gt;Java-Bitscan&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;Population Count&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:221:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc31&quot;&gt;&lt;a name=&quot;Publications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:221 --&gt;Publications&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Alan%20Turing&quot;&gt;Alan Turing&lt;/a&gt; (&lt;strong&gt;1949&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.computerhistory.org/chess/full_record.php?iid=doc-431614f45472f&quot; rel=&quot;nofollow&quot;&gt;Alan Turing&#039;s Manual for the Ferranti Mk. I&lt;/a&gt;&lt;/em&gt;. transcribed in 2000 by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.panix.com/%7Erst/&quot; rel=&quot;nofollow&quot;&gt;Robert Thau&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://archive.computerhistory.org/projects/chess/related_materials/text/2-1.Ferranti_Mark_1_manual.Turing-Alan/2-1.Ferranti_Mark_1_manual.Turing-Alan.1951.UNIVERSITY_OF_MANCHESTER.062303005.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/The%20Computer%20History%20Museum&quot;&gt;The Computer History Museum&lt;/a&gt;, 9.4 The position of the most significant digit » &lt;a class=&quot;wiki_link&quot; href=&quot;/Ferranti%20Mark%201&quot;&gt;Ferranti Mark 1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Charles%20Leiserson&quot;&gt;Charles E. Leiserson&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Harald%20Prokop&quot;&gt;Harald Prokop&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Keith%20H.%20Randall&quot;&gt;Keith H. Randall&lt;/a&gt; (&lt;strong&gt;1998&lt;/strong&gt;). &lt;em&gt;Using de Bruijn Sequences to Index a 1 in a Computer Word&lt;/em&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://supertech.csail.mit.edu/papers/debruijn.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pablo%20San%20Segundo&quot;&gt;Pablo San Segundo&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Ram%C3%B3n%20Gal%C3%A1n&quot;&gt;Ramón Galán&lt;/a&gt; (&lt;strong&gt;2005&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.actapress.com/Abstract.aspx?paperId=18953&quot; rel=&quot;nofollow&quot;&gt;Bitboards: A New Approach&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informatik.uni-trier.de/%7Eley/db/conf/aia/aia2005.html#SegundoG05&quot; rel=&quot;nofollow&quot;&gt;AIA 2005&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Donald Knuth&lt;/a&gt; (&lt;strong&gt;2009&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html&quot; rel=&quot;nofollow&quot;&gt;The Art of Computer Programming&lt;/a&gt;, Volume 4, Fascicle 1: Bitwise tricks &amp;amp; techniques&lt;/em&gt;, as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/fasc1a.ps.gz&quot; rel=&quot;nofollow&quot;&gt;Pre-Fascicle 1a postscript&lt;/a&gt;, p. 10&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://de.linkedin.com/pub/andreas-stiller/a/381/aa9&quot; rel=&quot;nofollow&quot;&gt;Andreas Stiller&lt;/a&gt; (&lt;strong&gt;2013&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.heise.de/ct/inhalt/2013/07/186/&quot; rel=&quot;nofollow&quot;&gt;Spezialkommando - Bits setzen, abfragen, scannen und mehr&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.heise.de/ct/&quot; rel=&quot;nofollow&quot;&gt;c&#039;t Magazin für Computertechnik&lt;/a&gt; 7/2013, p. 186 (German)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:223:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc32&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:223 --&gt;Forum Posts&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:225:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc33&quot;&gt;&lt;a name=&quot;Forum Posts-1996 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:225 --&gt;1996 ...&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/bcb03df7630d6274&quot; rel=&quot;nofollow&quot;&gt;Bitboards: speeding up FirstOne&lt;/a&gt; by Laurent Desnogues, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;rgcc&lt;/a&gt;, April 10, 1996 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Othello&quot;&gt;Othello&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/d5dbf08c66e83517#&quot; rel=&quot;nofollow&quot;&gt;bitboard 2^i mod 67 is unique&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Stefan%20Plenkner&quot;&gt;Stefan Plenkner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;rgcc&lt;/a&gt;, August 6, 1996&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/9658009e315021fe#&quot; rel=&quot;nofollow&quot;&gt;bitboard 2^i mod 67 is unique&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Stefan%20Plenkner&quot;&gt;Stefan Plenkner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;rgcc&lt;/a&gt;, August 7, 1996&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/871851f83e2c429f#&quot; rel=&quot;nofollow&quot;&gt;bitboard 2^i mod 67 is unique&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Jo%C3%ABl%20Rivat&quot;&gt;Joël Rivat&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;rgcc&lt;/a&gt;, September 2, 1996&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=20057&quot; rel=&quot;nofollow&quot;&gt;Question to Bob: Crafty , Alpha and FindBit()&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Guido%20Schimmels&quot;&gt;Guido Schimmels&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 05, 1998&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=39619&quot; rel=&quot;nofollow&quot;&gt;To Nalimov and other programmers about BSF/BSR in VC&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Dezhi%20Zhao&quot;&gt;Dezhi Zhao&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 16, 1999&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:227:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc34&quot;&gt;&lt;a name=&quot;Forum Posts-2000 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:227 --&gt;2000 ...&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/37efb792689be6b8&quot; rel=&quot;nofollow&quot;&gt;Re: TASM 5.0 versus BSF&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Frans%20Morsch&quot;&gt;Frans Morsch&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/topics&quot; rel=&quot;nofollow&quot;&gt;comp.lang.asm.x86&lt;/a&gt;, March 28, 2000&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=124638&quot; rel=&quot;nofollow&quot;&gt;Will the Itanium have a BSF or BSR instruction?&lt;/a&gt; by  Larry Griffiths, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 15, 2000&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=124712&quot; rel=&quot;nofollow&quot;&gt;Re: Will the Itanium have a BSF or BSR instruction?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Eugene%20Nalimov&quot;&gt;Eugene Nalimov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 16, 2000&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=134077&quot; rel=&quot;nofollow&quot;&gt;Binary question&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Severi%20Salminen&quot;&gt;Severi Salminen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, October 19, 2000&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=175203&quot; rel=&quot;nofollow&quot;&gt;Bitboards and Piece Lists&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Dann%20Corbit&quot;&gt;Dann Corbit&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 14, 2001&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=207080&quot; rel=&quot;nofollow&quot;&gt;FirstBit() in assembler&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/David%20Rasmussen&quot;&gt;David Rasmussen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 13, 2002&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=211203&quot; rel=&quot;nofollow&quot;&gt;Reply from Intel about BSF/BSR&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Severi%20Salminen&quot;&gt;Severi Salminen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 31, 2002&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=212586&quot; rel=&quot;nofollow&quot;&gt;&amp;quot;Using de Bruijn Sequences to Index a 1 in a Computer Word&amp;quot;&lt;/a&gt; by Oliver Roese, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 08, 2002&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=265635&quot; rel=&quot;nofollow&quot;&gt;Another hacky method for bitboard bit extraction&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Walter%20Faxon&quot;&gt;Walter Faxon&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, November 17, 2002&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=268065&quot; rel=&quot;nofollow&quot;&gt;Modulo verus BitScan and MMX-PopCount&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, November 29, 2002&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=268305&quot; rel=&quot;nofollow&quot;&gt;Fast 3DNow! BitScan&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 01, 2002&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=275160&quot; rel=&quot;nofollow&quot;&gt;Bitscan Conclusions&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Matt%20Taylor&quot;&gt;Matt Taylor&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 05, 2003&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=283655&quot; rel=&quot;nofollow&quot;&gt;Bitscan&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Matt%20Taylor&quot;&gt;Matt Taylor&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 11, 2003&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=291062&quot; rel=&quot;nofollow&quot;&gt;FirstOne for Linux&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Sune%20Fischer&quot;&gt;Sune Fischer&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, March 29, 2003&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/de9546cd019bd72b/f46209f47d2a7ddb?lnk=gst&amp;amp;q=Matt+Taylor+magic#f46209f47d2a7ddb&quot; rel=&quot;nofollow&quot;&gt;Bit magic&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Matt%20Taylor&quot;&gt;Matt Taylor&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/comp.lang.asm.x86/topics&quot; rel=&quot;nofollow&quot;&gt;comp.lang.asm.x86&lt;/a&gt;, June 26, 2003&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=339225&quot; rel=&quot;nofollow&quot;&gt;Re: De Bruijn Sequence Generator&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Dieter%20B%C3%BCrssner&quot;&gt;Dieter Bürssner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 30, 2003 » &lt;a class=&quot;wiki_link&quot; href=&quot;/De%20Bruijn%20Sequence%20Generator&quot;&gt;De Bruijn Sequence Generator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=348097&quot; rel=&quot;nofollow&quot;&gt;Determining location of LSB/MSB&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Jan%20Renze%20Steenhuisen&quot;&gt;Renze Steenhuisen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 09, 2004&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=388668&quot; rel=&quot;nofollow&quot;&gt;Nalimov: bsf/bsr intrinsics implementation still not optimal&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Dezhi%20Zhao&quot;&gt;Dezhi Zhao&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 22, 2004&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=388787&quot; rel=&quot;nofollow&quot;&gt;Re: Nalimov: bsf/bsr intrinsics implementation still not optimal&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Eugene%20Nalimov&quot;&gt;Eugene Nalimov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 23, 2004&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:229:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc35&quot;&gt;&lt;a name=&quot;Forum Posts-2005 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:229 --&gt;2005 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=425020&quot; rel=&quot;nofollow&quot;&gt;A data point for PowerPC bitboard program authors&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Steven%20Edwards&quot;&gt;Steven Edwards&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 09, 2005 » &lt;a class=&quot;wiki_link&quot; href=&quot;/PowerPC&quot;&gt;PowerPC&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=3141&quot; rel=&quot;nofollow&quot;&gt;Best BitBoard LSB funktion?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Reinhard%20Scharnagl&quot;&gt;Reinhard Scharnagl&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Programming Forum&lt;/a&gt;, July 20, 2005&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=14151&quot; rel=&quot;nofollow&quot;&gt;Fastest bitboard compress routine when you can&#039;t use ASM&lt;/a&gt; by mambofish, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 31, 2007&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://talkchess.com/forum/viewtopic.php?t=29333&quot; rel=&quot;nofollow&quot;&gt;Bit twiddling question, part 2: arbitrary bitscan order&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Zach%20Wegner&quot;&gt;Zach Wegner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 11, 2009&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://talkchess.com/forum/viewtopic.php?t=29482&quot; rel=&quot;nofollow&quot;&gt;32 bit versions for bitscan64&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Michael%20Hoffmann&quot;&gt;Michael Hoffmann&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 21, 2009&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=30342&quot; rel=&quot;nofollow&quot;&gt;64-bit intrinsic performance&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Nathan%20Thom&quot;&gt;Nathan Thom&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, October 27, 2009&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=31228&quot; rel=&quot;nofollow&quot;&gt;Bit Scan (equivalent to ASM instructions bsr and bsf)&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Pascal%20Georges&quot;&gt;Pascal Georges&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 24, 2009&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:231:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc36&quot;&gt;&lt;a name=&quot;Forum Posts-2010 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:231 --&gt;2010 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://talkchess.com/forum/viewtopic.php?t=32046&quot; rel=&quot;nofollow&quot;&gt;bitScanReverse32&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Luca%20Hemmerich&quot;&gt;Luca Hemmerich&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 25, 2010&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=39268&quot; rel=&quot;nofollow&quot;&gt;Introduction and (hopefully) contribution - bitboard methods&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Alcides%20Schulz&quot;&gt;Alcides Schulz&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 03, 2011 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;Population Count&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=45188&quot; rel=&quot;nofollow&quot;&gt;Leading Zero Count Question&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Matthew%20R.%20Brades&quot;&gt;Matthew R. Brades&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 16, 2012&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=46040&quot; rel=&quot;nofollow&quot;&gt;Optimizing bitboards for ARM&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Martin%20Sedlak&quot;&gt;Martin Sedlak&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, November 17, 2012&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=54704&quot; rel=&quot;nofollow&quot;&gt;Symmetric move generation using bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Lasse%20Hansen&quot;&gt;Lasse Hansen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 20, 2014&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=54798&quot; rel=&quot;nofollow&quot;&gt;Stockfish 32-bit and hardware instructions on MSVC++&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Syed%20Fahad&quot;&gt;Syed Fahad&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 30, 2014  » &lt;a class=&quot;wiki_link&quot; href=&quot;/Stockfish&quot;&gt;Stockfish&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;BitScan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;Population Count&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:233:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc37&quot;&gt;&lt;a name=&quot;Forum Posts-2015 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:233 --&gt;2015 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=57400&quot; rel=&quot;nofollow&quot;&gt;Fun with De Bruijn&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Henk%20van%20den%20Belt&quot;&gt;Henk van den Belt&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 27, 2015&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=58230&amp;amp;start=3&quot; rel=&quot;nofollow&quot;&gt;Re: Linux Version of Maverick 1.5&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Michael%20Dvorkin&quot;&gt;Michael Dvorkin&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, November 12, 2015 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Mac%20OS&quot;&gt;OS X&lt;/a&gt;,  &lt;a class=&quot;wiki_link&quot; href=&quot;/Maverick&quot;&gt;Maverick&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=61559&quot; rel=&quot;nofollow&quot;&gt;syzygy users (and Ronald)&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Hyatt&quot;&gt;Robert Hyatt&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 29, 2016 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;Population Count&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:235:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc38&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:235 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Find_first_set&quot; rel=&quot;nofollow&quot;&gt;Find first set from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://aggregate.org/MAGIC&quot; rel=&quot;nofollow&quot;&gt;The Aggregate Magic Algorithms&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Hank%20Dietz&quot;&gt;Hank Dietz&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://graphics.stanford.edu/%7Eseander/bithacks.html&quot; rel=&quot;nofollow&quot;&gt;Bit Twiddling Hacks&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://graphics.stanford.edu/%7Eseander/&quot; rel=&quot;nofollow&quot;&gt;Sean Eron Anderson&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://caladan.nanosoft.ca/c4/software/bitsort.php&quot; rel=&quot;nofollow&quot;&gt;An Efficient Bit-Reversal Sorting Algorithm for the Fast Fourier Transform&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://caladan.nanosoft.ca/index.php&quot; rel=&quot;nofollow&quot;&gt;Jennifer Elaan&lt;/a&gt;, January 16, 2005&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.freepatentsonline.com/6172623.html&quot; rel=&quot;nofollow&quot;&gt;Efficient bit scan mechanism - United States Patent 6172623&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.freepatentsonline.com/&quot; rel=&quot;nofollow&quot;&gt;FreePatentsOnline.com&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#FrankZappa&quot;&gt;Frank Zappa&lt;/a&gt; &amp;amp; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/The_Mothers_of_Invention&quot; rel=&quot;nofollow&quot;&gt;the Mothers&lt;/a&gt; - &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/King_Kong&quot; rel=&quot;nofollow&quot;&gt;King Kong&lt;/a&gt; BBC Studio Recording 1968, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:157:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/custom/23775716?h=0&amp;amp;w=0&amp;quot; class=&amp;quot;WikiMedia WikiMediaCustom&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;custom&amp;amp;quot; key=&amp;amp;quot;23775716&amp;amp;quot;&amp;quot; title=&amp;quot;Custom Media&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;480&quot; height=&quot;360&quot; src=&quot;//www.youtube.com/embed/kk8mPKROUS4?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:157 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:237:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc39&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:237 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:2452:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.mcescher.com/Gallery/gallery-back.htm&quot; rel=&quot;nofollow&quot;&gt;Picture gallery &amp;quot;Back in Holland 1941 - 1954&amp;quot;&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.mcescher.com/&quot; rel=&quot;nofollow&quot;&gt;The Official M.C. Escher Website&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.chip-architect.com/news/2003_09_21_Detailed_Architecture_of_AMDs_64bit_Core.html#1.3&quot; rel=&quot;nofollow&quot;&gt;Chip Architect: Detailed Architecture of AMD&#039;s Opteron - 1.3 A third class of Instructions&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.chip-architect.com/&quot; rel=&quot;nofollow&quot;&gt;Hans de Vries&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Donald Knuth&lt;/a&gt; (&lt;strong&gt;2009&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html&quot; rel=&quot;nofollow&quot;&gt;The Art of Computer Programming&lt;/a&gt;, Volume 4, Fascicle 1: Bitwise tricks &amp;amp; techniques&lt;/em&gt;, as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/fasc1a.ps.gz&quot; rel=&quot;nofollow&quot;&gt;Pre-Fascicle 1a postscript&lt;/a&gt;, p 10&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Charles%20Leiserson&quot;&gt;Charles E. Leiserson&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Harald%20Prokop&quot;&gt;Harald Prokop&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Keith%20H.%20Randall&quot;&gt;Keith H. Randall&lt;/a&gt; (&lt;strong&gt;1998&lt;/strong&gt;). &lt;em&gt;Using de Bruijn Sequences to Index a 1 in a Computer Word&lt;/em&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://supertech.csail.mit.edu/papers/debruijn.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=212586&quot; rel=&quot;nofollow&quot;&gt;&amp;quot;Using de Bruijn Sequences to Index a 1 in a Computer Word&amp;quot;&lt;/a&gt; discussion in &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 08, 2002&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Nicolaas%20de%20Bruijn&quot;&gt;N. G. de Bruijn&lt;/a&gt; (&lt;strong&gt;1975&lt;/strong&gt;). &lt;em&gt;Acknowledgement of priority to C. Flye Sainte-Marie on the counting of circular arrangements of 2n zeros and ones that show each n-letter word exactly once&lt;/em&gt;. Technical Report, Technische Hogeschool Eindhoven, available as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://alexandria.tue.nl/repository/books/252901.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf reprint&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/de9546cd019bd72b/f46209f47d2a7ddb?lnk=gst&amp;amp;q=Matt+Taylor+magic#f46209f47d2a7ddb&quot; rel=&quot;nofollow&quot;&gt;Bit magic&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Matt%20Taylor&quot;&gt;Matt Taylor&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/comp.lang.asm.x86/topics&quot; rel=&quot;nofollow&quot;&gt;comp.lang.asm.x86&lt;/a&gt;, June 26, 2003&lt;/li&gt;
&lt;li id=&quot;cite_note-8&quot;&gt;&lt;a href=&quot;#cite_ref-8&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=265635&quot; rel=&quot;nofollow&quot;&gt;Another hacky method for bitboard bit extraction&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Walter%20Faxon&quot;&gt;Walter Faxon&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, November 17, 2002&lt;/li&gt;
&lt;li id=&quot;cite_note-9&quot;&gt;&lt;a href=&quot;#cite_ref-9&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/d5dbf08c66e83517#&quot; rel=&quot;nofollow&quot;&gt;bitboard 2^i mod 67 is unique&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Stefan%20Plenkner&quot;&gt;Stefan Plenkner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;rgcc&lt;/a&gt;, August 6, 1996&lt;/li&gt;
&lt;li id=&quot;cite_note-10&quot;&gt;&lt;a href=&quot;#cite_ref-10&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Pablo%20San%20Segundo&quot;&gt;Pablo San Segundo&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Ram%C3%B3n%20Gal%C3%A1n&quot;&gt;Ramón Galán&lt;/a&gt; (&lt;strong&gt;2005&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.actapress.com/Abstract.aspx?paperId=18953&quot; rel=&quot;nofollow&quot;&gt;Bitboards: A New Approach&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informatik.uni-trier.de/%7Eley/db/conf/aia/aia2005.html#SegundoG05&quot; rel=&quot;nofollow&quot;&gt;AIA 2005&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-11&quot;&gt;&lt;a href=&quot;#cite_ref-11&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=3141&quot; rel=&quot;nofollow&quot;&gt;Best BitBoard LSB funktion?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Reinhard%20Scharnagl&quot;&gt;Reinhard Scharnagl&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Programming Forum&lt;/a&gt;, July 20, 2005&lt;/li&gt;
&lt;li id=&quot;cite_note-12&quot;&gt;&lt;a href=&quot;#cite_ref-12&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=124712&quot; rel=&quot;nofollow&quot;&gt;Re: Will the Itanium have a BSF or BSR instruction?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Eugene%20Nalimov&quot;&gt;Eugene Nalimov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 16, 2000&lt;/li&gt;
&lt;li id=&quot;cite_note-13&quot;&gt;&lt;a href=&quot;#cite_ref-13&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=38777&quot; rel=&quot;nofollow&quot;&gt;ms1bTable array in Eugene Nalimovs bitScanReverse&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Stef%20Luijten&quot;&gt;Stef Luijten&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 17, 2011&lt;/li&gt;
&lt;li id=&quot;cite_note-14&quot;&gt;&lt;a href=&quot;#cite_ref-14&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=472455&quot; rel=&quot;nofollow&quot;&gt;just another reverse bitscan&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 22, 2005&lt;/li&gt;
&lt;li id=&quot;cite_note-15&quot;&gt;&lt;a href=&quot;#cite_ref-15&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=472762&quot; rel=&quot;nofollow&quot;&gt;final version - homage to FZ&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 23, 2005&lt;/li&gt;
&lt;li id=&quot;cite_note-16&quot;&gt;&lt;a href=&quot;#cite_ref-16&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://ep2012.europython.eu/conference/p/mark-dickinson&quot; rel=&quot;nofollow&quot;&gt;EuroPython 2012: Florence, July 2–8 | Mark Dickinson&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-17&quot;&gt;&lt;a href=&quot;#cite_ref-17&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn&quot; rel=&quot;nofollow&quot;&gt;Find the log base 2 of an N-bit integer in O(lg(N)) operations with multiply and lookup&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://graphics.stanford.edu/%7Eseander/bithacks.html&quot; rel=&quot;nofollow&quot;&gt;Bit Twiddling Hacks&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://graphics.stanford.edu/%7Eseander/&quot; rel=&quot;nofollow&quot;&gt;Sean Eron Anderson&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-18&quot;&gt;&lt;a href=&quot;#cite_ref-18&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-scm.tees.ac.uk/users/a.clements/BF/BF.htm&quot; rel=&quot;nofollow&quot;&gt;68020 Bit Field Instructions&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-19&quot;&gt;&lt;a href=&quot;#cite_ref-19&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/SSE4#SSE4a&quot; rel=&quot;nofollow&quot;&gt;SSE4a from Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-20&quot;&gt;&lt;a href=&quot;#cite_ref-20&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb384809.aspx&quot; rel=&quot;nofollow&quot;&gt;__lzcnt16, __lzcnt, __lzcnt64&lt;/a&gt; Visual C++ Language Reference&lt;/li&gt;
&lt;li id=&quot;cite_note-21&quot;&gt;&lt;a href=&quot;#cite_ref-21&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=283655&quot; rel=&quot;nofollow&quot;&gt;Bitscan&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Matt%20Taylor&quot;&gt;Matt Taylor&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 11, 2003&lt;/li&gt;
&lt;li id=&quot;cite_note-22&quot;&gt;&lt;a href=&quot;#cite_ref-22&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/wfd9z0bb%28v=VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_BitScanForward, _BitScanForward64&lt;/a&gt; Visual C++ Language Reference&lt;/li&gt;
&lt;li id=&quot;cite_note-23&quot;&gt;&lt;a href=&quot;#cite_ref-23&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/fbxyd7zd%28v=VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_BitScanReverse, _BitScanReverse64&lt;/a&gt; Visual C++ Language Reference&lt;/li&gt;
&lt;li id=&quot;cite_note-24&quot;&gt;&lt;a href=&quot;#cite_ref-24&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb384809.aspx&quot; rel=&quot;nofollow&quot;&gt;__lzcnt16, __lzcnt, __lzcnt64&lt;/a&gt; Visual C++ Language Reference&lt;/li&gt;
&lt;li id=&quot;cite_note-25&quot;&gt;&lt;a href=&quot;#cite_ref-25&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://linux.die.net/man/3/&quot; rel=&quot;nofollow&quot;&gt;Section 3: library functions - Linux man pages&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-26&quot;&gt;&lt;a href=&quot;#cite_ref-26&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://linux.die.net/man/3/ffsll&quot; rel=&quot;nofollow&quot;&gt;ffsll(3): find first bit set in word - Linux man page&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-27&quot;&gt;&lt;a href=&quot;#cite_ref-27&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://gcc.gnu.org/onlinedocs/gcc-4.4.5/gcc/Other-Builtins.html#Other-Builtins&quot; rel=&quot;nofollow&quot;&gt;Other Builtins - Using the GNU Compiler Collection (GCC)&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-28&quot;&gt;&lt;a href=&quot;#cite_ref-28&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=388787&quot; rel=&quot;nofollow&quot;&gt;Re: Nalimov: bsf/bsr intrinsics implementation still not optimal&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Eugene%20Nalimov&quot;&gt;Eugene Nalimov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 23, 2004&lt;/li&gt;
&lt;li id=&quot;cite_note-29&quot;&gt;&lt;a href=&quot;#cite_ref-29&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.jjj.de/fxt/fxtbook.pdf&quot; rel=&quot;nofollow&quot;&gt;Matters Computational - ideas, algorithms, source code&lt;/a&gt; (pdf) Ideas and Source Code by &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#Arndt&quot;&gt;Jörg Arndt&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-30&quot;&gt;&lt;a href=&quot;#cite_ref-30&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/instruction_tables.pdf&quot; rel=&quot;nofollow&quot;&gt;Instruction tables, Lists of instruction latencies, throughputs and microoperation breakdowns for Intel and AMD CPU&#039;s&lt;/a&gt; (pdf) by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-31&quot;&gt;&lt;a href=&quot;#cite_ref-31&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/25112.PDF&quot; rel=&quot;nofollow&quot;&gt;Software Optimization Guide for AMD64 Processors&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-32&quot;&gt;&lt;a href=&quot;#cite_ref-32&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/40546.pdf&quot; rel=&quot;nofollow&quot;&gt;Software Optimization Guide for AMD Family 10h and 12h Processors&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-33&quot;&gt;&lt;a href=&quot;#cite_ref-33&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.intel.com/design/processor/manuals/248966.pdf&quot; rel=&quot;nofollow&quot;&gt;Intel 64 and IA32 Architectures Optimization Reference Manual&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-34&quot;&gt;&lt;a href=&quot;#cite_ref-34&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://users.atw.hu/instlatx64/GenuineIntel00306C3_Haswell_InstLatX64.txt&quot; rel=&quot;nofollow&quot;&gt;Haswell Instructions Latency&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-35&quot;&gt;&lt;a href=&quot;#cite_ref-35&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.intel.com/Assets/PDF/manual/253666.pdf&quot; rel=&quot;nofollow&quot;&gt;Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 2A: Instruction Set Reference, A-M&lt;/a&gt; (pdf) BSF—Bit Scan Forward 3-87&lt;/li&gt;
&lt;li id=&quot;cite_note-36&quot;&gt;&lt;a href=&quot;#cite_ref-36&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/24594_APM_v3.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD64 Architecture Programmer’s Manual Volume 3: General-Purpose and System Instructions&lt;/a&gt; (pdf) Bit Scan Forward pg. 111&lt;/li&gt;
&lt;li id=&quot;cite_note-37&quot;&gt;&lt;a href=&quot;#cite_ref-37&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0379a/Cihjgjed.html&quot; rel=&quot;nofollow&quot;&gt;ARM Information Center &amp;gt; General data processing instructions &amp;gt; CLZ&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-38&quot;&gt;&lt;a href=&quot;#cite_ref-38&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0376a/CJAEJGJD.html&quot; rel=&quot;nofollow&quot;&gt;ARM Information Center &amp;gt; Instruction intrinsics &amp;gt; __builtin_clz&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-39&quot;&gt;&lt;a href=&quot;#cite_ref-39&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.apple.com/mac/library/documentation/DeveloperTools/gcc-4.0.1/gcc/Other-Builtins.html&quot; rel=&quot;nofollow&quot;&gt;Other Builtins - Using the GNU Compiler Collection (GCC)&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-40&quot;&gt;&lt;a href=&quot;#cite_ref-40&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=31228&quot; rel=&quot;nofollow&quot;&gt;Bit Scan (equivalent to ASM instructions bsr and bsf)&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Pascal%20Georges&quot;&gt;Pascal Georges&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 24, 2009&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:2452 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:239:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc40&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:239 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:023:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;BitScan&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;160&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;BitScan&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;160&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-BitScan includeBody-BitScan includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/68020&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;68020&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Alcides+Schulz&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Alcides Schulz&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 29, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Algorithms&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Algorithms&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amundsen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amundsen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Array&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Array&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 1, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Attack+and+Defend+Maps&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Attack and Defend Maps&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX-512&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX-512&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Backtracking&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Backtracking&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Beowulf&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Beowulf&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bison&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bison&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 29, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 29, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit-Twiddling&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit-Twiddling&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Serialization&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Serialization&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitfoot&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitfoot&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 8, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BitScan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BitScan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Blockage+Detection&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Blockage Detection&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bobcat&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bobcat&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Brainless&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Brainless&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cassandre&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cassandre&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Charles+Leiserson&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Charles Leiserson&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 12, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CHEOPS&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CHEOPS&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 18, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chess+0.5&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chess 0.5&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 20, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chezzz&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chezzz&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Classical+Approach&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Classical Approach&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Congruent+Modulo+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Congruent Modulo Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CookieCat&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CookieCat&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 15, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Crafty&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Crafty&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cray-1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cray-1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cupcake&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cupcake&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Daniel+White&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Daniel White&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 9, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/David+Rasmussen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;David Rasmussen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/De+Bruijn+sequence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;De Bruijn sequence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 20, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/De+Bruijn+Sequence+Generator&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;De Bruijn Sequence Generator&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 1, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DEC+Alpha&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DEC Alpha&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 15, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dictionary&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dictionary&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dieter+B%C3%BCrssner&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dieter Bürssner&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 1, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Djinn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Djinn&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 30, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Encoding+Moves&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Encoding Moves&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Eugene+Nalimov&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Eugene Nalimov&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 23, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ferranti+Mark+1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ferranti Mark 1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fizbo&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fizbo&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 22, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Float&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Float&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gaviota&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gaviota&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 21, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gibbon&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gibbon&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 23, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gk&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gk&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Guido+Schimmels&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Guido Schimmels&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 23, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hakkapeliitta&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hakkapeliitta&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Harald+Prokop&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Harald Prokop&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/HeavyChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;HeavyChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 14, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ifrit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ifrit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Intel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Intel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Itanium&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Itanium&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Jan+Renze+Steenhuisen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Jan Renze Steenhuisen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Java-Bitscan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Java-Bitscan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 15, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Jo%C3%ABl+Rivat&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Joël Rivat&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 21, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Joker+IT&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Joker IT&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Keith+H.+Randall&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Keith H. Randall&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 16, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kim+Walisch&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kim Walisch&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/King+of+Kings&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;King of Kings&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 4, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/King+Pattern&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;King Pattern&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 15, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Knight+Pattern&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Knight Pattern&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 23, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Koundinya+Veluri&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Koundinya Veluri&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 2, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kurt&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kurt&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 20, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Leila&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Leila&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Little+Wing&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Little Wing&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Luca+Hemmerich&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Luca Hemmerich&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mac+OS&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mac OS&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Martin+Sedlak&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Martin Sedlak&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mathematician&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mathematician&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Matt+Taylor&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Matt Taylor&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 17, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Matthew+R.+Brades&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Matthew R. Brades&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Michael+Dvorkin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Michael Dvorkin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mikhail+R.+Shura-Bura&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mikhail R. Shura-Bura&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 30, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Murka&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Murka&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nathan+Thom&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nathan Thom&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 15, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nicolaas+de+Bruijn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nicolaas de Bruijn&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 3, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/NoraGrace&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;NoraGrace&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 23, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Obstruction+Difference&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Obstruction Difference&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Othello&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Othello&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pablo+San+Segundo&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pablo San Segundo&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Paladin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Paladin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pascal+Georges&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pascal Georges&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 1, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/PIC+Microcontroller&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;PIC Microcontroller&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pieces+versus+Directions&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pieces versus Directions&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 6, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Population+Count&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Population Count&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/PowerPC&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;PowerPC&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Prophet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Prophet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ram%C3%B3n+Gal%C3%A1n&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ramón Galán&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/RedQueen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;RedQueen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 13, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Reinhard+Scharnagl&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Reinhard Scharnagl&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 9, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Reverse+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Reverse Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robert+Hyatt&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robert Hyatt&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robocide&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robocide&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SBAMG&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SBAMG&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 4, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Scorpio&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Scorpio&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Searcher&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Searcher&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Senpai&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Senpai&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Severi+Salminen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Severi Salminen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 7, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shifted+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shifted Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 9, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Space-Time+Tradeoff&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Space-Time Tradeoff&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 17, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Spector&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Spector&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Stef+Luijten&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Stef Luijten&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 26, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Stefan+Plenkner&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Stefan Plenkner&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 31, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Stockfish&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Stockfish&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 7, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sune+Fischer&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sune Fischer&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 7, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sungorus&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sungorus&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 11, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Syed+Fahad&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Syed Fahad&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Thor%27s+Hammer&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Thor&amp;#039;s Hammer&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 23, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Traversing+Subsets+of+a+Set&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Traversing Subsets of a Set&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 14, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tucano&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tucano&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tunguska&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tunguska&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vadim+Demichev&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vadim Demichev&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vice&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vice&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Walter+Faxon&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Walter Faxon&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Warrior&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Warrior&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 23, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Wasp&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Wasp&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/X-ray+Attacks+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;X-ray Attacks (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 31, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64+Instructions+to+Include&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64 Instructions to Include&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 12, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Zurichess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Zurichess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 12, 2018&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:023 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>BMI1</title>
      <link>https://chessprogramming.wikispaces.com/BMI1</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/BMI1</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/BMI1</comments>
      <pubDate>Mon, 24 Mar 2014 16:20:29 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:58:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:58 --&gt;&lt;!-- ws:start:WikiTextTocRule:59: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Instructions&quot;&gt;Instructions&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:59 --&gt;&lt;!-- ws:start:WikiTextTocRule:60: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-ANDN&quot;&gt;ANDN&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:60 --&gt;&lt;!-- ws:start:WikiTextTocRule:61: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-BEXTR&quot;&gt;BEXTR&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:61 --&gt;&lt;!-- ws:start:WikiTextTocRule:62: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-BLSI&quot;&gt;BLSI&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:62 --&gt;&lt;!-- ws:start:WikiTextTocRule:63: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-BLSMSK&quot;&gt;BLSMSK&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:63 --&gt;&lt;!-- ws:start:WikiTextTocRule:64: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-BLSR&quot;&gt;BLSR&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:64 --&gt;&lt;!-- ws:start:WikiTextTocRule:65: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-LZCNT&quot;&gt;LZCNT&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:65 --&gt;&lt;!-- ws:start:WikiTextTocRule:66: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-TZCNT&quot;&gt;TZCNT&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:66 --&gt;&lt;!-- ws:start:WikiTextTocRule:67: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:67 --&gt;&lt;!-- ws:start:WikiTextTocRule:68: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Manuals&quot;&gt;Manuals&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:68 --&gt;&lt;!-- ws:start:WikiTextTocRule:69: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:69 --&gt;&lt;!-- ws:start:WikiTextTocRule:70: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:70 --&gt;&lt;!-- ws:start:WikiTextTocRule:71: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:71 --&gt;&lt;!-- ws:start:WikiTextTocRule:72: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:72 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; * BMI1&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;BMI1&lt;/strong&gt; (BMI),&lt;br /&gt;
an x86-64 expansion of &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling#BitManipulation&quot;&gt;bit-manipulation&lt;/a&gt; instructions by &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt;, introduced in conjunction with the &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;Advanced Vector Extensions&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD&lt;/a&gt; instruction set. With the  &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Bulldozer_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Bulldozer microarchitecture&lt;/a&gt;, BMI1 as well as &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt; are also available on &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; processors under the initial name BMI, along with their &lt;a class=&quot;wiki_link&quot; href=&quot;/TBM&quot;&gt;Trailing Bit Manipulation Instructions&lt;/a&gt; (TBM) &lt;!-- ws:start:WikiTextRefRule:9:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://support.amd.com/us/Processor_TechDocs/24594_APM_v3.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AMD64 Architecture Programmer’s Manual Volume 3: General-Purpose and System Instructions&amp;lt;/a&amp;gt; (pdf)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:9 --&gt;. Most BMI1 instructions (except LZCNT and TZCNT) employ the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/VEX_prefix&quot; rel=&quot;nofollow&quot;&gt;VEX prefix&lt;/a&gt; encoding to support up to three-operand syntax with non-destructive source operands on 32- or 64-bit general-purpose registers. BMI1 (ANDN, BEXTR, BLSI, BLSMK, BLSR, TZCNT) requires bit 3 set in EBX of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/CPUID&quot; rel=&quot;nofollow&quot;&gt;CPUID&lt;/a&gt; with EAX=07H, ECX=0H. LZCNT, not exactly member of BMI1, requires bit 5 set in ECX of CPUID EAX=80000001H. With the advent of &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;, some more &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling&quot;&gt;bit-twiddling&lt;/a&gt; on general-purpose registers is proposed with &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2&quot;&gt;BMI2&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:32:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Instructions&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:32 --&gt;Instructions&lt;/h1&gt;
BMI1 instructions may speedup various &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboard&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations&quot;&gt;operations&lt;/a&gt;, such as &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#RelativeComplement&quot;&gt;relative complement&lt;/a&gt;, and &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BIsolation&quot;&gt;isolation&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BReset&quot;&gt;reset&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BSeparation&quot;&gt;separation&lt;/a&gt; of the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;least significant one bit&lt;/a&gt;, they combine two instructions and reduce register pressure. &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#LeadingZeroCount&quot;&gt;Leading&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#TrailingZeroCount&quot;&gt;trailing zero count&lt;/a&gt; are useful for &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;scanning bits&lt;/a&gt; with possibly empty sets.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:73:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@ANDN&amp;quot; title=&amp;quot;Anchor: ANDN&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;ANDN&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:73 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:34:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Instructions-ANDN&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:34 --&gt;ANDN&lt;/h2&gt;
Logical And Not, the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#RelativeComplement&quot;&gt;relative complement&lt;/a&gt;, no intrinsic due to compiler support.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;dest ::= ~src1 &amp;amp;amp; src2;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;dest ::= ~src1 &amp;amp; src2;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:74:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BEXTR&amp;quot; title=&amp;quot;Anchor: BEXTR&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BEXTR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:74 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:36:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Instructions-BEXTR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:36 --&gt;BEXTR&lt;/h2&gt;
Bit Field Extract &lt;!-- ws:start:WikiTextRefRule:11:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_bextr_u.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_bextr_u32/64 &amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:11 --&gt;. Nice to extract some consecutive bits from a (&lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;rotated&lt;/a&gt;) &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy&quot;&gt;occupancy&lt;/a&gt; bitboard, or, as they name suggests, from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Bit_field&quot; rel=&quot;nofollow&quot;&gt;bit-field&lt;/a&gt; structures. &lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;dest ::= (src &amp;amp;gt;&amp;amp;gt; start) &amp;amp;amp; ((1 &amp;amp;lt;&amp;amp;lt; len)-1);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;unsigned __int32 _bextr_u32(unsigned __int32 src, unsigned __int32 start, unsigned __int32 len);&amp;lt;br/&amp;gt;unsigned __int64 _bextr_u64(unsigned __int64 src, unsigned __int32 start, unsigned __int32 len);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;dest ::= (src &amp;gt;&amp;gt; start) &amp;amp; ((1 &amp;lt;&amp;lt; len)-1);
&amp;nbsp;
unsigned __int32 _bextr_u32(unsigned __int32 src, unsigned __int32 start, unsigned __int32 len);
unsigned __int64 _bextr_u64(unsigned __int64 src, unsigned __int32 start, unsigned __int32 len);&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;A shiftless &lt;a class=&quot;wiki_link&quot; href=&quot;/Score#SignExtension&quot;&gt;sign extension&lt;/a&gt; might be applied by &lt;!-- ws:start:WikiTextRefRule:15:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://aggregate.org/MAGIC/#Sign%20Extension&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Sign Extension&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://aggregate.org/MAGIC&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The Aggregate Magic Algorithms&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Hank%20Dietz&amp;quot;&amp;gt;Hank Dietz&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:15 --&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;dest_signextended ::= (dest ^ signbit) - signbit&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;dest_signextended ::= (dest ^ signbit) - signbit&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:75:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BLSI&amp;quot; title=&amp;quot;Anchor: BLSI&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BLSI&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:75 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:38:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Instructions-BLSI&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:38 --&gt;BLSI&lt;/h2&gt;
Extract Lowest Set Isolated Bit &lt;!-- ws:start:WikiTextRefRule:17:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_blsi_u.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_blsi_u32/64 &amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:17 --&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BIsolation&quot;&gt;isolates&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;least significant one bit&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;dest ::= src &amp;amp;amp; -src;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;unsigned __int64 _blsi_u64(unsigned __int64 src);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;dest ::= src &amp;amp; -src;
&amp;nbsp;
unsigned __int64 _blsi_u64(unsigned __int64 src);&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:76:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BLSMSK&amp;quot; title=&amp;quot;Anchor: BLSMSK&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BLSMSK&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:76 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:40:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Instructions-BLSMSK&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:40 --&gt;BLSMSK&lt;/h2&gt;
Get Mask Up to Lowest Set Bit &lt;!-- ws:start:WikiTextRefRule:19:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_blsmsk_u.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_blsmsk_u32/64&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:19 --&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BSeparation&quot;&gt;sets all bits below&lt;/a&gt; the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;least significant one bit&lt;/a&gt;, and clears all upper bits.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;dest ::= (src-1) ^ src;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;unsigned __int64 _blsmsk_u64(unsigned __int64 src);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;dest ::= (src-1) ^ src;
&amp;nbsp;
unsigned __int64 _blsmsk_u64(unsigned __int64 src);&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:77:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BLSR&amp;quot; title=&amp;quot;Anchor: BLSR&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BLSR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:77 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:42:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Instructions-BLSR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:42 --&gt;BLSR&lt;/h2&gt;
Reset Lowest Set Bit &lt;!-- ws:start:WikiTextRefRule:21:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_blsr_u.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_blsr_u32/64 &amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:21 --&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BReset&quot;&gt;resets&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;least significant one bit&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;dest ::= (src-1) &amp;amp;amp; src;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;unsigned __int64 _blsr_u64(unsigned __int64 src);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;dest ::= (src-1) &amp;amp; src;
&amp;nbsp;
unsigned __int64 _blsr_u64(unsigned __int64 src);&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:78:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@LZCNT&amp;quot; title=&amp;quot;Anchor: LZCNT&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;LZCNT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:78 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:44:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Instructions-LZCNT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:44 --&gt;LZCNT&lt;/h2&gt;
Count the Number of Leading Zero Bits &lt;!-- ws:start:WikiTextRefRule:23:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_lzcnt_u.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_lzcnt_u32/64 &amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:23 --&gt;, initially from &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4#SSE4a&quot;&gt;SSE4a&lt;/a&gt; aka &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4#ABM&quot;&gt;Advanced Bit Manipulations&lt;/a&gt; (ABM). If not supported, processor executes &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#bsfbsr&quot;&gt;BSR&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:25:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/file/36945&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Intel AVX and AVX2 Programming Reference&amp;lt;/a&amp;gt; (pdf), 7-14 LZCNT— Count the Number of Leading Zero Bits &amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-8&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:25 --&gt; presumly with xor 63.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;unsigned __int64 _lzcnt_u64(unsigned __int64 src);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;unsigned __int64 _lzcnt_u64(unsigned __int64 src);&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:79:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@TZCNT&amp;quot; title=&amp;quot;Anchor: TZCNT&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;TZCNT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:79 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:46:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Instructions-TZCNT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:46 --&gt;TZCNT&lt;/h2&gt;
Count the Number of Trailing Zero Bits &lt;!-- ws:start:WikiTextRefRule:27:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_tzcnt_u.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_tzcnt_u32/64&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-9&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-9&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:27 --&gt;. If not supported, processor executes &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#bsfbsr&quot;&gt;BSF&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:29:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/file/36945&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Intel AVX and AVX2 Programming Reference&amp;lt;/a&amp;gt; (pdf), 7-27 TZCNT — Count the Number of Trailing Zero Bits&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-10&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-10&quot;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:29 --&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;unsigned __int64 _tzcnt_u64(unsigned __int64 src);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;unsigned __int64 _tzcnt_u64(unsigned __int64 src);&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:48:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:48 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4#ABM&quot;&gt;ABM&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;BitScan&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling&quot;&gt;Bit-Twiddling&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2&quot;&gt;BMI2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations&quot;&gt;General Setwise Operations&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/TBM&quot;&gt;TBM&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:50:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Manuals&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:50 --&gt;Manuals&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/file/36945&quot; rel=&quot;nofollow&quot;&gt;Intel AVX and AVX2 Programming Reference&lt;/a&gt; (pdf)&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/24594_APM_v3.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD64 Architecture Programmer’s Manual Volume 3: General-Purpose and System Instructions&lt;/a&gt; (pdf) &lt;!-- ws:start:WikiTextRefRule:30:&amp;amp;lt;ref&amp;amp;gt;Moved BMI and TBM instructions from Volume 4 to Volume 3 in September 2011&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-11&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-11&quot;&gt;[11]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:30 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/47414_15h_sw_opt_guide.pdf&quot; rel=&quot;nofollow&quot;&gt;Software Optimization Guide for AMD Family 15h Processors&lt;/a&gt; (pdf) 9.9 Optimizing with BMI and TBM Instructions, pp. 163&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:52:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc10&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:52 --&gt;External Links&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets&quot; rel=&quot;nofollow&quot;&gt;Bit Manipulation Instruction Sets from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/landingpage/IntrinsicsGuide/&quot; rel=&quot;nofollow&quot;&gt;Intel Intrinsics Guide&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:54:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc11&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:54 --&gt;References&lt;/h1&gt;
&lt;!-- ws:start:WikiTextReferencesRule:201:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/24594_APM_v3.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD64 Architecture Programmer’s Manual Volume 3: General-Purpose and System Instructions&lt;/a&gt; (pdf)&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_bextr_u.htm&quot; rel=&quot;nofollow&quot;&gt;_bextr_u32/64 &lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://aggregate.org/MAGIC/#Sign%20Extension&quot; rel=&quot;nofollow&quot;&gt;Sign Extension&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://aggregate.org/MAGIC&quot; rel=&quot;nofollow&quot;&gt;The Aggregate Magic Algorithms&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Hank%20Dietz&quot;&gt;Hank Dietz&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_blsi_u.htm&quot; rel=&quot;nofollow&quot;&gt;_blsi_u32/64 &lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_blsmsk_u.htm&quot; rel=&quot;nofollow&quot;&gt;_blsmsk_u32/64&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_blsr_u.htm&quot; rel=&quot;nofollow&quot;&gt;_blsr_u32/64 &lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_lzcnt_u.htm&quot; rel=&quot;nofollow&quot;&gt;_lzcnt_u32/64 &lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-8&quot;&gt;&lt;a href=&quot;#cite_ref-8&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/file/36945&quot; rel=&quot;nofollow&quot;&gt;Intel AVX and AVX2 Programming Reference&lt;/a&gt; (pdf), 7-14 LZCNT— Count the Number of Leading Zero Bits &lt;/li&gt;
&lt;li id=&quot;cite_note-9&quot;&gt;&lt;a href=&quot;#cite_ref-9&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_tzcnt_u.htm&quot; rel=&quot;nofollow&quot;&gt;_tzcnt_u32/64&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-10&quot;&gt;&lt;a href=&quot;#cite_ref-10&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/file/36945&quot; rel=&quot;nofollow&quot;&gt;Intel AVX and AVX2 Programming Reference&lt;/a&gt; (pdf), 7-27 TZCNT — Count the Number of Trailing Zero Bits&lt;/li&gt;
&lt;li id=&quot;cite_note-11&quot;&gt;&lt;a href=&quot;#cite_ref-11&quot;&gt;^&lt;/a&gt; Moved BMI and TBM instructions from Volume 4 to Volume 3 in September 2011&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:201 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:56:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc12&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:56 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:08:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;BMI1&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;BMI1&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-BMI1 includeBody-BMI1 includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit-Twiddling&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit-Twiddling&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BitScan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BitScan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Intel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Intel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robocide&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robocide&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Score&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Score&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 14, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/TBM&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;TBM&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 28, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:08 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>BMI2</title>
      <link>https://chessprogramming.wikispaces.com/BMI2</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/BMI2</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/BMI2</comments>
      <pubDate>Tue, 06 Mar 2018 11:06:12 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:121:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:121 --&gt;&lt;!-- ws:start:WikiTextTocRule:122: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Instructions&quot;&gt;Instructions&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:122 --&gt;&lt;!-- ws:start:WikiTextTocRule:123: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-BZHI&quot;&gt;BZHI&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:123 --&gt;&lt;!-- ws:start:WikiTextTocRule:124: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-PDEP&quot;&gt;PDEP&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:124 --&gt;&lt;!-- ws:start:WikiTextTocRule:125: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PDEP-Intrinsic Prototype&quot;&gt;Intrinsic Prototype&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:125 --&gt;&lt;!-- ws:start:WikiTextTocRule:126: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PDEP-Sample&quot;&gt;Sample&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:126 --&gt;&lt;!-- ws:start:WikiTextTocRule:127: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PDEP-Serial Implementation&quot;&gt;Serial Implementation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:127 --&gt;&lt;!-- ws:start:WikiTextTocRule:128: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-PEXT&quot;&gt;PEXT&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:128 --&gt;&lt;!-- ws:start:WikiTextTocRule:129: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PEXT-Intrinsic Prototype&quot;&gt;Intrinsic Prototype&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:129 --&gt;&lt;!-- ws:start:WikiTextTocRule:130: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PEXT-Sample&quot;&gt;Sample&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:130 --&gt;&lt;!-- ws:start:WikiTextTocRule:131: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PEXT-Serial Implementation&quot;&gt;Serial Implementation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:131 --&gt;&lt;!-- ws:start:WikiTextTocRule:132: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Applications&quot;&gt;Applications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:132 --&gt;&lt;!-- ws:start:WikiTextTocRule:133: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-PEXT Bitboards&quot;&gt;PEXT Bitboards&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:133 --&gt;&lt;!-- ws:start:WikiTextTocRule:134: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-PEXT/PDEP Bitboards&quot;&gt;PEXT/PDEP Bitboards&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:134 --&gt;&lt;!-- ws:start:WikiTextTocRule:135: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-Syzygy Generator&quot;&gt;Syzygy Generator&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:135 --&gt;&lt;!-- ws:start:WikiTextTocRule:136: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:136 --&gt;&lt;!-- ws:start:WikiTextTocRule:137: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Manuals&quot;&gt;Manuals&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:137 --&gt;&lt;!-- ws:start:WikiTextTocRule:138: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:138 --&gt;&lt;!-- ws:start:WikiTextTocRule:139: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:139 --&gt;&lt;!-- ws:start:WikiTextTocRule:140: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:140 --&gt;&lt;!-- ws:start:WikiTextTocRule:141: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:141 --&gt;&lt;!-- ws:start:WikiTextTocRule:142: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:142 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; * BMI2&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;BMI2&lt;/strong&gt;,&lt;br /&gt;
an x86-64 expansion of &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling#BitManipulation&quot;&gt;bit-manipulation&lt;/a&gt; instructions by &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt;. Like &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt;, BMI2 employs &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/VEX_prefix&quot; rel=&quot;nofollow&quot;&gt;VEX prefix&lt;/a&gt; encoding to support three-operand syntax with non-destructive source operands on 32- or 64-bit general-purpose registers. Along with &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;, BMI2 was expected to be part of &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Haswell_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Haswell&lt;/a&gt; architecture planned for 2013, but was not yet available in one of the first tested Haswell generations of mid 2013 as reported by Andreas Stiller from the German  c&#039;t magazine &lt;!-- ws:start:WikiTextRefRule:15:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://de.linkedin.com/pub/andreas-stiller/a/381/aa9&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Andreas Stiller&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2013&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.heise.de/ct/inhalt/2013/14/114/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Der Rechenkünstler&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.heise.de/ct/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;c&#039;t Magazin für Computertechnik&amp;lt;/a&amp;gt; 14/2013, p. 114-119 (German)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:15 --&gt;. BMI2 requires bit 8 set in EBX of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/CPUID&quot; rel=&quot;nofollow&quot;&gt;CPUID&lt;/a&gt; with EAX=07H, ECX=0H &lt;!-- ws:start:WikiTextRefRule:18:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/en-us/articles/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;How to detect New Instruction support in the 4th generation Intel® Core™ processor family | Intel® Developer Zone&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/de-de/user/76418&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Max Locktyukhin&amp;lt;/a&amp;gt;, August 05, 2013&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:18 --&gt;. In 2017, BMI2 was further incorporated in &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Zen_(microarchitecture)&quot; rel=&quot;nofollow&quot;&gt;Zen-architecture&lt;/a&gt; but so far with a slow implementation of critical instructions such as &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PDEP&quot;&gt;PDEP&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PEXT&quot;&gt;PEXT&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:21:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://rybkaforum.net/cgi-bin/rybkaforum/topic_show.pl?tid=32016&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Ryzen Fritz Chess Benchmarks ?&amp;lt;/a&amp;gt; by ralunger, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Rybka Forum&amp;lt;/a&amp;gt;, March 03, 2017&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:21 --&gt; &lt;!-- ws:start:WikiTextRefRule:26:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://www.reddit.com/r/Amd/comments/60i6er/ryzen_and_bmi2_strange_behavior_and_high_latencies/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Ryzen and BMI2: Strange behavior and high latencies&amp;lt;/a&amp;gt; by DonnieTinyHands, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Reddit&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Reddit&amp;lt;/a&amp;gt;, March 20, 2017 » &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/AMD&amp;quot;&amp;gt;AMD&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/BMI2#PEXT&amp;quot;&amp;gt;BMI2 PEXT&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:26 --&gt; .&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:81:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Instructions&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:81 --&gt;Instructions&lt;/h1&gt;
Beside the instructions explained in more detail below, there is MULX, Unsigned Multiply, and RORX, SARX/SHLX/SHRX, that is rotate and shifts without affecting processor flags. PEXT and PDEP &lt;!-- ws:start:WikiTextRefRule:35:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.informatik.uni-trier.de/~ley/pers/hd/l/Lee:Ruby_B=&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Ruby Lee&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.informatik.uni-trier.de/~ley/pers/hd/s/Shi:Zhijie_Jerry.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Zhijie Shi&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.informatik.uni-trier.de/~ley/pers/hd/y/Yang:Xiao.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Xiao Yang&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2001&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Efficient Permutation Instructions for Fast Software Cryptography&amp;lt;/em&amp;gt;. Micro, IEEE, Vol. 21,  No. 6, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://palms.ee.princeton.edu/PALMSopen/lee01efficient.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;pdf&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:35 --&gt; allow for an alternative of &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;kindergarten&lt;/a&gt;- or &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;magic bitboards&lt;/a&gt;, and clearly makes maintaining &lt;a class=&quot;wiki_link&quot; href=&quot;/Rotated%20Bitboards&quot;&gt;rotated bitboards&lt;/a&gt; obsolete &lt;!-- ws:start:WikiTextRefRule:39:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=40333&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Haswell New Instructions&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Zach%20Wegner&amp;quot;&amp;gt;Zach Wegner&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, September 09, 2011&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:39 --&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:143:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BZHI&amp;quot; title=&amp;quot;Anchor: BZHI&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BZHI&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:143 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:83:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Instructions-BZHI&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:83 --&gt;BZHI&lt;/h2&gt;
Zero High Bits Starting with Specified Bit Position &lt;!-- ws:start:WikiTextRefRule:41:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_bzhi_u.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_bzhi_u32/u64&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:41 --&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;dest ::= src &amp;amp;amp; ((1 &amp;amp;lt;&amp;amp;lt; index)-1);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;unsigned __int64 _bzhi_u64(unsigned __int64 src, unsigned __int32 index);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;dest ::= src &amp;amp; ((1 &amp;lt;&amp;lt; index)-1);
&amp;nbsp;
unsigned __int64 _bzhi_u64(unsigned __int64 src, unsigned __int32 index);&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:144:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PDEP&amp;quot; title=&amp;quot;Anchor: PDEP&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PDEP&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:144 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:85:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Instructions-PDEP&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:85 --&gt;PDEP&lt;/h2&gt;
Parallel Bits Deposit &lt;!-- ws:start:WikiTextRefRule:43:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_pdep_u.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_pdep_u32/u64&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-8&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:43 --&gt;. May be used to map &lt;a class=&quot;wiki_link&quot; href=&quot;/First%20Rank%20Attacks&quot;&gt;first rank attacks&lt;/a&gt; to any rank, file, or diagonal on the chess board.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:87:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Instructions-PDEP-Intrinsic Prototype&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:87 --&gt;Intrinsic Prototype&lt;/h3&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;unsigned __int64 pdep_u64(unsigned __int64 src, unsigned __int64 mask);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 pdep_u64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 src, &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 mask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:89:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Instructions-PDEP-Sample&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:89 --&gt;Sample&lt;/h3&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;SRC1   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐&amp;lt;br/&amp;gt;       │S63│S62│S61│S60│S59│....│ S7│ S6│ S5│ S4│ S3│ S2│ S1│ S0│ &amp;lt;br/&amp;gt;       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;SRC2   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐&amp;lt;br/&amp;gt;(mask) │ 0 │ 0 │ 0 │ 1 │ 0 │0...│ 1 │ 0 │ 1 │ 0 │ 0 │ 1 │ 0 │ 0 │  (f.i. 4 bits set)&amp;lt;br/&amp;gt;       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;DEST   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐&amp;lt;br/&amp;gt;       │ 0 │ 0 │ 0 │ S3│ 0 │0...│ S2│ 0 │ S1│ 0 │ 0 │ S0│ 0 │ 0 │ &amp;lt;br/&amp;gt;       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;SRC1   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐
       │S63│S62│S61│S60│S59│....│ S7│ S6│ S5│ S4│ S3│ S2│ S1│ S0│ 
       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘
&amp;nbsp;
SRC2   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐
(mask) │ 0 │ 0 │ 0 │ 1 │ 0 │0...│ 1 │ 0 │ 1 │ 0 │ 0 │ 1 │ 0 │ 0 │  (f.i. 4 bits set)
       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘
&amp;nbsp;
DEST   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐
       │ 0 │ 0 │ 0 │ S3│ 0 │0...│ S2│ 0 │ S1│ 0 │ 0 │ S0│ 0 │ 0 │ 
       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:91:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Instructions-PDEP-Serial Implementation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:91 --&gt;Serial Implementation&lt;/h3&gt;
in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:47:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=48220&amp;amp;amp;start=1&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: PEXT Bitboards&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Ronald%20de%20Man&amp;quot;&amp;gt;Ronald de Man&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, June 07, 2013&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-9&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-9&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:47 --&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 _pdep_u64(U64 val, U64 mask) {&amp;lt;br/&amp;gt;  U64 res = 0;&amp;lt;br/&amp;gt;  for (U64 bb = 1; mask; bb += bb) {&amp;lt;br/&amp;gt;    if (val &amp;amp;amp; bb)&amp;lt;br/&amp;gt;      res |= mask &amp;amp;amp; -mask;&amp;lt;br/&amp;gt;    mask &amp;amp;amp;= mask - 1;&amp;lt;br/&amp;gt;  }&amp;lt;br/&amp;gt;  return res;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 _pdep_u64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 val, U64 mask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  U64 res &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; mask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;val &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      res &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mask &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;mask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    mask &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mask &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; res&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:145:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PEXT&amp;quot; title=&amp;quot;Anchor: PEXT&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PEXT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:145 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:93:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Instructions-PEXT&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:93 --&gt;PEXT&lt;/h2&gt;
Parallel Bits Extract &lt;!-- ws:start:WikiTextRefRule:49:&amp;amp;lt;ref&amp;amp;gt; &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_pext_u.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_pext_u32/u64&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-10&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-10&quot;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:49 --&gt;. Great to get the &lt;a class=&quot;wiki_link&quot; href=&quot;/First%20Rank%20Attacks#TheOuterSquares&quot;&gt;inner six bit&lt;/a&gt; occupancy of any rank, file, or diagonal as index of six consecutive lower bit, or the up to 12 bits for a &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PEXTBitboards&quot;&gt;magic attack lookup&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:95:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Instructions-PEXT-Intrinsic Prototype&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:95 --&gt;Intrinsic Prototype&lt;/h3&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;unsigned __int64 _pext_u64(unsigned __int64 src, unsigned __int64 mask);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 _pext_u64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 src, &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 mask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:97:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Instructions-PEXT-Sample&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:97 --&gt;Sample&lt;/h3&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;SRC1   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐&amp;lt;br/&amp;gt;       │S63│S62│S61│S60│S59│....│ S7│ S6│ S5│ S4│ S3│ S2│ S1│ S0│ &amp;lt;br/&amp;gt;       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;SRC2   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐&amp;lt;br/&amp;gt;(mask) │ 0 │ 0 │ 0 │ 1 │ 0 │0...│ 1 │ 0 │ 1 │ 0 │ 0 │ 1 │ 0 │ 0 │  (f.i. 4 bits set)&amp;lt;br/&amp;gt;       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;DEST   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐&amp;lt;br/&amp;gt;       │ 0 │ 0 │ 0 │ 0 │ 0 │0...│ 0 │ 0 │ 0 │ 0 │S60│ S7│ S5│ S2│ &amp;lt;br/&amp;gt;       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;SRC1   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐
       │S63│S62│S61│S60│S59│....│ S7│ S6│ S5│ S4│ S3│ S2│ S1│ S0│ 
       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘
&amp;nbsp;
SRC2   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐
(mask) │ 0 │ 0 │ 0 │ 1 │ 0 │0...│ 1 │ 0 │ 1 │ 0 │ 0 │ 1 │ 0 │ 0 │  (f.i. 4 bits set)
       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘
&amp;nbsp;
DEST   ┌───┬───┬───┬───┬───┐    ┌───┬───┬───┬───┬───┬───┬───┬───┐
       │ 0 │ 0 │ 0 │ 0 │ 0 │0...│ 0 │ 0 │ 0 │ 0 │S60│ S7│ S5│ S2│ 
       └───┴───┴───┴───┴───┘    └───┴───┴───┴───┴───┴───┴───┴───┘&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:99:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Instructions-PEXT-Serial Implementation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:99 --&gt;Serial Implementation&lt;/h3&gt;
in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:53:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=48220&amp;amp;amp;start=2&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: PEXT Bitboards&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Gerd%20Isenberg&amp;quot;&amp;gt;Gerd Isenberg&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, June 07, 2013&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-11&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-11&quot;&gt;[11]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:53 --&gt;, quite similar to &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PDEP&quot;&gt;PDEP&lt;/a&gt; in traversing the mask, and only two expressions, &amp;quot;mask &amp;amp; -mask&amp;quot; and &amp;quot;bb&amp;quot; swapped:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 _pext_u64(U64 val, U64 mask) {&amp;lt;br/&amp;gt;  U64 res = 0;&amp;lt;br/&amp;gt;  for (U64 bb = 1; mask; bb += bb) {&amp;lt;br/&amp;gt;    if ( val &amp;amp;amp; mask &amp;amp;amp; -mask )&amp;lt;br/&amp;gt;      res |= bb;&amp;lt;br/&amp;gt;    mask &amp;amp;amp;= mask - 1;&amp;lt;br/&amp;gt;  }&amp;lt;br/&amp;gt;  return res;&amp;lt;br/&amp;gt;} &amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 _pext_u64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 val, U64 mask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  U64 res &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; mask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; bb &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; val &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; mask &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;mask &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      res &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    mask &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mask &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; res&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:146:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PEXTBitboards&amp;quot; title=&amp;quot;Anchor: PEXTBitboards&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PEXTBitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:146 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:101:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc10&quot;&gt;&lt;a name=&quot;Applications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:101 --&gt;Applications&lt;/h1&gt;
&lt;!-- ws:start:WikiTextHeadingRule:103:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc11&quot;&gt;&lt;a name=&quot;Applications-PEXT Bitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:103 --&gt;PEXT Bitboards&lt;/h2&gt;
Fancy &lt;strong&gt;PEXT Bitboards&lt;/strong&gt; as replacement for &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards#Fancy&quot;&gt;Fancy Magic Bitboards&lt;/a&gt;. The relevant up to four ray occupancies are mapped to a dense index range by using the &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PEXT&quot;&gt;PEXT&lt;/a&gt; instruction:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 arrAttacks  [...]; // ~840 KByte all rook and bishop attacks&amp;lt;br/&amp;gt;U64 arrRookMask  [64]; // 10..12 relevant occupancy bits per rook square&amp;lt;br/&amp;gt;U64 arrBishopMask[64]; //  5.. 9 relevant occupancy bits per bishop square&amp;lt;br/&amp;gt;U32 arrRookBase  [64]; // arrAttacks base offset per rook square&amp;lt;br/&amp;gt;U32 arrBishopBase[64]; // arrAttacks base offset per bishop square&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 rookAttack(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;  return arrAttacks[arrRookBase[sq] + _pext_u64(occ, arrRookMask[sq])];&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 bishopAttack(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;  return arrAttacks[arrBishopBase[sq] + _pext_u64(occ, arrBishopMask[sq])];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 arrAttacks  &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;...&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// ~840 KByte all rook and bishop attacks&lt;/span&gt;
U64 arrRookMask  &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 10..12 relevant occupancy bits per rook square&lt;/span&gt;
U64 arrBishopMask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;//  5.. 9 relevant occupancy bits per bishop square&lt;/span&gt;
U32 arrRookBase  &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// arrAttacks base offset per rook square&lt;/span&gt;
U32 arrBishopBase&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// arrAttacks base offset per bishop square&lt;/span&gt;
&amp;nbsp;
U64 rookAttack&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; arrAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;arrRookBase&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; _pext_u64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, arrRookMask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 bishopAttack&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; arrAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;arrBishopBase&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; _pext_u64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, arrBishopMask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:147:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PDEPBitboards&amp;quot; title=&amp;quot;Anchor: PDEPBitboards&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PDEPBitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:147 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:105:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc12&quot;&gt;&lt;a name=&quot;Applications-PEXT/PDEP Bitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:105 --&gt;PEXT/PDEP Bitboards&lt;/h2&gt;
An idea for denser sliding attack tables is also using &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PDEP&quot;&gt;PDEP&lt;/a&gt;, dividing the table size of the &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PEXTBitboards&quot;&gt;PEXT Bitboards&lt;/a&gt; by four but some trailing computation. Looking up &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;16-bit words&lt;/a&gt; instead of bitboards - to get the scattered bits of the up to four ray attacks per square in an extracted form mapped to a 16-bit word, which then becomes the attack bitboard by performing a deposit instruction with an appropriate second mask per square. The technique was introduced by &lt;a class=&quot;wiki_link&quot; href=&quot;/Zach%20Wegner&quot;&gt;Zach Wegner&lt;/a&gt; in &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:57:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=40333&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Haswell New Instructions&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Zach%20Wegner&amp;quot;&amp;gt;Zach Wegner&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, September 09, 2011&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-12&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-12&quot;&gt;[12]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:57 --&gt; &lt;!-- ws:start:WikiTextRefRule:61:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=40333&amp;amp;amp;start=12&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Haswell New Instructions&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Gerd%20Isenberg&amp;quot;&amp;gt;Gerd Isenberg&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, September 12, 2011&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-13&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-13&quot;&gt;[13]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:61 --&gt; and implemented by &lt;a class=&quot;wiki_link&quot; href=&quot;/Ronald%20de%20Man&quot;&gt;Ronald de Man&lt;/a&gt; with a table of slightly more than 210 KiB &lt;!-- ws:start:WikiTextRefRule:65:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=49611&amp;amp;amp;start=1&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: 152k rook and bishop attacks using PEXT and PDEP&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Ronald%20de%20Man&amp;quot;&amp;gt;Ronald de Man&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, October 06, 2013&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-14&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-14&quot;&gt;[14]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:65 --&gt; &lt;!-- ws:start:WikiTextRefRule:68:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://github.com/syzygy1/tb/blob/master/src/bmi2.h&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;tb/src/bmi2.h at master · syzygy1/tb · GitHub&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Ronald%20de%20Man&amp;quot;&amp;gt;Ronald de Man&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-15&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-15&quot;&gt;[15]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:68 --&gt;. Ronald&#039;s code was  tested by &lt;a class=&quot;wiki_link&quot; href=&quot;/Jean-Francois%20Romang&quot;&gt;Jean-Francois Romang&lt;/a&gt; using &lt;a class=&quot;wiki_link&quot; href=&quot;/Stockfish&quot;&gt;Stockfish&lt;/a&gt; as testbed, giving promising results   &lt;!-- ws:start:WikiTextRefRule:72:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=51879&amp;amp;amp;start=2&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Stockfish haswell optimized build&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Jean-Francois%20Romang&amp;quot;&amp;gt;Jean-Francois Romang&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, April 06, 2014&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-16&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-16&quot;&gt;[16]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:72 --&gt; &lt;!-- ws:start:WikiTextRefRule:75:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://github.com/jromang/Stockfish/blob/bmi2/src/bitboard.h#L255&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Stockfish/src/bitboard.h at bmi2 · jromang/Stockfish · GitHub&amp;lt;/a&amp;gt; by  &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Jean-Francois%20Romang&amp;quot;&amp;gt;Jean-Francois Romang&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-17&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-17&quot;&gt;[17]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:75 --&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:107:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc13&quot;&gt;&lt;a name=&quot;Applications-Syzygy Generator&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:107 --&gt;Syzygy Generator&lt;/h2&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Ronald%20de%20Man&quot;&gt;Ronald de Man&#039;s&lt;/a&gt; generator for &lt;a class=&quot;wiki_link&quot; href=&quot;/Syzygy%20Bases&quot;&gt;Syzygy Bases&lt;/a&gt; can take profit of &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PDEP&quot;&gt;PDEP&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PEXT&quot;&gt;PEXT&lt;/a&gt; instructions, or to use their serial implementations to further reduce the size of his already compact &lt;a class=&quot;wiki_link&quot; href=&quot;/Endgame%20Tablebases&quot;&gt;endgame tablebases&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:79:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=48220&amp;amp;amp;start=1&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: PEXT Bitboards&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Ronald%20de%20Man&amp;quot;&amp;gt;Ronald de Man&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, June 07, 2013&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-18&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-18&quot;&gt;[18]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:79 --&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:109:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc14&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:109 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;BitScan&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling&quot;&gt;Bit-Twiddling&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations&quot;&gt;General Setwise Operations&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/TBM&quot;&gt;TBM&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:111:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc15&quot;&gt;&lt;a name=&quot;Manuals&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:111 --&gt;Manuals&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/file/36945&quot; rel=&quot;nofollow&quot;&gt;Intel AVX and AVX2 Programming Reference&lt;/a&gt; (pdf)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:113:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc16&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:113 --&gt;Forum Posts&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=40333&quot; rel=&quot;nofollow&quot;&gt;Haswell New Instructions&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Zach%20Wegner&quot;&gt;Zach Wegner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 09, 2011&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.randombit.net/bitbashing/2012/06/22/haswell_bit_permutations.html&quot; rel=&quot;nofollow&quot;&gt;Bit manipulations using BMI2&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.randombit.net/&quot; rel=&quot;nofollow&quot;&gt;Jack Lloyd&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.randombit.net/&quot; rel=&quot;nofollow&quot;&gt;/ :: bitbashing&lt;/a&gt;, June 22, 2012&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=48220&quot; rel=&quot;nofollow&quot;&gt;PEXT Bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 07, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=49611&quot; rel=&quot;nofollow&quot;&gt;152k rook and bishop attacks using PEXT and PDEP&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Lasse%20Hansen&quot;&gt;Lasse Hansen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, October 06, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=51879&quot; rel=&quot;nofollow&quot;&gt;Stockfish haswell optimized build&lt;/a&gt;  by &lt;a class=&quot;wiki_link&quot; href=&quot;/Jean-Francois%20Romang&quot;&gt;Jean-Francois Romang&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 06, 2014 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Stockfish&quot;&gt;Stockfish&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=58910&quot; rel=&quot;nofollow&quot;&gt;smaller tables for PEXT-style attack getters&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Wylie%20Garvin&quot;&gt;Wylie Garvin&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 13, 2016&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=63978&quot; rel=&quot;nofollow&quot;&gt;BMI2 intrinsics in gcc&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/%C3%81lvaro%20Begu%C3%A9&quot;&gt;Álvaro Begué&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 14, 2017&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://rybkaforum.net/cgi-bin/rybkaforum/topic_show.pl?tid=32016&quot; rel=&quot;nofollow&quot;&gt;Ryzen Fritz Chess Benchmarks ?&lt;/a&gt; by ralunger, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Rybka Forum&lt;/a&gt;, March 03, 2017&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.reddit.com/r/Amd/comments/60i6er/ryzen_and_bmi2_strange_behavior_and_high_latencies/&quot; rel=&quot;nofollow&quot;&gt;Ryzen and BMI2: Strange behavior and high latencies&lt;/a&gt; by DonnieTinyHands, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Reddit&quot; rel=&quot;nofollow&quot;&gt;Reddit&lt;/a&gt;, March 20, 2017 » &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PEXT&quot;&gt;BMI2 PEXT&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=65191&quot; rel=&quot;nofollow&quot;&gt;BMI2 PEXT idea for attacks generation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Mark%20Lefler&quot;&gt;Mark Lefler&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 16, 2017&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=66737&amp;amp;start=4&quot; rel=&quot;nofollow&quot;&gt;Re: Komodo 11.3&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Mark%20Lefler&quot;&gt;Mark Lefler&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, March 04, 2018 » &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PEXT&quot;&gt;BMI2 PEXT&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Komodo#11&quot;&gt;Komodo 11.3&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:115:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc17&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:115 --&gt;External Links&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets&quot; rel=&quot;nofollow&quot;&gt;Bit Manipulation Instruction Sets from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://semipublic.comp-arch.net/wiki/Compress_Bits_Under_Mask&quot; rel=&quot;nofollow&quot;&gt;Compress Bits Under Mask - CompArch&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/en-us/tags/36092&quot; rel=&quot;nofollow&quot;&gt;BMI2 | Intel® Developer Zone&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.randombit.net/bitbashing/2012/06/22/haswell_bit_permutations.html&quot; rel=&quot;nofollow&quot;&gt;Bit manipulations using BMI2 — bitbashing&lt;/a&gt;, June 22, 2012&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/en-us/articles/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family&quot; rel=&quot;nofollow&quot;&gt;How to detect New Instruction support in the 4th generation Intel® Core™ processor family | Intel® Developer Zone&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/de-de/user/76418&quot; rel=&quot;nofollow&quot;&gt;Max Locktyukhin&lt;/a&gt;, August 05, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://users.atw.hu/instlatx64/GenuineIntel00306C3_Haswell_InstLatX64.txt&quot; rel=&quot;nofollow&quot;&gt;Haswell Instructions Latency&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/landingpage/IntrinsicsGuide/&quot; rel=&quot;nofollow&quot;&gt;Intel Intrinsics Guide&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:117:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc18&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:117 --&gt;References&lt;/h1&gt;
&lt;!-- ws:start:WikiTextReferencesRule:338:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://de.linkedin.com/pub/andreas-stiller/a/381/aa9&quot; rel=&quot;nofollow&quot;&gt;Andreas Stiller&lt;/a&gt; (&lt;strong&gt;2013&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.heise.de/ct/inhalt/2013/14/114/&quot; rel=&quot;nofollow&quot;&gt;Der Rechenkünstler&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.heise.de/ct/&quot; rel=&quot;nofollow&quot;&gt;c&#039;t Magazin für Computertechnik&lt;/a&gt; 14/2013, p. 114-119 (German)&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/en-us/articles/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family&quot; rel=&quot;nofollow&quot;&gt;How to detect New Instruction support in the 4th generation Intel® Core™ processor family | Intel® Developer Zone&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/de-de/user/76418&quot; rel=&quot;nofollow&quot;&gt;Max Locktyukhin&lt;/a&gt;, August 05, 2013&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://rybkaforum.net/cgi-bin/rybkaforum/topic_show.pl?tid=32016&quot; rel=&quot;nofollow&quot;&gt;Ryzen Fritz Chess Benchmarks ?&lt;/a&gt; by ralunger, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Rybka Forum&lt;/a&gt;, March 03, 2017&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.reddit.com/r/Amd/comments/60i6er/ryzen_and_bmi2_strange_behavior_and_high_latencies/&quot; rel=&quot;nofollow&quot;&gt;Ryzen and BMI2: Strange behavior and high latencies&lt;/a&gt; by DonnieTinyHands, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Reddit&quot; rel=&quot;nofollow&quot;&gt;Reddit&lt;/a&gt;, March 20, 2017 » &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2#PEXT&quot;&gt;BMI2 PEXT&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informatik.uni-trier.de/~ley/pers/hd/l/Lee:Ruby_B=&quot; rel=&quot;nofollow&quot;&gt;Ruby Lee&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informatik.uni-trier.de/~ley/pers/hd/s/Shi:Zhijie_Jerry.html&quot; rel=&quot;nofollow&quot;&gt;Zhijie Shi&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informatik.uni-trier.de/~ley/pers/hd/y/Yang:Xiao.html&quot; rel=&quot;nofollow&quot;&gt;Xiao Yang&lt;/a&gt; (&lt;strong&gt;2001&lt;/strong&gt;). &lt;em&gt;Efficient Permutation Instructions for Fast Software Cryptography&lt;/em&gt;. Micro, IEEE, Vol. 21,  No. 6, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://palms.ee.princeton.edu/PALMSopen/lee01efficient.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=40333&quot; rel=&quot;nofollow&quot;&gt;Haswell New Instructions&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Zach%20Wegner&quot;&gt;Zach Wegner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 09, 2011&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_bzhi_u.htm&quot; rel=&quot;nofollow&quot;&gt;_bzhi_u32/u64&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-8&quot;&gt;&lt;a href=&quot;#cite_ref-8&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_pdep_u.htm&quot; rel=&quot;nofollow&quot;&gt;_pdep_u32/u64&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-9&quot;&gt;&lt;a href=&quot;#cite_ref-9&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=48220&amp;amp;start=1&quot; rel=&quot;nofollow&quot;&gt;Re: PEXT Bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Ronald%20de%20Man&quot;&gt;Ronald de Man&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 07, 2013&lt;/li&gt;
&lt;li id=&quot;cite_note-10&quot;&gt;&lt;a href=&quot;#cite_ref-10&quot;&gt;^&lt;/a&gt;  &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/intref_cls/common/intref_avx2_pext_u.htm&quot; rel=&quot;nofollow&quot;&gt;_pext_u32/u64&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-11&quot;&gt;&lt;a href=&quot;#cite_ref-11&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=48220&amp;amp;start=2&quot; rel=&quot;nofollow&quot;&gt;Re: PEXT Bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 07, 2013&lt;/li&gt;
&lt;li id=&quot;cite_note-12&quot;&gt;&lt;a href=&quot;#cite_ref-12&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=40333&quot; rel=&quot;nofollow&quot;&gt;Haswell New Instructions&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Zach%20Wegner&quot;&gt;Zach Wegner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 09, 2011&lt;/li&gt;
&lt;li id=&quot;cite_note-13&quot;&gt;&lt;a href=&quot;#cite_ref-13&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=40333&amp;amp;start=12&quot; rel=&quot;nofollow&quot;&gt;Re: Haswell New Instructions&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 12, 2011&lt;/li&gt;
&lt;li id=&quot;cite_note-14&quot;&gt;&lt;a href=&quot;#cite_ref-14&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=49611&amp;amp;start=1&quot; rel=&quot;nofollow&quot;&gt;Re: 152k rook and bishop attacks using PEXT and PDEP&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Ronald%20de%20Man&quot;&gt;Ronald de Man&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, October 06, 2013&lt;/li&gt;
&lt;li id=&quot;cite_note-15&quot;&gt;&lt;a href=&quot;#cite_ref-15&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://github.com/syzygy1/tb/blob/master/src/bmi2.h&quot; rel=&quot;nofollow&quot;&gt;tb/src/bmi2.h at master · syzygy1/tb · GitHub&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Ronald%20de%20Man&quot;&gt;Ronald de Man&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-16&quot;&gt;&lt;a href=&quot;#cite_ref-16&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=51879&amp;amp;start=2&quot; rel=&quot;nofollow&quot;&gt;Re: Stockfish haswell optimized build&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Jean-Francois%20Romang&quot;&gt;Jean-Francois Romang&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 06, 2014&lt;/li&gt;
&lt;li id=&quot;cite_note-17&quot;&gt;&lt;a href=&quot;#cite_ref-17&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://github.com/jromang/Stockfish/blob/bmi2/src/bitboard.h#L255&quot; rel=&quot;nofollow&quot;&gt;Stockfish/src/bitboard.h at bmi2 · jromang/Stockfish · GitHub&lt;/a&gt; by  &lt;a class=&quot;wiki_link&quot; href=&quot;/Jean-Francois%20Romang&quot;&gt;Jean-Francois Romang&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-18&quot;&gt;&lt;a href=&quot;#cite_ref-18&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=48220&amp;amp;start=1&quot; rel=&quot;nofollow&quot;&gt;Re: PEXT Bitboards&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Ronald%20de%20Man&quot;&gt;Ronald de Man&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 07, 2013&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:338 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:119:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc19&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:119 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:08:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;BMI2&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;BMI2&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-BMI2 includeBody-BMI2 includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AMD&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AMD&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Andscacs&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Andscacs&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 16, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Arasan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Arasan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 8, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/asmFish&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;asmFish&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 14, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit-Twiddling&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit-Twiddling&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cpp&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cpp&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fizbo&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fizbo&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 22, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Flipping+Mirroring+and+Rotating&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Flipping Mirroring and Rotating&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 14, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/GullChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;GullChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Intel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Intel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Komodo&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Komodo&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Lasse+Hansen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Lasse Hansen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 1, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Magic+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Magic Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Senpai&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Senpai&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Stockfish&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Stockfish&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 7, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Syzygy+Bases&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Syzygy Bases&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/TBM&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;TBM&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 28, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Winter&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Winter&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 23, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Xiphos&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Xiphos&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 22, 2018&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:08 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Byte</title>
      <link>https://chessprogramming.wikispaces.com/Byte</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Byte</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Byte</comments>
      <pubDate>Fri, 05 Apr 2013 17:31:50 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:13:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:13 --&gt;&lt;!-- ws:start:WikiTextTocRule:14: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Char&quot;&gt;Char&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:14 --&gt;&lt;!-- ws:start:WikiTextTocRule:15: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#SWAR Bytes&quot;&gt;SWAR Bytes&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:15 --&gt;&lt;!-- ws:start:WikiTextTocRule:16: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:16 --&gt;&lt;!-- ws:start:WikiTextTocRule:17: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:17 --&gt;&lt;!-- ws:start:WikiTextTocRule:18: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:18 --&gt;&lt;!-- ws:start:WikiTextTocRule:19: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:19 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Programming&quot;&gt;Programming&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Data&quot;&gt;Data&lt;/a&gt; * Byte&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
A &lt;strong&gt;Byte&lt;/strong&gt;, more precise an &lt;strong&gt;Octet&lt;/strong&gt;, is a unit of measurement of information storage, consisting of &lt;strong&gt;eight&lt;/strong&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit&quot;&gt;bits&lt;/a&gt;. In most computer architectures it is the granularity of memory addresses, containing 8-bit numbers, 256 different symbols - interpreted as signed or unsigned numbers, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/ASCII&quot; rel=&quot;nofollow&quot;&gt;ASCII&lt;/a&gt; characters or machine code. Processors provide byte-wise arithmetical and logical units. &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; can address the two lower bytes of each 32 or 64 bit register, for instance AL and AH from EAX or RAX. &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD&lt;/a&gt; instruction sets like &lt;a class=&quot;wiki_link&quot; href=&quot;/MMX&quot;&gt;MMX&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/AltiVec&quot;&gt;AltiVec&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt; provide operations on vectors of eight or sixteen bytes inside appropriate SIMD-registers.&lt;br /&gt;
&lt;br /&gt;
The programming languages &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; define a byte as a &amp;quot;addressable unit of data storage large enough to hold any member of the basic character set of the execution environment&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:3:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Char&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:3 --&gt;Char&lt;/h1&gt;
The &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;-datatype &lt;strong&gt;unsigned char&lt;/strong&gt; cover one byte and has a numerical range of 0 to 255. The primitive &lt;strong&gt;char&lt;/strong&gt; in &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt; is a signed byte, and ranges from -128 to +127. Same is likely true for signed char in C, though &lt;a class=&quot;wiki_link&quot; href=&quot;/Two%27s%20Complement&quot;&gt;two&#039;s complement&lt;/a&gt; is not strictly specified. Same is true for signed right shifts, where &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; performs shift arithmetical right, but other processors and their compilers eventually shift in always zeros. Bytes are therefor often type defined as &lt;strong&gt;unsigned char&lt;/strong&gt; in C:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;typedef unsigned char BYTE;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;typedef unsigned char BYTE;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mailbox&quot;&gt;Mailbox&lt;/a&gt; chess programs often use an &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;array&lt;/a&gt; of bytes for a dense &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt;, where each byte contains &lt;a class=&quot;wiki_link&quot; href=&quot;/Pieces#PieceCoding&quot;&gt;piece- or empty square code&lt;/a&gt; for each indexed &lt;a class=&quot;wiki_link&quot; href=&quot;/Squares&quot;&gt;square&lt;/a&gt;. A Byte is also sufficient to store usual (0..63), or &lt;a class=&quot;wiki_link&quot; href=&quot;/0x88&quot;&gt;0x88&lt;/a&gt; board coordinates. A byte can contain a rank of a &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboard&lt;/a&gt;. For pawn-structure issues, &lt;a class=&quot;wiki_link&quot; href=&quot;/Pawns%20and%20Files%20%28Bitboards%29#Fileset&quot;&gt;filesets&lt;/a&gt; are a dense set-wise representation to cover boolean properties for each &lt;a class=&quot;wiki_link&quot; href=&quot;/Files&quot;&gt;file&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
A byte can be written with two hexadecimal digits, 0x00 to 0xff in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;. Take care and compiler warnings serious, if wider types are assigned to bytes - since all upper bits are lost, if wider types are outside the valid signed or unsigned range.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;SWAR Bytes&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;SWAR Bytes&lt;/h1&gt;
To apply &#039;add&#039; or &#039;sub&#039; on vectors of bytes (or any arbitrary structure) &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques#SWAR&quot;&gt;SWAR-wise&lt;/a&gt; within a 32-bit or 64-bit register, we have to take care carries and borrows don&#039;t wrap around. Thus we apply a mask of all most significant bits (H) and &#039;add&#039; in two steps, one &#039;add&#039; with MSB clear and one add modulo 2 aka &#039;xor&#039; for the MSB itself. For byte-wise math of a vector of four bytes inside a 32-bit register, H is 0x80808080 and L is 0x01010101.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;SWAR add z = x + y&amp;lt;br/&amp;gt;    z = ((x &amp;amp;amp;~H) + (y &amp;amp;amp;~H)) ^ ((x ^ y) &amp;amp;amp; H)&amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;SWAR sub z = x - y&amp;lt;br/&amp;gt;    z = ((x | H) - (y &amp;amp;amp;~H)) ^ ((x ^~y) &amp;amp;amp; H)&amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;SWAR average z = (x+y)/2 based on x + y = (x^y) + 2*(x&amp;amp;amp;y)&amp;lt;br/&amp;gt;    z = (x &amp;amp;amp; y) + (((x ^ y) &amp;amp;amp; ~L) &amp;amp;gt;&amp;amp;gt; 1)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;SWAR add z &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; y
    z &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;~H&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;~H&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; H&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
SWAR sub z &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; y
    z &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; H&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;~H&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;~y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; H&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
SWAR average z &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; based on x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; y &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    z &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~L&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Byte%20Magazine&quot;&gt;Byte Magazine&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Nibble&quot;&gt;Nibble&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pawns%20and%20Files%20%28Bitboards%29#Fileset&quot;&gt;Filesets&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/First%20Rank%20Attacks&quot;&gt;First Rank Attacks&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;Word&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;Double Word&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;Quad Word&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques#SWAR&quot;&gt;SWAR&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Byte&quot; rel=&quot;nofollow&quot;&gt;Byte from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Octet_%28computing%29&quot; rel=&quot;nofollow&quot;&gt;Octet from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;What links here?&lt;/h1&gt;
&lt;!-- ws:start:WikiTextIncludeRule:02:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Byte&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Byte&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Byte includeBody-Byte includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tfoot class=&quot;includeBacklinksFooter&quot;&gt;
    &lt;tr&gt;
      &lt;td colspan=&quot;5&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/page/links/Byte&quot;&gt;More Links&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tfoot&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/0x88&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;0x88&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 28, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/10x12+Board&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;10x12 Board&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/6502&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;6502&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/6800&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;6800&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/8080&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;8080&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/8086&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;8086&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 18, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/8x8+Board&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;8x8 Board&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AltiVec&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AltiVec&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Array&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Array&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 1, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Attack+and+Defend+Maps&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Attack and Defend Maps&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX-512&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX-512&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Backtracking&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Backtracking&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Big-endian&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Big-endian&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 29, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Serialization&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Serialization&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Byte&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Byte&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CDC+6600&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CDC 6600&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 8, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Crafty&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Crafty&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CXG+Sensor+Computachess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CXG Sensor Computachess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Data&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Data&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DEC+Alpha&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DEC Alpha&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 15, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dictionary&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dictionary&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Distance&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Distance&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double+Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Edwards%27+Tablebases&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Edwards&amp;#039; Tablebases&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Encoding+Moves&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Encoding Moves&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Endgame+Tablebases&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Endgame Tablebases&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Endianness&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Endianness&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Eric+van+Riet+Paap&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Eric van Riet Paap&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fairchild+F8&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fairchild F8&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 31, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/First+Rank+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;First Rank Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 28, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Floyd&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Floyd&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gambiet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gambiet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Graphics+Programming&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Graphics Programming&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 22, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hyperbola+Quintessence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hyperbola Quintessence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/i860&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;i860&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 21, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/IBM+360&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;IBM 360&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/KIM-1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;KIM-1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kindergarten+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kindergarten Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kurt&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kurt&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 20, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Little-endian&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Little-endian&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Magic+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Magic Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Manhattan-Distance&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Manhattan-Distance&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 19, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mini+Chess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mini Chess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MMX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MMX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Murka&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Murka&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nibble&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nibble&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nova&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nova&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Novag+Micro+Chess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Novag Micro Chess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 16, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Othello&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Othello&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pascal&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pascal&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 28, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Paul+Wiereyn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Paul Wiereyn&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 4, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawns+and+Files+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawns and Files (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 16, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Piece-Lists&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Piece-Lists&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 13, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pieces&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pieces&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Population+Count&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Population Count&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Quad+Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Quad Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Queue&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Queue&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:02 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Data&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Double Word</title>
      <link>https://chessprogramming.wikispaces.com/Double+Word</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Double+Word</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Double+Word</comments>
      <pubDate>Sun, 25 Jan 2015 22:17:54 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:20:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:20 --&gt;&lt;!-- ws:start:WikiTextTocRule:21: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Integer and long&quot;&gt;Integer and long&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextTocRule:22: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Ranges&quot;&gt;Ranges&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;!-- ws:start:WikiTextTocRule:23: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Alignment&quot;&gt;Alignment&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Endianness&quot;&gt;Endianness&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Endianness-Litte-endian layout&quot;&gt;Litte-endian layout&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Endianness-Big-endian layout&quot;&gt;Big-endian layout&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Programming&quot;&gt;Programming&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Data&quot;&gt;Data&lt;/a&gt; * Double Word&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
According to &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&#039;s&lt;/a&gt; definition of a &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; 16-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;Word&lt;/a&gt;, a &lt;strong&gt;Double Word&lt;/strong&gt; refers a 32-bit entity, while &lt;a class=&quot;wiki_link&quot; href=&quot;/IBM%20360&quot;&gt;IBM 360&lt;/a&gt; and successors with 32-bit words have double words with 64-bit.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:2:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Integer and long&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:2 --&gt;Integer and long&lt;/h1&gt;
 Even in &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt;, double words are still considered as default word size. &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; and and &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/C-Compiler&quot;&gt;C-Compiler&lt;/a&gt; use double words as signed and unsigned integers, &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt; integers as well. Microsoft 64 bit compiler long is a 32-bit Double word as well, while with 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Free%20Software%20Foundation#GCC&quot;&gt;GCC&lt;/a&gt; uses 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;Quad Words&lt;/a&gt; as longs.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;typedef unsigned int DWORD;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; DWORD&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:4:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Ranges&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:4 --&gt;Ranges&lt;/h1&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;type&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;language&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;min&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;max&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;unsigned int&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;4,294,967,295&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;hexadecimal&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x00000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0xFFFFFFFF&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;int&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;-2,147,483,648&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;2,147,483,647&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;hexadecimal&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x80000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x7FFFFFFF&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:6:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Alignment&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:6 --&gt;Alignment&lt;/h1&gt;
 Double Words stored in memory should be stored at byte addresses divisible by four. Otherwise at runtime it will cause a miss-alignment exception on some processors, or a huge penalty on others.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:8:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Endianness&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:8 --&gt;Endianness&lt;/h1&gt;
 &lt;em&gt;Main article: &lt;a class=&quot;wiki_link&quot; href=&quot;/Endianness&quot;&gt;Endianness&lt;/a&gt;.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:10:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Endianness-Litte-endian layout&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:10 --&gt;Litte-endian layout&lt;/h2&gt;
 The &lt;a class=&quot;wiki_link&quot; href=&quot;/Little-endian&quot;&gt;little-endian&lt;/a&gt; memory layout, as typical for &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; cpus.&lt;br /&gt;
For instance the double word integer 16909060 or 0x01020304:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;Address&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Byte&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Significance&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x04&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;LS Byte&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x03&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0002&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x02&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0003&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x01&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;MS Byte&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:12:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Endianness-Big-endian layout&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:12 --&gt;Big-endian layout&lt;/h2&gt;
 The &lt;a class=&quot;wiki_link&quot; href=&quot;/Big-endian&quot;&gt;big-endian&lt;/a&gt; memory layout, as typical for &lt;a class=&quot;wiki_link&quot; href=&quot;/Motorola&quot;&gt;Motorola&lt;/a&gt; cpus.&lt;br /&gt;
For instance the double word integer 16909060 or 0x01020304:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;Address&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Byte&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Significance&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x01&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;MS Byte&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x02&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0002&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x03&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0003&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x04&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;LS Byte&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:14:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:14 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Piece-Sets&quot;&gt;Piece-Sets&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;Byte&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;Word&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;Quad Word&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:16:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:16 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Word_%28computer_science%29#Dword.2C_Qword.2C_and_Oword&quot; rel=&quot;nofollow&quot;&gt;Dword, Qword, and Oword from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Byte&quot; rel=&quot;nofollow&quot;&gt;Byte from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Endianness&quot; rel=&quot;nofollow&quot;&gt;Endianness from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://betterexplained.com/articles/understanding-big-and-little-endian-byte-order/&quot; rel=&quot;nofollow&quot;&gt;Understanding Big and Little Endian Byte Order&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.rdrop.com/%7Ecary/html/endian_faq.html&quot; rel=&quot;nofollow&quot;&gt;DAV&#039;s Endian FAQ - ON HOLY WARS AND A PLEA FOR PEACE&lt;/a&gt; by Danny Cohen&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:18:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:18 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:01:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Double Word&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Double Word&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Double_Word includeBody-Double%20Word includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AltiVec&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AltiVec&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amundsen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amundsen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Avoiding+Branches&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Avoiding Branches&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX-512&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX-512&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Big-endian&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Big-endian&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 29, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Serialization&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Serialization&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Byte&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Byte&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Data&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Data&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DEC+Alpha&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DEC Alpha&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 15, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dictionary&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dictionary&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double+Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Encoding+Moves&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Encoding Moves&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Float&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Float&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Little-endian&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Little-endian&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MMX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MMX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Murka&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Murka&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/NoraGrace&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;NoraGrace&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 23, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Piece-Sets&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Piece-Sets&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Prophet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Prophet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Quad+Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Quad Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Spector&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Spector&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Transposition+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Transposition Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tucano&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tucano&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/XOP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;XOP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:01 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Data&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>General Setwise Operations</title>
      <link>https://chessprogramming.wikispaces.com/General+Setwise+Operations</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/General+Setwise+Operations</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/General+Setwise+Operations</comments>
      <pubDate>Sun, 25 Feb 2018 19:37:00 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * General Setwise Operations&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:1247:&amp;lt;a href=&amp;quot;http://www.reisser-kunstpostkarten.de/en/index.asp?aid=3076&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Yellow_Circle.jpg/157880555/Yellow_Circle.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://www.reisser-kunstpostkarten.de/en/index.asp?aid=3076&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Yellow_Circle.jpg/157880555/Yellow_Circle.jpg&quot; alt=&quot;Yellow_Circle.jpg&quot; title=&quot;Yellow_Circle.jpg&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1247 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;General Setwise Operations&lt;/strong&gt;,&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Binary_operation&quot; rel=&quot;nofollow&quot;&gt;binary&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Unary_operation&quot; rel=&quot;nofollow&quot;&gt;unary operations&lt;/a&gt;, essential in testing and manipulating bitboards within a chess program. &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Relational&quot;&gt;Relational operators&lt;/a&gt; on bitboards test for equality, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Bitwisebooleanoperations&quot;&gt;bitwise boolean operators&lt;/a&gt; perform the intrinsic setwise operations &lt;!-- ws:start:WikiTextRefRule:161:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#Ershov&amp;quot;&amp;gt;Andrey Ershov&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mikhail%20R.%20Shura-Bura&amp;quot;&amp;gt;Mikhail R. Shura-Bura&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1980&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://ershov.iis.nsk.su/archive/eaindex.asp?lang=2&amp;amp;amp;gid=910&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The Early Development of Programming in the USSR&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;. in &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Nicholas_C._Metropolis&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Nicholas C. Metropolis&amp;lt;/a&amp;gt; (ed.) &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://dl.acm.org/citation.cfm?id=578384&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;A History of Computing in the Twentieth Century&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Academic_Press&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Academic Press&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://ershov.iis.nsk.su/archive/eaimage.asp?did=28792&amp;amp;amp;fileid=173670&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;preprint pp. 43&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:161 --&gt; &lt;!-- ws:start:WikiTextRefRule:170:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Lazar_Lyusternik&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Lazar A. Lyusternik&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.mathnet.ru/php/person.phtml?personid=30351&amp;amp;amp;option_lang=eng&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Aleksandr A. Abramov&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Victor_Shestakov&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Victor I. Shestakov&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mikhail%20R.%20Shura-Bura&amp;quot;&amp;gt;Mikhail R. Shura-Bura&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1952&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Programming for High-Speed Electronic Computers&amp;lt;/em&amp;gt;. (Программирование для электронных счетных машин)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:170 --&gt;, such as &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;complement&lt;/a&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ShiftingBitboards&quot;&gt;Shifting bitboards&lt;/a&gt; simulates piece movement, while finally &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ArithmeticalOperations&quot;&gt;arithmetical operations&lt;/a&gt; are used in &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling&quot;&gt;bit-twiddling&lt;/a&gt; applications and to calculate various hash-indicies. &lt;br /&gt;
&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Operator_%28mathematics%29&quot; rel=&quot;nofollow&quot;&gt;Operators&lt;/a&gt; are denoted with focus on the &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Pascal&quot;&gt;Pascal&lt;/a&gt; programming languages, as well as the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Mnemonic#Assembly_mnemonics&quot; rel=&quot;nofollow&quot;&gt;mnemonics&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly&quot;&gt;Assembly&lt;/a&gt; language instructions including &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling#BitManipulation&quot;&gt;bit-manipulation&lt;/a&gt; (&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2&quot;&gt;BMI2&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/TBM&quot;&gt;TBM&lt;/a&gt;) and &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD&lt;/a&gt; expansions (&lt;a class=&quot;wiki_link&quot; href=&quot;/MMX&quot;&gt;MMX&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt;), &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/List_of_mathematical_symbols&quot; rel=&quot;nofollow&quot;&gt;Mathematical symbols&lt;/a&gt;, some &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;Venn diagrams&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:178:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#Venn&amp;quot;&amp;gt;John Venn&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1880&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.tandfonline.com/doi/abs/10.1080/14786448008626877#.U3kRnHYfwgI&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;On the Diagrammatic and Mechanical Representation of Propositions and Reasonings&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Philosophical_Magazine&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Philosophical Magazine&amp;lt;/a&amp;gt;, Vol. 9, No. 59&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:178 --&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Truth_table&quot; rel=&quot;nofollow&quot;&gt;Truth tables&lt;/a&gt;, and bitboard diagrams where appropriate.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Arts#Kandinsky&quot;&gt;Wassily Kandinsky&lt;/a&gt;, Yellow Circle &lt;!-- ws:start:WikiTextRefRule:181:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.reisser-kunstpostkarten.de/en/index.asp?aid=3076&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Wassily Kandinsky - Yellow Circle, 1926&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.reisser-kunstpostkarten.de/en/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Art-postcards and museum-shop, Reisser-Kunstpostkarten.de&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:181 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:358:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:358 --&gt;&lt;!-- ws:start:WikiTextTocRule:359: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Relational&quot;&gt;Relational&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:359 --&gt;&lt;!-- ws:start:WikiTextTocRule:360: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Relational-Equality&quot;&gt;Equality&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:360 --&gt;&lt;!-- ws:start:WikiTextTocRule:361: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Relational-Empty and Universe&quot;&gt;Empty and Universe&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:361 --&gt;&lt;!-- ws:start:WikiTextTocRule:362: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Bitwise Boolean&quot;&gt;Bitwise Boolean&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:362 --&gt;&lt;!-- ws:start:WikiTextTocRule:363: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitwise Boolean-Intersection&quot;&gt;Intersection&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:363 --&gt;&lt;!-- ws:start:WikiTextTocRule:364: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitwise Boolean-Union&quot;&gt;Union&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:364 --&gt;&lt;!-- ws:start:WikiTextTocRule:365: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitwise Boolean-Complement Set&quot;&gt;Complement Set&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:365 --&gt;&lt;!-- ws:start:WikiTextTocRule:366: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitwise Boolean-Relative Complement&quot;&gt;Relative Complement&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:366 --&gt;&lt;!-- ws:start:WikiTextTocRule:367: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitwise Boolean-Implication&quot;&gt;Implication&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:367 --&gt;&lt;!-- ws:start:WikiTextTocRule:368: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitwise Boolean-Exclusive Or&quot;&gt;Exclusive Or&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:368 --&gt;&lt;!-- ws:start:WikiTextTocRule:369: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitwise Boolean-Equivalence&quot;&gt;Equivalence&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:369 --&gt;&lt;!-- ws:start:WikiTextTocRule:370: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitwise Boolean-Majority&quot;&gt;Majority&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:370 --&gt;&lt;!-- ws:start:WikiTextTocRule:371: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Bitwise Boolean-Greater One Sets&quot;&gt;Greater One Sets&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:371 --&gt;&lt;!-- ws:start:WikiTextTocRule:372: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Shifting Bitboards&quot;&gt;Shifting Bitboards&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:372 --&gt;&lt;!-- ws:start:WikiTextTocRule:373: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Shifting Bitboards-One Step Only&quot;&gt;One Step Only&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:373 --&gt;&lt;!-- ws:start:WikiTextTocRule:374: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Shifting Bitboards-Rotate&quot;&gt;Rotate&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:374 --&gt;&lt;!-- ws:start:WikiTextTocRule:375: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Shifting Bitboards-Generalized Shift&quot;&gt;Generalized Shift&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:375 --&gt;&lt;!-- ws:start:WikiTextTocRule:376: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Shifting Bitboards-See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:376 --&gt;&lt;!-- ws:start:WikiTextTocRule:377: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Shifting Bitboards-Bit by Square&quot;&gt;Bit by Square&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:377 --&gt;&lt;!-- ws:start:WikiTextTocRule:378: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Shifting Bitboards-Update by Move&quot;&gt;Update by Move&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:378 --&gt;&lt;!-- ws:start:WikiTextTocRule:379: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Shifting Bitboards-Swapping Bits&quot;&gt;Swapping Bits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:379 --&gt;&lt;!-- ws:start:WikiTextTocRule:380: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations&quot;&gt;Arithmetic Operations&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:380 --&gt;&lt;!-- ws:start:WikiTextTocRule:381: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Derived from Bitwise&quot;&gt;Derived from Bitwise&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:381 --&gt;&lt;!-- ws:start:WikiTextTocRule:382: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Addition&quot;&gt;Addition&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:382 --&gt;&lt;!-- ws:start:WikiTextTocRule:383: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Subtraction&quot;&gt;Subtraction&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:383 --&gt;&lt;!-- ws:start:WikiTextTocRule:384: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-The Two&#039;s Complement&quot;&gt;The Two&#039;s Complement&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:384 --&gt;&lt;!-- ws:start:WikiTextTocRule:385: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Least Significant One&quot;&gt;Least Significant One&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:385 --&gt;&lt;!-- ws:start:WikiTextTocRule:386: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Least Significant One-Isolation&quot;&gt;Isolation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:386 --&gt;&lt;!-- ws:start:WikiTextTocRule:387: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Least Significant One-Reset&quot;&gt;Reset&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:387 --&gt;&lt;!-- ws:start:WikiTextTocRule:388: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Least Significant One-Separation&quot;&gt;Separation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:388 --&gt;&lt;!-- ws:start:WikiTextTocRule:389: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Least Significant One-Smearing&quot;&gt;Smearing&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:389 --&gt;&lt;!-- ws:start:WikiTextTocRule:390: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Least Significant Zero&quot;&gt;Least Significant Zero&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:390 --&gt;&lt;!-- ws:start:WikiTextTocRule:391: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Most Significant One&quot;&gt;Most Significant One&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:391 --&gt;&lt;!-- ws:start:WikiTextTocRule:392: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Multiplication&quot;&gt;Multiplication&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:392 --&gt;&lt;!-- ws:start:WikiTextTocRule:393: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Division&quot;&gt;Division&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:393 --&gt;&lt;!-- ws:start:WikiTextTocRule:394: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Modulo&quot;&gt;Modulo&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:394 --&gt;&lt;!-- ws:start:WikiTextTocRule:395: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Modulo-Casting out 255&quot;&gt;Casting out 255&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:395 --&gt;&lt;!-- ws:start:WikiTextTocRule:396: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Modulo-Reciprocal Multiplication&quot;&gt;Reciprocal Multiplication&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:396 --&gt;&lt;!-- ws:start:WikiTextTocRule:397: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Arithmetic Operations-Modulo-Power of Two&quot;&gt;Power of Two&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:397 --&gt;&lt;!-- ws:start:WikiTextTocRule:398: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Selected Publications&quot;&gt;Selected Publications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:398 --&gt;&lt;!-- ws:start:WikiTextTocRule:399: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Selected Publications-1847 ...&quot;&gt;1847 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:399 --&gt;&lt;!-- ws:start:WikiTextTocRule:400: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Selected Publications-1950 ...&quot;&gt;1950 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:400 --&gt;&lt;!-- ws:start:WikiTextTocRule:401: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Selected Publications-2000 ...&quot;&gt;2000 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:401 --&gt;&lt;!-- ws:start:WikiTextTocRule:402: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:402 --&gt;&lt;!-- ws:start:WikiTextTocRule:403: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:403 --&gt;&lt;!-- ws:start:WikiTextTocRule:404: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Sets&quot;&gt;Sets&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:404 --&gt;&lt;!-- ws:start:WikiTextTocRule:405: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Algebra&quot;&gt;Algebra&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:405 --&gt;&lt;!-- ws:start:WikiTextTocRule:406: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Logic&quot;&gt;Logic&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:406 --&gt;&lt;!-- ws:start:WikiTextTocRule:407: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Operations&quot;&gt;Operations&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:407 --&gt;&lt;!-- ws:start:WikiTextTocRule:408: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#External Links-Operations-Setwise&quot;&gt;Setwise&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:408 --&gt;&lt;!-- ws:start:WikiTextTocRule:409: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#External Links-Operations-Bitwise&quot;&gt;Bitwise&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:409 --&gt;&lt;!-- ws:start:WikiTextTocRule:410: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#External Links-Operations-Arithmetic&quot;&gt;Arithmetic&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:410 --&gt;&lt;!-- ws:start:WikiTextTocRule:411: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#External Links-Operations-Modular arithmetic&quot;&gt;Modular arithmetic&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:411 --&gt;&lt;!-- ws:start:WikiTextTocRule:412: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Misc&quot;&gt;Misc&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:412 --&gt;&lt;!-- ws:start:WikiTextTocRule:413: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:413 --&gt;&lt;!-- ws:start:WikiTextTocRule:414: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:414 --&gt;&lt;!-- ws:start:WikiTextTocRule:415: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:415 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:416:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Relational&amp;quot; title=&amp;quot;Anchor: Relational&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Relational&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:416 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:246:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Relational&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:246 --&gt;Relational&lt;/h1&gt;
 &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Relational_operator&quot; rel=&quot;nofollow&quot;&gt;Relational operators&lt;/a&gt; on bitboards are the test for &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Relational_operator#Equality&quot; rel=&quot;nofollow&quot;&gt;equality&lt;/a&gt; whether they are the same or not. Greater or less in the arithmetical sense is usually not relevant with bitboards &lt;!-- ws:start:WikiTextRefRule:183:&amp;amp;lt;ref&amp;amp;gt;Greater or less in the arithmetical sense is usually not relevant with bitboards, but see greater condition in &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Thor%27s%20Hammer#MoveGeneration&amp;quot;&amp;gt;Thor&#039;s Hammer&#039;s move generation&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:183 --&gt; - instead we often compare &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit&quot;&gt;bit&lt;/a&gt; for bit of two bitboards by certain &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Bitwisebooleanoperations&quot;&gt;bitwise boolean operations&lt;/a&gt; to retrieve bitwise greater, less or equal results.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:248:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Relational-Equality&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:248 --&gt;Equality&lt;/h2&gt;
 In &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt; &amp;quot;==&amp;quot; is used, to test for equality, &amp;quot;!=&amp;quot; for not equal. &lt;a class=&quot;wiki_link&quot; href=&quot;/Pascal&quot;&gt;Pascal&lt;/a&gt; uses &amp;quot;=&amp;quot;, &amp;quot;&amp;lt;&amp;gt;&amp;quot; and has &amp;quot;:=&amp;quot; to distinguish relational equal operators from assignment.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;if (a == b) -&amp;amp;gt; both sets are equal&amp;lt;br/&amp;gt;if (a != b) -&amp;amp;gt; both sets are not equal&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; both sets are equal
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; both sets are not equal&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; has a cmp-instruction, which internally performs a subtraction to set its internal processor flags (carry, zero, overflow) accordantly, for instance the zero-flag if both sets are equal. Those flags are then used by conditional jump or move instructions.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;cmp  rax, rbx ; rax == rbx&amp;lt;br/&amp;gt;je   equal    ; (jz) conditional jump if equal (jne, jnz for not equal)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;cmp  rax, rbx ; rax == rbx
je   equal    ; (jz) conditional jump if equal (jne, jnz for not equal)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:417:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@EmptyAndUniverse&amp;quot; title=&amp;quot;Anchor: EmptyAndUniverse&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;EmptyAndUniverse&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:417 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:250:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Relational-Empty and Universe&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:250 --&gt;Empty and Universe&lt;/h2&gt;
 Two important sets are:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Empty_set&quot; rel=&quot;nofollow&quot;&gt;empty set&lt;/a&gt; is represented by all bits zero.&lt;/li&gt;&lt;li&gt;The &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Universal_set&quot; rel=&quot;nofollow&quot;&gt;universal set&lt;/a&gt; contains all elements by setting all bits to binary one.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
The numerical values and setwise representations of those sets:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;empty set E       = 0&amp;lt;br/&amp;gt; set-wise         = {}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;universal set U   = 2^64 - 1&amp;lt;br/&amp;gt; signed decimal   = -1&amp;lt;br/&amp;gt; hexadecimal      = 0xffffffffffffffff&amp;lt;br/&amp;gt; unsigned decimal = 18,446,744,073,709,551,615&amp;lt;br/&amp;gt; set-wise         = {a1, b1, c1, d1, ....., e8, f8, g8, h8}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;empty set E       &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
 set&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;wise         &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
universal set U   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 &lt;span class=&quot;kw4&quot;&gt;signed&lt;/span&gt; decimal   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 hexadecimal      &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xffffffffffffffff&lt;/span&gt;
 &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; decimal &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;18&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;446&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;744&lt;/span&gt;,&lt;span class=&quot;nu8&quot;&gt;073&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;709&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;551&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;615&lt;/span&gt;
 set&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;wise         &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;a1, b1, c1, d1, ....., e8, f8, g8, h8&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;Venn diagram&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:1249:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Venn_diagram&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/384px-Venn0000.svg.png/399786754/384px-Venn0000.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;width: 240px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/384px-Venn0000.svg.png/399786754/384px-Venn0000.svg.png&quot; alt=&quot;384px-Venn0000.svg.png&quot; title=&quot;384px-Venn0000.svg.png&quot; style=&quot;width: 240px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1249 --&gt; &lt;!-- ws:start:WikiTextLocalImageRule:1251:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Venn_diagram&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/384px-Venn1111.svg.png/399786842/384px-Venn1111.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;width: 240px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/384px-Venn1111.svg.png/399786842/384px-Venn1111.svg.png&quot; alt=&quot;384px-Venn1111.svg.png&quot; title=&quot;384px-Venn1111.svg.png&quot; style=&quot;width: 240px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1251 --&gt;&lt;br /&gt;
&lt;br /&gt;
or bitboard diagrams&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;      Empty               Universe&amp;lt;br/&amp;gt; . . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;      Empty               Universe
 . . . . . . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;br /&gt;
Programmers often wonder to use -1 in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; as unsigned constant. See &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheTwosComplement&quot;&gt;The Two&#039;s Complement&lt;/a&gt; - alternately one may use ~0 to define the universal set. Since in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt;, decimal numbers without ULL suffix are treated as 32-bit integers, constants outside the integer range need some care concerning sign or zero extension. Const declarations or using the &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards#DefiningBitboards&quot;&gt;C64 Macro&lt;/a&gt; is recommended:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;const U64 universe = 0xffffffffffffffffULL;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 universe &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; 0xffffffffffffffffULL&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;br /&gt;
To test whether a set is empty or not, one may compare with zero or use the logical not operator &#039;!&#039; in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;if (a == 0) -&amp;amp;gt; empty set&amp;lt;br/&amp;gt;if (!a)     -&amp;amp;gt; empty set&amp;lt;br/&amp;gt;if (a != 0) -&amp;amp;gt; set is not empty&amp;lt;br/&amp;gt;if (a)      -&amp;amp;gt; set is not empty&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; empty set
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;     &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; empty set
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; set is not empty
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;      &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; set is not empty&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;To test for the universal set is less likely:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;if (a == universe) -&amp;amp;gt; universal set&amp;lt;br/&amp;gt;if (a + 1 == 0)    -&amp;amp;gt; universal set&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; universe&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; universal set
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;    &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; universal set&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:418:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Bitwisebooleanoperations&amp;quot; title=&amp;quot;Anchor: Bitwisebooleanoperations&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Bitwisebooleanoperations&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:418 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:252:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Bitwise Boolean&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:252 --&gt;Bitwise Boolean&lt;/h1&gt;
 &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_algebra&quot; rel=&quot;nofollow&quot;&gt;Boolean algebra&lt;/a&gt; is an algebraic structure &lt;!-- ws:start:WikiTextRefRule:190:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#Boole&amp;quot;&amp;gt;George Boole&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1847&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://archive.org/stream/mathematicalanal00booluoft/mathematicalanal00booluoft_djvu.txt&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The Mathematical Analysis of Logic, Being an Essay towards a Calculus of Deductive Reasoning&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;. Macmillan, Barclay &amp;amp;amp; Macmillan&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:190 --&gt; &lt;!-- ws:start:WikiTextRefRule:198:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#CSPeirce&amp;quot;&amp;gt;Charles S. Peirce&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1880&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://archive.org/details/jstor-2369442&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;On the Algebra of Logic&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/American_Journal_of_Mathematics&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;American Journal of Mathematics&amp;lt;/a&amp;gt;, Vol. 3&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:198 --&gt; that captures essential properties of both &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Set_theory#Basic_concepts&quot; rel=&quot;nofollow&quot;&gt;set operations&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_connective&quot; rel=&quot;nofollow&quot;&gt;logical operations&lt;/a&gt;. The properties of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Associativity&quot; rel=&quot;nofollow&quot;&gt;associativity&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Commutativity&quot; rel=&quot;nofollow&quot;&gt;commutativity&lt;/a&gt;, and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Absorption_laws&quot; rel=&quot;nofollow&quot;&gt;absorption&lt;/a&gt;, which define an &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Lattice_%28order%29&quot; rel=&quot;nofollow&quot;&gt;ordered lattice&lt;/a&gt;, in conjunction with  &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Distributivity&quot; rel=&quot;nofollow&quot;&gt;distributive&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Complement_%28set_theory%29&quot; rel=&quot;nofollow&quot;&gt;complement laws&lt;/a&gt; define the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Algebra_of_sets&quot; rel=&quot;nofollow&quot;&gt;Algebra of sets&lt;/a&gt; is in fact a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_algebra_%28structure%29&quot; rel=&quot;nofollow&quot;&gt;Boolean algebra&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
Specifically, Boolean algebra deals with the set operations of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intersection_%28set_theory%29&quot; rel=&quot;nofollow&quot;&gt;intersection&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Union_%28set_theory%29&quot; rel=&quot;nofollow&quot;&gt;union&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Complement_%28set_theory%29&quot; rel=&quot;nofollow&quot;&gt;complement&lt;/a&gt;, their equivalents of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_conjunction&quot; rel=&quot;nofollow&quot;&gt;conjunction&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_disjunction&quot; rel=&quot;nofollow&quot;&gt;disjunction&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Negation&quot; rel=&quot;nofollow&quot;&gt;negation&lt;/a&gt; and their bitwise boolean operations of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bitwise_operation#AND&quot; rel=&quot;nofollow&quot;&gt;AND&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bitwise_operation#OR&quot; rel=&quot;nofollow&quot;&gt;OR&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bitwise_operation#NOT&quot; rel=&quot;nofollow&quot;&gt;NOT&lt;/a&gt; to implement &lt;a class=&quot;wiki_link&quot; href=&quot;/Combinatorial%20Logic&quot;&gt;combinatorial logic&lt;/a&gt; in &lt;a class=&quot;wiki_link&quot; href=&quot;/Software&quot;&gt;software&lt;/a&gt;. Bitwise boolean operations on 64-bit words are in fact 64 parallel operations on each &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit&quot;&gt;bit&lt;/a&gt; performing one setwise operation without any &amp;quot;side-effects&amp;quot;. Square mapping don&#039;t cares as long all sets use the same.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:419:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Intersection&amp;quot; title=&amp;quot;Anchor: Intersection&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Intersection&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:419 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:254:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Bitwise Boolean-Intersection&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:254 --&gt;Intersection&lt;/h2&gt;
 &lt;!-- ws:start:WikiTextLocalImageRule:1253:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Venn_diagram&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Venn0001.svg.png/399786832/Venn0001.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;width: 240px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Venn0001.svg.png/399786832/Venn0001.svg.png&quot; alt=&quot;Venn0001.svg.png&quot; title=&quot;Venn0001.svg.png&quot; style=&quot;width: 240px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1253 --&gt;&lt;br /&gt;
&lt;br /&gt;
In &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Set_theory&quot; rel=&quot;nofollow&quot;&gt;set theory&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intersection_%28set_theory%29&quot; rel=&quot;nofollow&quot;&gt;intersection&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:129:
[[math]]&amp;lt;br/&amp;gt;
 A\cap B&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; A\cap B&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:129 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
In &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29&quot; rel=&quot;nofollow&quot;&gt;boolean algebra&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_conjunction&quot; rel=&quot;nofollow&quot;&gt;conjunction&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:130:
[[math]]&amp;lt;br/&amp;gt;
 a\wedge b&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; a\wedge b&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:130 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Bitboard intersection or conjunction is performed by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bitwise_operation#AND&quot; rel=&quot;nofollow&quot;&gt;bitwise and&lt;/a&gt; (binary operator &amp;amp; in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;, and the keyword &amp;quot;AND&amp;quot; in &lt;a class=&quot;wiki_link&quot; href=&quot;/Pascal&quot;&gt;Pascal&lt;/a&gt;).&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;intersection = a &amp;amp;amp; b&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;intersection &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;strong&gt;Truth Table&lt;/strong&gt;&lt;br /&gt;
Truth table of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AND_gate&quot; rel=&quot;nofollow&quot;&gt;and&lt;/a&gt; for one bit, for a &#039;1&#039; result both inputs need to be &#039;1&#039;:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;a&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;b&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;a and b&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

Conjunction acts like a bitwise minimum, min(a, b) or as bitwise multiplication (a * b).&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; has general purpose instruction as well as &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD-instructions&lt;/a&gt; for bitwise and:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;and   rax,  rbx        ; rax &amp;amp;amp;= rbx&amp;lt;br/&amp;gt;test  rax,  rbx        ; to determine whether the intersection is empty&amp;lt;br/&amp;gt;pand  mm0,  mm1        ; MMX   mm0 &amp;amp;amp;= mm1&amp;lt;br/&amp;gt;pand  xmm0, xmm1       ; SSE2 xmm0 &amp;amp;amp;= xmm1&amp;lt;br/&amp;gt;vpand xmm0, xmm1, xmm2 ; AVX  xmm0 = xmm1 &amp;amp;amp; xmm2&amp;lt;br/&amp;gt;vpand ymm0, ymm1, ymm2 ; AVX2 ymm0 = ymm1 &amp;amp;amp; ymm2&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;and   rax,  rbx        ; rax &amp;amp;= rbx
test  rax,  rbx        ; to determine whether the intersection is empty
pand  mm0,  mm1        ; MMX   mm0 &amp;amp;= mm1
pand  xmm0, xmm1       ; SSE2 xmm0 &amp;amp;= xmm1
vpand xmm0, xmm1, xmm2 ; AVX  xmm0 = xmm1 &amp;amp; xmm2
vpand ymm0, ymm1, ymm2 ; AVX2 ymm0 = ymm1 &amp;amp; ymm2&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;-intrinsic &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/6d1txsa8%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_and_si128&lt;/a&gt;.&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;-intrinsic &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/node/695037&quot; rel=&quot;nofollow&quot;&gt;_mm256_and_si256&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt; has &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512#VPTERNLOG&quot;&gt;VPTERNLOG&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Idempotent&lt;/strong&gt; &lt;br /&gt;
Conjunction is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Idempotence&quot; rel=&quot;nofollow&quot;&gt;idempotent&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a &amp;amp;amp; a == a&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;strong&gt;Commutative&lt;/strong&gt; &lt;br /&gt;
Conjunction is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Commutative&quot; rel=&quot;nofollow&quot;&gt;commutative&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a &amp;amp;amp; b == b &amp;amp;amp; a&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; a&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;&lt;strong&gt;Associative&lt;/strong&gt; &lt;br /&gt;
Conjunction is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Associative&quot; rel=&quot;nofollow&quot;&gt;associative&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;(a &amp;amp;amp; b) &amp;amp;amp; c == a &amp;amp;amp; (b &amp;amp;amp; c)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; c &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; c&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;&lt;strong&gt;Subset&lt;/strong&gt; &lt;br /&gt;
The intersection of two sets is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Subset&quot; rel=&quot;nofollow&quot;&gt;subset&lt;/a&gt; of both.&lt;br /&gt;
&lt;br /&gt;
Assume we have a attack set of a &lt;a class=&quot;wiki_link&quot; href=&quot;/Queen&quot;&gt;queen&lt;/a&gt;, and like to know whether the queen attacks opponent &lt;a class=&quot;wiki_link&quot; href=&quot;/Pieces&quot;&gt;pieces&lt;/a&gt; it may &lt;a class=&quot;wiki_link&quot; href=&quot;/Captures&quot;&gt;capture&lt;/a&gt;, we need to &#039;and&#039; the queen-attacks with the set of opponent pieces.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;queen attacks    &amp;amp;amp;  opponent pieces  =  attacked pieces&amp;lt;br/&amp;gt;. . . . . . . .     1 . . 1 1 . . 1     . . . . . . . .&amp;lt;br/&amp;gt;. . . 1 . . 1 .     1 . 1 1 1 1 1 .     . . . 1 . . 1 .&amp;lt;br/&amp;gt;. 1 . 1 . 1 . .     . 1 . . . . . 1     . 1 . . . . . .&amp;lt;br/&amp;gt;. . 1 1 1 . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;1 1 1 * 1 1 1 .  &amp;amp;amp;  . . . * . . 1 .  =  . . . * . . 1 .&amp;lt;br/&amp;gt;. . 1 1 1 . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . 1 . 1 . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . 1 . . . .     . . . . . . . .     . . . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;queen attacks    &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;  opponent pieces  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  attacked pieces
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .
. . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . . . . . . .     . . . . . . . .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;  . . . &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  . . . &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . . . . . . .     . . . . . . . .
. . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . . . . . . . .     . . . . . . . .
. . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . .     . . . . . . . .     . . . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;To prove whether set &#039;a&#039; is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Subset&quot; rel=&quot;nofollow&quot;&gt;subset&lt;/a&gt; of another set &#039;b&#039;, we compare whether the intersection equals the subset:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:13:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;bool isASubsetOfB(U64 a, U64 b) {return (a &amp;amp;amp; b) == a;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;bool&lt;/span&gt; isASubsetOfB&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 a, U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:13 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:420:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@DisjointSets&amp;quot; title=&amp;quot;Anchor: DisjointSets&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;DisjointSets&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:420 --&gt;&lt;br /&gt;
&lt;strong&gt;Disjoint Sets&lt;/strong&gt; &lt;br /&gt;
To test whether two sets are &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Disjoint&quot; rel=&quot;nofollow&quot;&gt;disjoint&lt;/a&gt; - that is their intersection is empty - compiler emit the &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; test-instruction instead of and. That saves the content of a register, if the intersection is not otherwise needed:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:14:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;if ( (a &amp;amp;amp; b) == 0 ) -&amp;amp;gt; a and b are disjoint sets&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; a and b are disjoint sets&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:14 --&gt;In chess the bitboards of white and black pieces are obviously always disjoint, same for sets of different piece-types, such as knights or pawns. Of course this is because one square is occupied by one piece only.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:421:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Union&amp;quot; title=&amp;quot;Anchor: Union&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Union&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:421 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:256:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Bitwise Boolean-Union&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:256 --&gt;Union&lt;/h2&gt;
 &lt;!-- ws:start:WikiTextLocalImageRule:1255:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Venn_diagram&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/384px-Venn0111.svg.png/399786822/384px-Venn0111.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;width: 240px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/384px-Venn0111.svg.png/399786822/384px-Venn0111.svg.png&quot; alt=&quot;384px-Venn0111.svg.png&quot; title=&quot;384px-Venn0111.svg.png&quot; style=&quot;width: 240px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1255 --&gt;&lt;br /&gt;
&lt;br /&gt;
In &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Set_theory&quot; rel=&quot;nofollow&quot;&gt;set theory&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Union_%28set_theory%29&quot; rel=&quot;nofollow&quot;&gt;union&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:131:
[[math]]&amp;lt;br/&amp;gt;
 A\cup B&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; A\cup B&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:131 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
In &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29&quot; rel=&quot;nofollow&quot;&gt;boolean algebra&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_disjunction&quot; rel=&quot;nofollow&quot;&gt;disjunction&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:132:
[[math]]&amp;lt;br/&amp;gt;
 a\vee b&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; a\vee b&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:132 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
The union or disjunction of two bitboards is applied by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bitwise_operation#OR&quot; rel=&quot;nofollow&quot;&gt;bitwise or&lt;/a&gt; (binary operator | in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;, or the keyword &amp;quot;OR&amp;quot; in &lt;a class=&quot;wiki_link&quot; href=&quot;/Pascal&quot;&gt;Pascal&lt;/a&gt;). The union is superset of the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt;, while the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Subset&quot; rel=&quot;nofollow&quot;&gt;subset&lt;/a&gt; of the union.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:15:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;union = a | b&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;union&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:15 --&gt;&lt;strong&gt;Truth Table&lt;/strong&gt; &lt;br /&gt;
Truth table of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/OR_gate&quot; rel=&quot;nofollow&quot;&gt;or&lt;/a&gt; for one bit, one set input bits is sufficient to set the output:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;a&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;b&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;a or b&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

Disjunction acts like bitwise maximum, max(a, b) or as addition with saturation, min(a + b, 1). It can also be interpreted as sum minus product, a + b - a*b, with possible temporary overflow of one binary digit to two - or with modulo 2 arithmetic.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; has general purpose instruction as well as &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD-instructions&lt;/a&gt; for bitwise or:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:16:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;or   rax,  rbx        ;       rax |= rbx&amp;lt;br/&amp;gt;por  mm0,  mm1        ; MMX   mm0 |= mm1&amp;lt;br/&amp;gt;por  xmm0, xmm1       ; SSE2 xmm0 |= xmm1&amp;lt;br/&amp;gt;vpor xmm0, xmm1, xmm2 ; AVX  xmm0  = xmm1 | xmm2&amp;lt;br/&amp;gt;vpor ymm0, ymm1, ymm2 ; AVX2 ymm0  = ymm1 | ymm2&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;or   rax,  rbx        ;       rax |= rbx
por  mm0,  mm1        ; MMX   mm0 |= mm1
por  xmm0, xmm1       ; SSE2 xmm0 |= xmm1
vpor xmm0, xmm1, xmm2 ; AVX  xmm0  = xmm1 | xmm2
vpor ymm0, ymm1, ymm2 ; AVX2 ymm0  = ymm1 | ymm2&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:16 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;-intrinsic &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/ew8ty0db%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_or_si128&lt;/a&gt;.&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;-intrinsic &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/node/523912&quot; rel=&quot;nofollow&quot;&gt;_mm256_or_si256&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt; has &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512#VPTERNLOG&quot;&gt;VPTERNLOG&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Idempotent&lt;/strong&gt; &lt;br /&gt;
Disjunction is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Idempotence&quot; rel=&quot;nofollow&quot;&gt;idempotent&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:17:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a | a == a&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:17 --&gt;&lt;strong&gt;Commutative&lt;/strong&gt; &lt;br /&gt;
Disjunction is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Commutative&quot; rel=&quot;nofollow&quot;&gt;commutative&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:18:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a | b == b | a&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; b &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; a&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:18 --&gt;&lt;strong&gt;Associative&lt;/strong&gt; &lt;br /&gt;
Disjunction is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Associative&quot; rel=&quot;nofollow&quot;&gt;associative&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:19:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;(a | b) | c == a | (b | c)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; c &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; c&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:19 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:422:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@DistributiveAndOr&amp;quot; title=&amp;quot;Anchor: DistributiveAndOr&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;DistributiveAndOr&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:422 --&gt;&lt;br /&gt;
&lt;strong&gt;Distributive&lt;/strong&gt; &lt;br /&gt;
Disjunction is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Distributivity&quot; rel=&quot;nofollow&quot;&gt;distributive&lt;/a&gt; over &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;conjunction&lt;/a&gt; and vice versa:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:20:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x | (y &amp;amp;amp; z) == (x | y) &amp;amp;amp; (x | z)&amp;lt;br/&amp;gt;x &amp;amp;amp; (y | z) == (x &amp;amp;amp; y) | (x &amp;amp;amp; z)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:20 --&gt;&lt;strong&gt;Superset&lt;/strong&gt; &lt;br /&gt;
The union of two sets is superset of both. For instance the union of all white and black pieces are the set of all occupied squares:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:21:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;white pieces     |  black pieces     =  occupied squares&amp;lt;br/&amp;gt;. . . . . . . .     1 . 1 1 1 1 1 1     1 . 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 . 1 1 1     1 1 1 1 . 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .     . . 1 . . . . .     . . 1 . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . 1 . . .     . . . . 1 . . .&amp;lt;br/&amp;gt;. . . . 1 . . .  |  . . . . . . . .  =  . . . . 1 . . .&amp;lt;br/&amp;gt;. . . . . 1 . .     . . . . . . . .     . . . . . 1 . .&amp;lt;br/&amp;gt;1 1 1 1 . 1 1 1     . . . . . . . .     1 1 1 1 . 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 . 1     . . . . . . . .     1 1 1 1 1 1 . 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;white pieces     &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;  black pieces     &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  occupied squares
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . . . . . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . .
. . . . . . . .     . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
. . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .  &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;  . . . . . . . .  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
. . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . . . . . . . .     . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:21 --&gt;Since white and black pieces are always disjoint, one may use addition here as well. That fails for union of attack sets, since squares may be attacked or defended by multiple pieces of course.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:423:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@ComplementSet&amp;quot; title=&amp;quot;Anchor: ComplementSet&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;ComplementSet&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:423 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:258:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Bitwise Boolean-Complement Set&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:258 --&gt;Complement Set&lt;/h2&gt;
 &lt;!-- ws:start:WikiTextLocalImageRule:1257:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Venn_diagram&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/384px-Venn1010.svg.png/399786812/384px-Venn1010.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;width: 240px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/384px-Venn1010.svg.png/399786812/384px-Venn1010.svg.png&quot; alt=&quot;384px-Venn1010.svg.png&quot; title=&quot;384px-Venn1010.svg.png&quot; style=&quot;width: 240px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1257 --&gt;&lt;br /&gt;
&lt;br /&gt;
In &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Set_theory&quot; rel=&quot;nofollow&quot;&gt;set theory&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Complement_%28set_theory%29&quot; rel=&quot;nofollow&quot;&gt;complement set&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:133:
[[math]]&amp;lt;br/&amp;gt;
 A^c&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; A^c&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:133 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
In &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29&quot; rel=&quot;nofollow&quot;&gt;boolean algebra&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Negation&quot; rel=&quot;nofollow&quot;&gt;negation&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:134:
[[math]]&amp;lt;br/&amp;gt;
 \neg a&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; \neg a&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:134 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
The complement set (absolute complement set), negation or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Ones%27_complement#Ones.27_complement&quot; rel=&quot;nofollow&quot;&gt;ones&#039; complement&lt;/a&gt; has it&#039;s equivalent in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bitwise_operation#NOT&quot; rel=&quot;nofollow&quot;&gt;bitwise not&lt;/a&gt; (unary operator &#039;~&#039; in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;, or the keyword &amp;quot;NOT&amp;quot; in &lt;a class=&quot;wiki_link&quot; href=&quot;/Pascal&quot;&gt;Pascal&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Truth Table&lt;/strong&gt; &lt;br /&gt;
Truth table of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NOT_gate&quot; rel=&quot;nofollow&quot;&gt;not&lt;/a&gt; for one bit:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;a&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;not a&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

The complement can be interpreted as bitwise subtraction (1 - a).&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
Available as general purpose instruction.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:22:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;not  rax ; rax = ~rax&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;not  rax ; rax = ~rax&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:22 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt; has &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512#VPTERNLOG&quot;&gt;VPTERNLOG&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Empty Squares&lt;/strong&gt; &lt;br /&gt;
The set of empty squares for instance is the complement-set of all occupied squares and vice versa:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:23:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;~occupied squares  =   empty squares&amp;lt;br/&amp;gt;  1 . 1 1 1 1 1 1      . 1 . . . . . .&amp;lt;br/&amp;gt;  1 1 1 1 . 1 1 1      . . . . 1 . . .&amp;lt;br/&amp;gt;  . . 1 . . . . .      1 1 . 1 1 1 1 1&amp;lt;br/&amp;gt;  . . . . 1 . . .      1 1 1 1 . 1 1 1&amp;lt;br/&amp;gt;~ . . . . 1 . . .  =   1 1 1 1 . 1 1 1&amp;lt;br/&amp;gt;  . . . . . 1 . .      1 1 1 1 1 . 1 1&amp;lt;br/&amp;gt;  1 1 1 1 . 1 1 1      . . . . 1 . . .&amp;lt;br/&amp;gt;  1 1 1 1 1 1 . 1      . . . . . . 1 .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;~occupied squares  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   empty squares
  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;      . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . .
  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;      . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
  . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
  . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
~ . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
  . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .      &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;      . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;      . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:23 --&gt;&lt;br /&gt;
&lt;em&gt;Don&#039;t confuse bitwise not with logical not-operator &#039;!&#039; in&lt;/em&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:24:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;!0 == 1&amp;lt;br/&amp;gt;!(anything != 0) == 0&amp;lt;br/&amp;gt;!1  == 0&amp;lt;br/&amp;gt;!-1 == 0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;anything &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:24 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:424:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Complementlaws&amp;quot; title=&amp;quot;Anchor: Complementlaws&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Complementlaws&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:424 --&gt;&lt;br /&gt;
&lt;strong&gt;Complement laws&lt;/strong&gt; &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; of a set with it&#039;s complement is the universal set -1.&lt;/li&gt;&lt;li&gt;The &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; of a set with it&#039;s complement is the empty set 0 - both are &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Disjoint&quot; rel=&quot;nofollow&quot;&gt;disjoint&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Empty set and universal set are complement sets.&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:25:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a  | ~a == -1&amp;lt;br/&amp;gt;a  &amp;amp;amp; ~a ==  0&amp;lt;br/&amp;gt;~0      == -1&amp;lt;br/&amp;gt;~(-1)   ==  0&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a  &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; ~a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
a  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
~&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;      &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;   &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:25 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:425:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@DeMorganslaws&amp;quot; title=&amp;quot;Anchor: DeMorganslaws&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;DeMorganslaws&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:425 --&gt;&lt;br /&gt;
&lt;strong&gt;De Morgan&#039;s laws&lt;/strong&gt; &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Complement of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; (&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NOR_gate&quot; rel=&quot;nofollow&quot;&gt;NOR&lt;/a&gt; ) is the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; of the complements &lt;!-- ws:start:WikiTextRefRule:205:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#ADeMorgan&amp;quot;&amp;gt;Augustus De Morgan&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1860&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://books.google.com/books?id=Od3jgF5rZtgC&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Syllabus of a Proposed System of Logic&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;. Walton &amp;amp;amp; Malbery&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-8&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:205 --&gt;.&lt;/li&gt;&lt;li&gt;Complement of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; (&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NAND_logic&quot; rel=&quot;nofollow&quot;&gt;NAND&lt;/a&gt; or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Sheffer_stroke&quot; rel=&quot;nofollow&quot;&gt;Sheffer stroke&lt;/a&gt; ) is the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; of the complements.&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextCodeRule:26:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;~(a | b) == ~a &amp;amp;amp; ~b&amp;lt;br/&amp;gt;~(a &amp;amp;amp; b) == ~a | ~b&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; ~a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~b
~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; ~a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; ~b&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:26 --&gt;For instance to get the set of empty squares, we can complement the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; of white and black pieces. Or we can intersect the complements of white and black pieces.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:426:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@RelativeComplement&amp;quot; title=&amp;quot;Anchor: RelativeComplement&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;RelativeComplement&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:426 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:260:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Bitwise Boolean-Relative Complement&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:260 --&gt;Relative Complement&lt;/h2&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:1259:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Venn_diagram&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/384px-Venn0010.svg.png/399786806/384px-Venn0010.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;width: 240px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/384px-Venn0010.svg.png/399786806/384px-Venn0010.svg.png&quot; alt=&quot;384px-Venn0010.svg.png&quot; title=&quot;384px-Venn0010.svg.png&quot; style=&quot;width: 240px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1259 --&gt;&lt;br /&gt;
&lt;br /&gt;
In &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Set_theory&quot; rel=&quot;nofollow&quot;&gt;set theory&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Complement_%28set_theory%29#Relative_complement&quot; rel=&quot;nofollow&quot;&gt;relative complement&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:135:
[[math]]&amp;lt;br/&amp;gt;
A^c \cap B~=~B \setminus A&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;A^c \cap B~=~B \setminus A&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:135 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
The relative complement is the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;absolute complement&lt;/a&gt; restricted to some other set. The relative complement of &#039;a&#039; inside &#039;b&#039; is also known as the &lt;strong&gt;set theoretic difference&lt;/strong&gt; of &#039;b&#039; minus &#039;a&#039;. It is the set of all elements that belong to &#039;b&#039; but &lt;strong&gt;not&lt;/strong&gt; to &#039;a&#039;. Also called &#039;b&#039; without &#039;a&#039;. It is the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; of &#039;b&#039; with the absolute complement of &#039;a&#039;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:27:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;not_a_in_b  = ~a &amp;amp;amp;  b&amp;lt;br/&amp;gt;b_without_a =  b &amp;amp;amp; ~a&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;not_a_in_b  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;  b
b_without_a &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~a&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:27 --&gt;&lt;strong&gt;Truth Table&lt;/strong&gt; &lt;br /&gt;
Truth table of relative complement for one bit:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;a&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;b&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;b andnot a&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

The relative complement of &#039;a&#039; in &#039;b&#039; may be interpreted as a bitwise (a &amp;lt; b) relation.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; don&#039;t has an own general purpose instruction for relative complement, but &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; expansion &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt;, and &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD-instructions&lt;/a&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:28:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;andn   rax,  rbx,  rcx  ; BMI1  rax = ~rbx &amp;amp;amp; rcx&amp;lt;br/&amp;gt;pandn  mm0,  mm1        ; MMX   mm0 = ~mm0 &amp;amp;amp; mm1&amp;lt;br/&amp;gt;pandn  xmm0, xmm1       ; SSE2 xmm0 = ~xmm0 &amp;amp;amp; xmm1&amp;lt;br/&amp;gt;vpandn xmm0, xmm1, xmm2 ; AVX  xmm0 = ~xmm1 &amp;amp;amp; xmm2&amp;lt;br/&amp;gt;vpandn ymm0, ymm1, ymm2 ; AVX  xmm0 = ~xmm1 &amp;amp;amp; xmm2&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;andn   rax,  rbx,  rcx  ; BMI1  rax = ~rbx &amp;amp; rcx
pandn  mm0,  mm1        ; MMX   mm0 = ~mm0 &amp;amp; mm1
pandn  xmm0, xmm1       ; SSE2 xmm0 = ~xmm0 &amp;amp; xmm1
vpandn xmm0, xmm1, xmm2 ; AVX  xmm0 = ~xmm1 &amp;amp; xmm2
vpandn ymm0, ymm1, ymm2 ; AVX  xmm0 = ~xmm1 &amp;amp; xmm2&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:28 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;-intrinsic &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/1beaceh8%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_andnot_si128&lt;/a&gt;.&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;-intrinsic &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/node/523911&quot; rel=&quot;nofollow&quot;&gt;_mm256_andnot_si256&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt; has &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512#VPTERNLOG&quot;&gt;VPTERNLOG&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Super minus Sub&lt;/strong&gt; &lt;br /&gt;
In presumption of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#XorWithout&quot;&gt;subtraction or exclusive or&lt;/a&gt; there are alternatives to calculate the relative complement - superset minus subset. We can take either the union without the complementing set - or the other set without the intersection&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:29:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;~a &amp;amp;amp; b == ( a | b ) - a&amp;lt;br/&amp;gt;~a &amp;amp;amp; b == b - ( a &amp;amp;amp; b )&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;~a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; a
~a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; b &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:29 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:262:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Bitwise Boolean-Implication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:262 --&gt;Implication&lt;/h2&gt;
 &lt;!-- ws:start:WikiTextLocalImageRule:1261:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Venn_diagram&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/384px-Venn1011.svg.png/399786800/384px-Venn1011.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;width: 240px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/384px-Venn1011.svg.png/399786800/384px-Venn1011.svg.png&quot; alt=&quot;384px-Venn1011.svg.png&quot; title=&quot;384px-Venn1011.svg.png&quot; style=&quot;width: 240px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1261 --&gt;&lt;br /&gt;
&lt;br /&gt;
Logical Implication or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Entailment&quot; rel=&quot;nofollow&quot;&gt;Entailment&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:136:
[[math]]&amp;lt;br/&amp;gt;
A~\Rightarrow~B&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;A~\Rightarrow~B&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:136 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
The boolean &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Material_conditional&quot; rel=&quot;nofollow&quot;&gt;Material conditional&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:137:
[[math]]&amp;lt;br/&amp;gt;
~a \rightarrow b&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;~a \rightarrow b&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:137 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Logical Implication or the boolean Material conditional &#039;a&#039; implies &#039;b&#039; (if &#039;a&#039; then &#039;b&#039;) is an derived boolean operation, implemented as &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; of the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;absolute complement&lt;/a&gt; of &#039;a&#039; with &#039;b&#039;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:30:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a_implies_b ==  ~a | b&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a_implies_b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt;  ~a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:30 --&gt;&lt;strong&gt;Truth Table&lt;/strong&gt; &lt;br /&gt;
Truth table of logical implication for one bit:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;a&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;b&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;a implies b&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

Implication may be interpreted as a bitwise (a &amp;lt;= b) relation.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt; has &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512#VPTERNLOG&quot;&gt;VPTERNLOG&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:427:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@ExclusiveOr&amp;quot; title=&amp;quot;Anchor: ExclusiveOr&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;ExclusiveOr&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:427 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:264:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Bitwise Boolean-Exclusive Or&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:264 --&gt;Exclusive Or&lt;/h2&gt;
 &lt;!-- ws:start:WikiTextLocalImageRule:1263:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Venn_diagram&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Venn0110.svg.png/399786786/Venn0110.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;width: 240px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Venn0110.svg.png/399786786/Venn0110.svg.png&quot; alt=&quot;Venn0110.svg.png&quot; title=&quot;Venn0110.svg.png&quot; style=&quot;width: 240px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1263 --&gt;&lt;br /&gt;
&lt;br /&gt;
In &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Set_theory&quot; rel=&quot;nofollow&quot;&gt;set theory&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Symmetric_difference&quot; rel=&quot;nofollow&quot;&gt;symmetric difference&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:138:
[[math]]&amp;lt;br/&amp;gt;
A~\Delta~B&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;A~\Delta~B&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:138 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
In &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29&quot; rel=&quot;nofollow&quot;&gt;boolean algebra&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Exclusive_or&quot; rel=&quot;nofollow&quot;&gt;Exclusive or&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:139:
[[math]]&amp;lt;br/&amp;gt;
~a \oplus b&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;~a \oplus b&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:139 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Exclusive or, also exclusive disjunction (xor, binary operator &#039;^&#039; in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;, or the keyword &amp;quot;XOR&amp;quot; in &lt;a class=&quot;wiki_link&quot; href=&quot;/Pascal&quot;&gt;Pascal&lt;/a&gt;), also called symmetric difference, leaves all elements which are exclusively set in one of the two sets. Xor is really a multi purpose operation with a lot of applications not only bitboards of course.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:31:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;1 . . . . . . 1     . . . . . . . .     1 . . . . . . 1&amp;lt;br/&amp;gt;. 1 . . . . 1 .     . . . . . . . .     . 1 . . . . 1 .&amp;lt;br/&amp;gt;. . 1 . . 1 . .     . . 1 1 1 1 . .     . . . 1 1 . . .&amp;lt;br/&amp;gt;. . . 1 1 . . .     . . 1 1 1 1 . .     . . 1 . . 1 . .&amp;lt;br/&amp;gt;. . . 1 1 . . .  ^  . . 1 1 1 1 . .  =  . . 1 . . 1 . .&amp;lt;br/&amp;gt;. . 1 . . 1 . .     . . 1 1 1 1 . .     . . . 1 1 . . .&amp;lt;br/&amp;gt;. 1 . . . . 1 .     . . . . . . . .     . 1 . . . . 1 .&amp;lt;br/&amp;gt;1 . . . . . . 1     . . . . . . . .     1 . . . . . . 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     . . . . . . . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
. . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     . . . . . . . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:31 --&gt;&lt;strong&gt;Truth Table&lt;/strong&gt; &lt;br /&gt;
Truth table of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/XOR_gate&quot; rel=&quot;nofollow&quot;&gt;exclusive or&lt;/a&gt; for one bit:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;a&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;b&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;a xor b&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

Xor implements a bitwise (a != b) relation.&lt;br /&gt;
It acts like a bitwise addition (modulo 2), since (1 + 1) mod 2 = 0.&lt;br /&gt;
It also acts like a bitwise subtraction (modulo 2).&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; has general purpose instruction as well as &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD-instructions&lt;/a&gt; for bitwise exclusive or:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:32:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;xor   rax,  rbx        ;       rax ^= rbx&amp;lt;br/&amp;gt;pxor  mm0,  mm1        ; MMX   mm0 ^= mm1&amp;lt;br/&amp;gt;pxor  xmm0, xmm1       ; SSE2 xmm0 ^= xmm1&amp;lt;br/&amp;gt;vpxor xmm0, xmm1, xmm2 ; AVX  xmm0  = xmm1 ^ xmm2&amp;lt;br/&amp;gt;vpxor ymm0, ymm1, ymm2 ; AVX2 ymm0  = ymm1 ^ ymm2&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;xor   rax,  rbx        ;       rax ^= rbx
pxor  mm0,  mm1        ; MMX   mm0 ^= mm1
pxor  xmm0, xmm1       ; SSE2 xmm0 ^= xmm1
vpxor xmm0, xmm1, xmm2 ; AVX  xmm0  = xmm1 ^ xmm2
vpxor ymm0, ymm1, ymm2 ; AVX2 ymm0  = ymm1 ^ ymm2&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:32 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;-intrinsic &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/fzt08www%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_xor_si128&lt;/a&gt;.&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;-intrinsic &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/node/683570&quot; rel=&quot;nofollow&quot;&gt;_mm256_xor_si256&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt; has &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512#VPTERNLOG&quot;&gt;VPTERNLOG&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Commutative&lt;/strong&gt; &lt;br /&gt;
Exclusive disjunction is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Commutative&quot; rel=&quot;nofollow&quot;&gt;commutative&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:33:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a ^ b == b ^ a&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; b &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; a&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:33 --&gt;&lt;strong&gt;Associative&lt;/strong&gt; &lt;br /&gt;
Xor is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Associative&quot; rel=&quot;nofollow&quot;&gt;associative&lt;/a&gt; as well.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:34:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;(a ^ b) ^ c == a ^ (b ^ c)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; c &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; c&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:34 --&gt;&lt;strong&gt;Distributive&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;Conjunction&lt;/a&gt; is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Distributivity&quot; rel=&quot;nofollow&quot;&gt;distributive&lt;/a&gt; over exclusive disjunction - but &lt;strong&gt;not&lt;/strong&gt; vice versa, since conjunction acts like multiplication, while xor acts as addition in the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Finite_field&quot; rel=&quot;nofollow&quot;&gt;Galois field&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/GF%282%29&quot; rel=&quot;nofollow&quot;&gt;GF(2)&lt;/a&gt; :&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:35:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x &amp;amp;amp; (y ^ z) == (x &amp;amp;amp; y) ^ (x &amp;amp;amp; z)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:35 --&gt;&lt;strong&gt;Own Inverse&lt;/strong&gt; &lt;br /&gt;
If applied two (even) times with the same operand, xor restores the original result. It is own inverse or an &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Involution&quot; rel=&quot;nofollow&quot;&gt;involution&lt;/a&gt; .&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Subset&lt;/strong&gt; &lt;br /&gt;
If one operand is subset of the other, xor (or subtraction) implements the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#RelativeComplement&quot;&gt;relative complement&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:36:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;super               sub                 super &amp;amp;amp;~ sub&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. 1 1 1 1 1 1 .     . . . . . . . .     . 1 1 1 1 1 1 .&amp;lt;br/&amp;gt;. 1 1 1 1 1 1 .     . . 1 1 1 1 . .     . 1 . . . . 1 .&amp;lt;br/&amp;gt;. 1 1 1 1 1 1 .  ^  . . 1 1 1 1 . .     . 1 . . . . 1 .&amp;lt;br/&amp;gt;. 1 1 1 1 1 1 .     . . 1 1 1 1 . .  =  . 1 . . . . 1 .&amp;lt;br/&amp;gt;. 1 1 1 1 1 1 .  -  . . 1 1 1 1 . .     . 1 . . . . 1 .&amp;lt;br/&amp;gt;. 1 1 1 1 1 1 .     . . . . . . . .     . 1 1 1 1 1 1 .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;super               sub                 super &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;~ sub
. . . . . . . .     . . . . . . . .     . . . . . . . .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     . . . . . . . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .  &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;  . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     . . . . . . . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
. . . . . . . .     . . . . . . . .     . . . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:36 --&gt;&lt;strong&gt;Subtraction&lt;/strong&gt; &lt;br /&gt;
While commutative, xor is a better replacement for subtracting from power of two minus one values, such as 63.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:37:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;(2**n - 1) - a == a ^ (2**n - 1) with a subset of 2**n - 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;**&lt;/span&gt;n &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;**&lt;/span&gt;n &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; with a subset of &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;**&lt;/span&gt;n &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:37 --&gt;This is because it usually safes one &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; load instruction and an additional register, but uses opcodes with immediate operands - for instance:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:38:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt; 1 - a == a ^  1&amp;lt;br/&amp;gt; 3 - a == a ^  3&amp;lt;br/&amp;gt; 7 - a == a ^  7&amp;lt;br/&amp;gt;15 - a == a ^ 15&amp;lt;br/&amp;gt;31 - a == a ^ 31&amp;lt;br/&amp;gt;63 - a == a ^ 63&amp;lt;br/&amp;gt;...&amp;lt;br/&amp;gt;-1 - a == a ^ -1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;
 &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;
...
&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:38 --&gt;&lt;strong&gt;Or without And&lt;/strong&gt; &lt;br /&gt;
Xor is the same as a &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; without the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; - all the bits different, 0,1 or 1,0. Since the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; is subset of the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt;, xor or subtraction can replace the &amp;quot;without&amp;quot; operation &amp;amp; ~:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:39:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a ^ b == (a | b) &amp;amp;amp;~(a &amp;amp;amp; b)&amp;lt;br/&amp;gt;a ^ b == (a | b) ^ (a &amp;amp;amp; b)&amp;lt;br/&amp;gt;a ^ b == (a | b) - (a &amp;amp;amp; b)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:39 --&gt;&lt;strong&gt;Disjoint Sets&lt;/strong&gt; &lt;br /&gt;
The symmetric difference of disjoint sets is equal to the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; or arithmetical addition. Since &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; and symmetric difference are disjoint, the union might defined that way:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:40:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a | b = ( a &amp;amp;amp; b ) ^ ( a ^ b )&amp;lt;br/&amp;gt;a | b = ( a &amp;amp;amp; b ) ^   a ^ b&amp;lt;br/&amp;gt;a | b = ( a &amp;amp;amp; b ) | ( a ^ b )&amp;lt;br/&amp;gt;a | b = ( a &amp;amp;amp; b ) + ( a ^ b )&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;   a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b
a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:40 --&gt;Assume we have distinct attack sets of pawns in left or right &lt;a class=&quot;wiki_link&quot; href=&quot;/Direction&quot;&gt;direction&lt;/a&gt;. The set of all squares attacked by two pawns is the intersection, the set exclusively attacked by one pawn (either right or left) is the xor-sum, while all squares attacked by any pawn is the union, see &lt;a class=&quot;wiki_link&quot; href=&quot;/Pawn%20Attacks%20%28Bitboards%29#PawnAttacks&quot;&gt;pawn attacks&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Union of Complements&lt;/strong&gt; &lt;br /&gt;
The symmetric difference is equivalent to the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; of both &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#RelativeComplement&quot;&gt;relative complements&lt;/a&gt;. Since both &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#RelativeComplement&quot;&gt;relative complements&lt;/a&gt; are &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Disjoint&quot; rel=&quot;nofollow&quot;&gt;disjoint&lt;/a&gt;, bitwise or or add can replaced by xor itself:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:41:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a ^ b == (a &amp;amp;amp; ~b) | (b &amp;amp;amp; ~a)&amp;lt;br/&amp;gt;a ^ b == (a &amp;amp;amp; ~b) ^ (b &amp;amp;amp; ~a)&amp;lt;br/&amp;gt;a ^ b == (a &amp;amp;amp; ~b) + (b &amp;amp;amp; ~a)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:41 --&gt;&lt;strong&gt;Toggle&lt;/strong&gt; &lt;br /&gt;
Xor can be used to toggle or flip bits by a mask.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:42:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x ^= mask;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:42 --&gt;&lt;strong&gt;Complement&lt;/strong&gt; &lt;br /&gt;
xor with the universal set -1 flips each bit and results in the ones&#039; complement.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:43:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a ^ -1 == ~a&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; ~a&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:43 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:428:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@XorWithout&amp;quot; title=&amp;quot;Anchor: XorWithout&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;XorWithout&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:428 --&gt;&lt;br /&gt;
&lt;strong&gt;Without&lt;/strong&gt; &lt;br /&gt;
Due to distributive law and since symmetric difference of set and subset is the relative complement of subset in set, there are some equivalent ways to calculate the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#RelativeComplement&quot;&gt;relative complement&lt;/a&gt; by xor. Based on surrounding expressions or whether subexpressions such as union, intersection or symmetric difference may be reused one may prefer the one or other alternative.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:44:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a &amp;amp;amp; ~b == a &amp;amp;amp; (-1 ^ b )&amp;lt;br/&amp;gt;a &amp;amp;amp; ~b == a &amp;amp;amp; ( a ^ b )&amp;lt;br/&amp;gt;a &amp;amp;amp; ~b == a ^ ( a &amp;amp;amp; b ) == a - ( a &amp;amp;amp; b )&amp;lt;br/&amp;gt;a &amp;amp;amp; ~b == b ^ ( a | b ) == ( a | b ) - b&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; b &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; b&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:44 --&gt;Also note that&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:45:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a &amp;amp;amp; a == a &amp;amp;amp; -1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:45 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:429:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@XorClear&amp;quot; title=&amp;quot;Anchor: XorClear&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;XorClear&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:429 --&gt;&lt;br /&gt;
&lt;strong&gt;Clear&lt;/strong&gt; &lt;br /&gt;
Since &#039;a&#039; xor &#039;a&#039; is zero, it is the shorter opcode to clear a register, since it takes no immediate operand. Applied by optimizing compilers. Same is true for subtraction by the way.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:46:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;xor  rax, rax   ; same as mov rax, 0&amp;lt;br/&amp;gt;pxor mm0, mm0   ; MMX 64-bit register&amp;lt;br/&amp;gt;pxor xmm0, xmm0 ; SSE2 - 128-bit xmm-register&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;xor  rax, rax   ; same as mov rax, 0
pxor mm0, mm0   ; MMX 64-bit register
pxor xmm0, xmm0 ; SSE2 - 128-bit xmm-register&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:46 --&gt;&lt;strong&gt;Xor Swap&lt;/strong&gt; &lt;br /&gt;
Three xors on the same registers swap their content: (Note: this only works when a and b are stored on distinct memory adresses!)&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:47:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a ^= b&amp;lt;br/&amp;gt;b ^= a&amp;lt;br/&amp;gt;a ^= b&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; b
b &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; a
a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; b&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:47 --&gt;If we provide an &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; by a mask, ...&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:48:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a = (a ^ b) &amp;amp;amp; mask&amp;lt;br/&amp;gt;b ^= a&amp;lt;br/&amp;gt;a ^= b&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; mask
b &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; a
a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; b&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:48 --&gt;... &#039;a&#039; becomes &#039;b&#039;, but only a part of &#039;b&#039;, where mask is one, becomes &#039;a&#039;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:430:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BitsFrom2SourcesByMask&amp;quot; title=&amp;quot;Anchor: BitsFrom2SourcesByMask&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BitsFrom2SourcesByMask&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:430 --&gt;&lt;br /&gt;
&lt;strong&gt;Bits from two Sources&lt;/strong&gt; &lt;br /&gt;
Getting arbitrary, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Disjoint&quot; rel=&quot;nofollow&quot;&gt;disjoint&lt;/a&gt; bits from two sources by a mask:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:49:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;// if mask-bit is zero, bit from a, otherwise from b - since a^(a^b) == b&amp;lt;br/&amp;gt;U64 mask = C64(0xFFFF0000FFFF0000);&amp;lt;br/&amp;gt;U64 result = a ^ ((a ^ b) &amp;amp;amp; mask);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// if mask-bit is zero, bit from a, otherwise from b - since a^(a^b) == b&lt;/span&gt;
U64 mask &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0xFFFF0000FFFF0000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
U64 result &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; mask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:49 --&gt;This takes one instruction less, than the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#RelativeComplement&quot;&gt;relative complement&lt;/a&gt; of the mask in &#039;a&#039; with &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; of mask with &#039;b&#039;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:50:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;    a ^    ((a ^ b) &amp;amp;amp; mask)&amp;lt;br/&amp;gt;== (a &amp;amp;amp; ~mask) | (b &amp;amp;amp; mask)&amp;lt;br/&amp;gt;== (a &amp;amp;amp; ~mask) ^ (b &amp;amp;amp; mask) because both sets of the union are disjoint&amp;lt;br/&amp;gt;== (a &amp;amp;amp; ~mask) + (b &amp;amp;amp; mask) because both sets of the union are disjoint&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;    a ^    ((a ^ b) &amp;amp; mask)
== (a &amp;amp; ~mask) | (b &amp;amp; mask)
== (a &amp;amp; ~mask) ^ (b &amp;amp; mask) because both sets of the union are disjoint
== (a &amp;amp; ~mask) + (b &amp;amp; mask) because both sets of the union are disjoint&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:50 --&gt;&lt;strong&gt;XOR-applications and affairs&lt;/strong&gt; &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Calculation of hash-keys based on &lt;a class=&quot;wiki_link&quot; href=&quot;/Zobrist%20Hashing&quot;&gt;Zobrist-keys&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Cyclic_redundancy_check&quot; rel=&quot;nofollow&quot;&gt;Cyclic redundancy check&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Parallel%20Prefix%20Algorithms#ParityWords&quot;&gt;Parity words&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Parallel%20Prefix%20Algorithms#GrayCode&quot;&gt;Gray Code&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Fredkin_gate&quot; rel=&quot;nofollow&quot;&gt;Fredkin gate&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Edward%20Fredkin&quot;&gt;Edward Fredkin&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Hyperbola%20Quintessence&quot;&gt;Hyperbola Quintessence&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Subtracting%20a%20rook%20from%20a%20blocking%20piece&quot;&gt;o^(o-2r)&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Hyatt&quot;&gt;Robert Hyatt&#039;s&lt;/a&gt; approach of a &lt;a class=&quot;wiki_link&quot; href=&quot;/Shared%20Hash%20Table#Lockless&quot;&gt;lockless transposition table&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#SwappingBits&quot;&gt;Swapping Bits&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Perceptrons_%28book%29#The_XOR_affair&quot; rel=&quot;nofollow&quot;&gt;The XOR affair&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Perceptrons_%28book%29&quot; rel=&quot;nofollow&quot;&gt;Perceptrons&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Marvin%20Minsky&quot;&gt;Marvin Minsky&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#SPapert&quot;&gt;Seymour Papert&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:214:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Marvin%20Minsky&amp;quot;&amp;gt;Marvin Minsky&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#SPapert&amp;quot;&amp;gt;Seymour Papert&amp;lt;/a&amp;gt; (1969, &amp;lt;strong&amp;gt;1972&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Perceptrons_%28book%29&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Perceptrons: An Introduction to Computational Geometry&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/MIT_Press&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The MIT Press&amp;lt;/a&amp;gt;, ISBN 0-262-63022-2&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-9&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-9&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:214 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:266:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc10&quot;&gt;&lt;a name=&quot;Bitwise Boolean-Equivalence&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:266 --&gt;Equivalence&lt;/h2&gt;
 &lt;!-- ws:start:WikiTextLocalImageRule:1265:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Venn_diagram&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/384px-Venn1001.svg.png/399786774/384px-Venn1001.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;width: 240px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/384px-Venn1001.svg.png/399786774/384px-Venn1001.svg.png&quot; alt=&quot;384px-Venn1001.svg.png&quot; title=&quot;384px-Venn1001.svg.png&quot; style=&quot;width: 240px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1265 --&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/If_and_only_if&quot; rel=&quot;nofollow&quot;&gt;If and only if&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:140:
[[math]]&amp;lt;br/&amp;gt;
A~\Leftrightarrow~B&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;A~\Leftrightarrow~B&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:140 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_equivalence&quot; rel=&quot;nofollow&quot;&gt;Logical equivalence&lt;/a&gt; is denoted as:&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:141:
[[math]]&amp;lt;br/&amp;gt;
a \leftrightarrow b&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;a \leftrightarrow b&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:141 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_equality&quot; rel=&quot;nofollow&quot;&gt;Logical equality&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_equivalence&quot; rel=&quot;nofollow&quot;&gt;logical equivalence&lt;/a&gt; or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_biconditional&quot; rel=&quot;nofollow&quot;&gt;biconditional&lt;/a&gt; (&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/If_and_only_if&quot; rel=&quot;nofollow&quot;&gt;if and only if&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/XNOR_gate&quot; rel=&quot;nofollow&quot;&gt;XNOR&lt;/a&gt; ) is the complement of xor.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:51:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;a_equal_b == ~(a ^ b)&amp;lt;br/&amp;gt;a_equal_b ==  (a &amp;amp;amp; b) | (~a &amp;amp;amp; ~b)&amp;lt;br/&amp;gt;a_equal_b ==  (a &amp;amp;amp; b) | ~(a | b)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;a_equal_b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; ~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
a_equal_b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;~a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; ~b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
a_equal_b &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; ~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:51 --&gt;&lt;strong&gt;Truth Table&lt;/strong&gt; &lt;br /&gt;
Truth table of equivalence or for one bit:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;a&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;b&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;a &amp;lt;=&amp;gt; b&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

Equivalence implements a bitwise (a == b) relation.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt; has &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512#VPTERNLOG&quot;&gt;VPTERNLOG&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:431:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Majority&amp;quot; title=&amp;quot;Anchor: Majority&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Majority&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:431 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:268:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc11&quot;&gt;&lt;a name=&quot;Bitwise Boolean-Majority&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:268 --&gt;Majority&lt;/h2&gt;
 The &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Majority_function&quot; rel=&quot;nofollow&quot;&gt;majority function&lt;/a&gt; or &lt;strong&gt;median operator&lt;/strong&gt; is a function from n inputs to one output. The value of the operation is false when n/2 or fewer arguments are false, and true otherwise. For two inputs it is the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt;. Three inputs require some more computation:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Truth Table&lt;/strong&gt; &lt;br /&gt;
Truth table of majority for three inputs:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;a&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;b&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;c&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;maj(a,b,c)&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;1&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextCodeRule:52:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;major = (a &amp;amp;amp; b) |  (a &amp;amp;amp; c) | (b &amp;amp;amp; c);&amp;lt;br/&amp;gt;major = (a &amp;amp;amp; b) | ((a ^ b ) &amp;amp;amp; c);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;major &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; c&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; c&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
major &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; c&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:52 --&gt;See the application of &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#CardinalityofMultipleSets&quot;&gt;cardinality of multiple sets&lt;/a&gt; for more than three inputs.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512#VPTERNLOG&quot;&gt;VPTERNLOG&lt;/a&gt; imm8 = 0xe8 implements the majority function.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:432:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@GreaterOne&amp;quot; title=&amp;quot;Anchor: GreaterOne&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;GreaterOne&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:432 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:270:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc12&quot;&gt;&lt;a name=&quot;Bitwise Boolean-Greater One Sets&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:270 --&gt;Greater One Sets&lt;/h2&gt;
 &lt;strong&gt;Greater One&lt;/strong&gt; is a function from n inputs to one output. The value of the operation is true if more than one argument is true, false otherwise. Obviously, for two inputs it is the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt;, for three inputs it is the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Majority&quot;&gt;majority function&lt;/a&gt;. For more inputs it is the union of all distinct pairwise intersections, which can be expressed with setwise operators that way:&lt;br /&gt;
&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:142:
[[math]]&amp;lt;br/&amp;gt;
 \bigcup_{\stackrel{i,j\in I}{i &amp;gt; j}}(A_i\cap A_j)&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; \bigcup_{\stackrel{i,j\in I}{i &gt; j}}(A_i\cap A_j)&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:142 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
With four bitboards this is equivalent to:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:53:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;  (a1 &amp;amp;amp; a0)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;| (a2 &amp;amp;amp; a1)&amp;lt;br/&amp;gt;| (a2 &amp;amp;amp; a0)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;| (a3 &amp;amp;amp; a2)&amp;lt;br/&amp;gt;| (a3 &amp;amp;amp; a1)&amp;lt;br/&amp;gt;| (a3 &amp;amp;amp; a0)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a1 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; a0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a2 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; a1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a2 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; a0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a3 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; a2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a3 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; a1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a3 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; a0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:53 --&gt;with&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:143:
[[math]]&amp;lt;br/&amp;gt;
 n * (n - 1) - 1&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; n * (n - 1) - 1&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:143 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
operations - that is 11 for n == 4.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;O(n^2) to O(n)&lt;/strong&gt; &lt;br /&gt;
Due to &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#DistributiveAndOr&quot;&gt;distibutive law&lt;/a&gt; one can factor out common sets ...&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:54:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;  (a1 &amp;amp;amp; (      a0))&amp;lt;br/&amp;gt;| (a2 &amp;amp;amp; (   a1|a0))&amp;lt;br/&amp;gt;| (a3 &amp;amp;amp; (a2|a1|a0))&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a1 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;      a0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a2 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;   a1&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;a0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a3 &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a2&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;a1&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;a0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:54 --&gt;... with further reductions of the number of operations, also due to aggregation of the inner or-terms. Three additional operations for an increment of n, thus the former quadratic increase becomes linear.&lt;br /&gt;
&lt;br /&gt;
In general, as mentioned,&lt;br /&gt;
&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:144:
[[math]]&amp;lt;br/&amp;gt;
 \bigcup_{\stackrel{i,j\in I}{i &amp;gt; j}}(A_i\cap A_j)&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; \bigcup_{\stackrel{i,j\in I}{i &gt; j}}(A_i\cap A_j)&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:144 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
requires&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:145:
[[math]]&amp;lt;br/&amp;gt;
 n * (n - 1) - 1&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; n * (n - 1) - 1&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:145 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
operations, which can be reduced to&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:146:
[[math]]&amp;lt;br/&amp;gt;
 3 * (n - 1) - 2&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; 3 * (n - 1) - 2&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:146 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
operations.&lt;br /&gt;
&lt;br /&gt;
This &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Big_O_notation&quot; rel=&quot;nofollow&quot;&gt;O(n^2) to O(n)&lt;/a&gt; simplification is helpful to determine for instance &lt;a class=&quot;wiki_link&quot; href=&quot;/Knight%20Pattern#KnightForks&quot;&gt;knight fork target squares&lt;/a&gt; from eight distinct knight-wise &lt;a class=&quot;wiki_link&quot; href=&quot;/Direction&quot;&gt;direction&lt;/a&gt; attack sets of potential targets, like &lt;a class=&quot;wiki_link&quot; href=&quot;/King&quot;&gt;king&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Queen&quot;&gt;queen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Rook&quot;&gt;rooks&lt;/a&gt; and hanging &lt;a class=&quot;wiki_link&quot; href=&quot;/Bishop&quot;&gt;bishops&lt;/a&gt; or even &lt;a class=&quot;wiki_link&quot; href=&quot;/Pawn&quot;&gt;pawns&lt;/a&gt; - or any other form of at least double attacks from n attack bitboards:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:55:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 attack[n]; // 0..n-1&amp;lt;br/&amp;gt;U64 atLeastDouble = 0;&amp;lt;br/&amp;gt;U64 atLeastSingle = a[0];&amp;lt;br/&amp;gt;for (i=1; i &amp;amp;lt; n; i++) {&amp;lt;br/&amp;gt;  atLeastDouble |= attack[i] &amp;amp;amp; atLeastSingle;&amp;lt;br/&amp;gt;  atLeastSingle |= attack[i];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 attack&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;n&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 0..n-1&lt;/span&gt;
U64 atLeastDouble &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
U64 atLeastSingle &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; n&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  atLeastDouble &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; attack&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; atLeastSingle&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  atLeastSingle &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; attack&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:55 --&gt;&lt;br /&gt;
Well, if you need additionally at least triple attacks, you&#039;ll get the idea how this would work as well, see also &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#OddMajorDigitCounts&quot;&gt;Odd and Major Digit Counts&lt;/a&gt; from the &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;Population Count&lt;/a&gt; page.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:433:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@ShiftingBitboards&amp;quot; title=&amp;quot;Anchor: ShiftingBitboards&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;ShiftingBitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:433 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:272:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc13&quot;&gt;&lt;a name=&quot;Shifting Bitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:272 --&gt;Shifting Bitboards&lt;/h1&gt;
 In the 8*8 board centric world with one scalar square-coordinate 0..63, each of the max eight neighboring squares can be determined by adding an offset for each &lt;a class=&quot;wiki_link&quot; href=&quot;/Direction&quot;&gt;direction&lt;/a&gt;. For border squares one has to care about overflows and wraps from a-file to h-file or vice versa. Some conditional code is needed to avoid that. Such code is usually part of move generation for particular pieces.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:56:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;  northwest    north   northeast&amp;lt;br/&amp;gt;  noWe         nort         noEa&amp;lt;br/&amp;gt;          +7    +8    +9&amp;lt;br/&amp;gt;              \  |  /&amp;lt;br/&amp;gt;  west    -1 &amp;amp;lt;-  0 -&amp;amp;gt; +1    east&amp;lt;br/&amp;gt;              /  |  \&amp;lt;br/&amp;gt;          -9    -8    -7&amp;lt;br/&amp;gt;  soWe         sout         soEa&amp;lt;br/&amp;gt;  southwest    south   southeast&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;  northwest    north   northeast
  noWe         nort         noEa
          +7    +8    +9
              \  |  /
  west    -1 &amp;lt;-  0 -&amp;gt; +1    east
              /  |  \
          -9    -8    -7
  soWe         sout         soEa
  southwest    south   southeast&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:56 --&gt;&lt;!-- ws:start:WikiTextIncludeRule:0129:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/page?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; title=&amp;quot;Include page: page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a href=&quot;/Square%20Mapping%20Considerations&quot;&gt;&lt;img src=&quot;/file/view/mapping.JPG/93134172/mapping.JPG&quot; alt=&quot;mapping.JPG&quot; title=&quot;mapping.JPG&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;em&gt;Code samples and bitboard diagrams rely on &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations#LittleEndianRankFileMapping&quot;&gt;Little endian file and rank mapping&lt;/a&gt;&lt;/em&gt;.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:end:WikiTextIncludeRule:0129 --&gt;&lt;br /&gt;
In the setwise world of bitboards, where a square as member of a set is determined by an appropriate one-bit 2^square, the operation to apply such movements is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts&quot; rel=&quot;nofollow&quot;&gt;shifting&lt;/a&gt; . Unfortunately most architectures don&#039;t support a &amp;quot;generalized&amp;quot; shift by signed values but only shift left or shift right. That makes bitboard code less general as one has usually separate code for each direction or at least for the positive and negative directions.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Shift left (&amp;lt;&amp;lt;) is arithmetically a multiplication by power of two.&lt;/li&gt;&lt;li&gt;Shift right (&amp;gt;&amp;gt; or &amp;gt;&amp;gt;&amp;gt; in &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:220:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://groups.google.com/d/msg/rec.games.chess.computer/o3AMPvhmY3o/1yZhMk3_VlIJ&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Java chess program?&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Moritz%20Berger&amp;quot;&amp;gt;Moritz Berger&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;rgcc&amp;lt;/a&amp;gt;, May 29, 1997 » &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/General%20Setwise%20Operations#ShiftingBitboards&amp;quot;&amp;gt;Shifting Bitboards&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Java&amp;quot;&amp;gt;Java&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-10&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-10&quot;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:220 --&gt;) is arithmetically a division by power of two.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Since the square-index is encoded as power of two exponent inside a bitboard, the power of two multiplication or division is adding or subtracting the square-index.&lt;br /&gt;
&lt;br /&gt;
The reason the bitboard type-definintion is unsigned in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; is to avoid so called &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Arithmetic_shift&quot; rel=&quot;nofollow&quot;&gt;arithmetical shift right&lt;/a&gt; in opposition to &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_shift&quot; rel=&quot;nofollow&quot;&gt;logical shift right&lt;/a&gt; . Arithmetical shift right implies filling one-bits in from MSB-direction if the operand is negative and has MSB bit 63 set. Logical shift right always shifts in zeros - that is what we need. &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt; has no unsigned types, but a special unsigned shift right operator &amp;gt;&amp;gt;&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; has general purpose instruction as well as &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD-instructions&lt;/a&gt; for various shifts:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:57:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;shr      rax,  cl         ;       rax &amp;amp;gt;&amp;amp;gt;= cl&amp;lt;br/&amp;gt;shl      rax,  cl         ;       rax &amp;amp;lt;&amp;amp;lt;= cl&amp;lt;br/&amp;gt;psrlq    mm0,  mm1        ; MMX   mm0 &amp;amp;gt;&amp;amp;gt;= mm1&amp;lt;br/&amp;gt;psllq    mm0,  mm1        ; MMX   mm0 &amp;amp;lt;&amp;amp;lt;= mm1&amp;lt;br/&amp;gt;psrlq    xmm0, xmm1       ; SSE2 xmm0 &amp;amp;gt;&amp;amp;gt;= xmm1&amp;lt;br/&amp;gt;psllq    xmm0, xmm1       ; SSE2 xmm0 &amp;amp;lt;&amp;amp;lt;= xmm1&amp;lt;br/&amp;gt;vpshlq   xmm0, xmm1, xmm2 ; XOP  xmm0   = xmm1 &amp;amp;gt;&amp;amp;gt;/&amp;amp;lt;&amp;amp;lt; xmm2 ; Individual, generalized shifts&amp;lt;br/&amp;gt;vpshlb   xmm0, xmm1, xmm2 ; XOP  xmm0   = xmm1 &amp;amp;gt;&amp;amp;gt;/&amp;amp;lt;&amp;amp;lt; xmm2 ; Individual, generalized shifts of 16 bytes&amp;lt;br/&amp;gt;vpsrlvq  ymm0, ymm1, ymm2 ; AVX2 ymm0   = ymm1 &amp;amp;gt;&amp;amp;gt; ymm2 ; Individual shifts&amp;lt;br/&amp;gt;vpsllvq  ymm0, ymm1, ymm2 ; AVX2 ymm0   = ymm1 &amp;amp;lt;&amp;amp;lt; ymm2 ; Individual shifts&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;shr      rax,  cl         ;       rax &amp;gt;&amp;gt;= cl
shl      rax,  cl         ;       rax &amp;lt;&amp;lt;= cl
psrlq    mm0,  mm1        ; MMX   mm0 &amp;gt;&amp;gt;= mm1
psllq    mm0,  mm1        ; MMX   mm0 &amp;lt;&amp;lt;= mm1
psrlq    xmm0, xmm1       ; SSE2 xmm0 &amp;gt;&amp;gt;= xmm1
psllq    xmm0, xmm1       ; SSE2 xmm0 &amp;lt;&amp;lt;= xmm1
vpshlq   xmm0, xmm1, xmm2 ; XOP  xmm0   = xmm1 &amp;gt;&amp;gt;/&amp;lt;&amp;lt; xmm2 ; Individual, generalized shifts
vpshlb   xmm0, xmm1, xmm2 ; XOP  xmm0   = xmm1 &amp;gt;&amp;gt;/&amp;lt;&amp;lt; xmm2 ; Individual, generalized shifts of 16 bytes
vpsrlvq  ymm0, ymm1, ymm2 ; AVX2 ymm0   = ymm1 &amp;gt;&amp;gt; ymm2 ; Individual shifts
vpsllvq  ymm0, ymm1, ymm2 ; AVX2 ymm0   = ymm1 &amp;lt;&amp;lt; ymm2 ; Individual shifts&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:57 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;-intrinsics with variable register or constant immediate shift amounts, working on vectors of two bitboards:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/yf6cf9k8%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_srl_epi64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/btdyeyt1%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_srli_epi64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/6ta9dffd%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_sll_epi64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/da6131h7%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_slli_epi64&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt; has &lt;a class=&quot;wiki_link&quot; href=&quot;/XOP#Shifts&quot;&gt;individual, generalized shifts&lt;/a&gt; for each of two bitboards and also has byte-wise shifts&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/gg466456&quot; rel=&quot;nofollow&quot;&gt;_mm_shl_epi64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/gg466458&quot; rel=&quot;nofollow&quot;&gt;_mm_shl_epi8&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt; has &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2#IndividualShifts&quot;&gt;individual shifts&lt;/a&gt; for each of four bitboards:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/node/695097&quot; rel=&quot;nofollow&quot;&gt;_mm256_sllv_epi64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/node/695103&quot; rel=&quot;nofollow&quot;&gt;_mm256_srlv_epi64&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextAnchorRule:434:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@OneStepOnly&amp;quot; title=&amp;quot;Anchor: OneStepOnly&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;OneStepOnly&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:434 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:274:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc14&quot;&gt;&lt;a name=&quot;Shifting Bitboards-One Step Only&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:274 --&gt;One Step Only&lt;/h2&gt;
 The advantage with bitboards is, that the shift applies to all set bits in parallel, e.g. with all pawns. Vertical shifts by +-8 don&#039;t need any under- or overflow conditions since bits simply fall out and disappear.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:58:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 soutOne (U64 b) {return  b &amp;amp;gt;&amp;amp;gt; 8;}&amp;lt;br/&amp;gt;U64 nortOne (U64 b) {return  b &amp;amp;lt;&amp;amp;lt; 8;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 soutOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt;  b &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 nortOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt;  b &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:58 --&gt;Wraps from a-file to h-file or vice versa may be considered by only shifting subsets which may not wrap.&lt;br /&gt;
Thus we can mask off the a- or h-file before or after a +-1,7,9 shift:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:59:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;const U64 notAFile = 0xfefefefefefefefe; // ~0x0101010101010101&amp;lt;br/&amp;gt;const U64 notHFile = 0x7f7f7f7f7f7f7f7f; // ~0x8080808080808080&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 notAFile &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xfefefefefefefefe&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// ~0x0101010101010101&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 notHFile &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x7f7f7f7f7f7f7f7f&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// ~0x8080808080808080&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:59 --&gt;Post-shift masks, ...&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:60:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 eastOne (U64 b) {return (b &amp;amp;lt;&amp;amp;lt; 1) &amp;amp;amp; notAFile;}&amp;lt;br/&amp;gt;U64 noEaOne (U64 b) {return (b &amp;amp;lt;&amp;amp;lt; 9) &amp;amp;amp; notAFile;}&amp;lt;br/&amp;gt;U64 soEaOne (U64 b) {return (b &amp;amp;gt;&amp;amp;gt; 7) &amp;amp;amp; notAFile;}&amp;lt;br/&amp;gt;U64 westOne (U64 b) {return (b &amp;amp;gt;&amp;amp;gt; 1) &amp;amp;amp; notHFile;}&amp;lt;br/&amp;gt;U64 soWeOne (U64 b) {return (b &amp;amp;gt;&amp;amp;gt; 9) &amp;amp;amp; notHFile;}&amp;lt;br/&amp;gt;U64 noWeOne (U64 b) {return (b &amp;amp;lt;&amp;amp;lt; 7) &amp;amp;amp; notHFile;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 eastOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notAFile&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 noEaOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notAFile&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 soEaOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notAFile&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 westOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notHFile&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 soWeOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notHFile&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 noWeOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notHFile&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:60 --&gt;... and pre-shift, with the mirrored file masks.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:61:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 eastOne (U64 b) {return (b &amp;amp;amp; notHFile) &amp;amp;lt;&amp;amp;lt; 1;}&amp;lt;br/&amp;gt;U64 noEaOne (U64 b) {return (b &amp;amp;amp; notHFile) &amp;amp;lt;&amp;amp;lt; 9;}&amp;lt;br/&amp;gt;U64 soEaOne (U64 b) {return (b &amp;amp;amp; notHFile) &amp;amp;gt;&amp;amp;gt; 7;}&amp;lt;br/&amp;gt;U64 westOne (U64 b) {return (b &amp;amp;amp; notAFile) &amp;amp;gt;&amp;amp;gt; 1;}&amp;lt;br/&amp;gt;U64 soWeOne (U64 b) {return (b &amp;amp;amp; notAFile) &amp;amp;gt;&amp;amp;gt; 9;}&amp;lt;br/&amp;gt;U64 noWeOne (U64 b) {return (b &amp;amp;amp; notAFile) &amp;amp;lt;&amp;amp;lt; 7;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 eastOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notHFile&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 noEaOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notHFile&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 soEaOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notHFile&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 westOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notAFile&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 soWeOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notAFile&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 noWeOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; notAFile&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:61 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2#OneStepOnlySSE2&quot;&gt;SSE2 one step only&lt;/a&gt; provides some optimizations according to the wraps on vectors of two bitboards.&lt;br /&gt;
&lt;br /&gt;
Main application of shifts is to get attack sets or move-target sets of appropriate &lt;a class=&quot;wiki_link&quot; href=&quot;/Pieces&quot;&gt;pieces&lt;/a&gt;, eg. &lt;strong&gt;one step&lt;/strong&gt; for &lt;a class=&quot;wiki_link&quot; href=&quot;/Pawn&quot;&gt;pawns&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/King&quot;&gt;king&lt;/a&gt;. Applying one step &lt;strong&gt;multiple&lt;/strong&gt; times may used to generate attack sets and moves of pieces like &lt;a class=&quot;wiki_link&quot; href=&quot;/Knight%20Pattern&quot;&gt;knights&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Dumb7Fill&quot;&gt;sliding pieces&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
For instance all push-targets of white pawns can be determined with one shift left plus &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; with empty squares.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:62:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;whiteSinglePawnPushTargets = nortOne(whitePawns) &amp;amp;amp; emptySquares;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;whiteSinglePawnPushTargets &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; nortOne&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;whitePawns&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; emptySquares&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:62 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations&quot;&gt;Square-Mapping&lt;/a&gt; is crucial while shifting bitboards. Shifting left inside a computer word may mean shifting right on the board with little-endian file-mapping as used in most sample code here.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:435:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Rotate&amp;quot; title=&amp;quot;Anchor: Rotate&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Rotate&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:435 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:276:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc15&quot;&gt;&lt;a name=&quot;Shifting Bitboards-Rotate&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:276 --&gt;Rotate&lt;/h2&gt;
 For the sake of completeness - Rotate is similar to shift but wraps bits around. Rotate does not alter the number of set bits. With &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; like shift operand s modulo 64, each bit index i, in the 0 to 63 range, is transposed by&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:63:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;rotateLeft ::=  i := (i + s) mod 64&amp;lt;br/&amp;gt;rotateRight::=  i := (i - s) mod 64&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;rotateLeft ::=  i := (i + s) mod 64
rotateRight::=  i := (i - s) mod 64&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:63 --&gt;Additionally, following relations hold:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:64:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;rotateLeft (s) == rotateRight(64-s)&amp;lt;br/&amp;gt;rotateRight(s) == rotateLeft (64-s)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;rotateLeft (s) == rotateRight(64-s)
rotateRight(s) == rotateLeft (64-s)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:64 --&gt;&lt;br /&gt;
Most processors have rotate instructions, but are not supported by standard programming languages like &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;. Some compilers provide &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/5cc576c4.aspx&quot; rel=&quot;nofollow&quot;&gt;intrinsic&lt;/a&gt;, processor specific functions.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:65:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 rotateLeft (U64 x, int s) {return _rotl64(x, s);}&amp;lt;br/&amp;gt;U64 rotateRight(U64 x, int s) {return _rotr64(x, s);}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 rotateLeft &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; _rotl64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 rotateRight&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; _rotr64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:65 --&gt;&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:66:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;rol  rax, cl&amp;lt;br/&amp;gt;ror  rax, cl&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;rol  rax, cl
ror  rax, cl&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:66 --&gt;&lt;strong&gt;Rotate by Shift&lt;/strong&gt; &lt;br /&gt;
Otherwise rotate has to be emulated by shifts, with some chance optimizing compiler will emit exactly one rotate instruction.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:67:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 rotateLeft (U64 x, int s) {return (x &amp;amp;lt;&amp;amp;lt; s) | (x &amp;amp;gt;&amp;amp;gt; (64-s));}&amp;lt;br/&amp;gt;U64 rotateRight(U64 x, int s) {return (x &amp;amp;gt;&amp;amp;gt; s) | (x &amp;amp;lt;&amp;amp;lt; (64-s));}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 rotateLeft &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 rotateRight&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:67 --&gt;Since &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; 64-bit shifts are implicitly modulo 64 (and 63), one may replace (64-s) by -s.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:436:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@GeneralizedShift&amp;quot; title=&amp;quot;Anchor: GeneralizedShift&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;GeneralizedShift&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:436 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:278:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc16&quot;&gt;&lt;a name=&quot;Shifting Bitboards-Generalized Shift&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:278 --&gt;Generalized Shift&lt;/h2&gt;
 shifts left for positive amounts, but right for negative amounts.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:68:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 genShift(U64 x, int s) {&amp;lt;br/&amp;gt;   return (s &amp;amp;gt; 0) ? (x &amp;amp;lt;&amp;amp;lt; s) : (x &amp;amp;gt;&amp;amp;gt; -s);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 genShift&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:68 --&gt;If compiler are not able to produce speculative execution of both shifts with a conditional move instruction, one may try an explicit branch-less solution:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:69:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt; * generalized shift&amp;lt;br/&amp;gt; * @author Gerd Isenberg&amp;lt;br/&amp;gt; * @param x any bitboard&amp;lt;br/&amp;gt; * @param s shift amount -64 &amp;amp;lt; s &amp;amp;lt; +64&amp;lt;br/&amp;gt; *          left if positive&amp;lt;br/&amp;gt; *          right if negative&amp;lt;br/&amp;gt; * @return shifted bitboard&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;U64 genShift(U64 x, int s) {&amp;lt;br/&amp;gt;   char left  =   (char) s;&amp;lt;br/&amp;gt;   char right = -((char)(s &amp;amp;gt;&amp;amp;gt; 8) &amp;amp;amp; left);&amp;lt;br/&amp;gt;   return (x &amp;amp;gt;&amp;amp;gt; right) &amp;amp;lt;&amp;amp;lt; (right + left);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * generalized shift
 * @author Gerd Isenberg
 * @param x any bitboard
 * @param s shift amount -64 &amp;lt; s &amp;lt; +64
 *          left if positive
 *          right if negative
 * @return shifted bitboard
 */&lt;/span&gt;
U64 genShift&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; left  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; s&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; right &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; left&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; right&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;right &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; left&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:69 --&gt;Due to the value range of the shift, one may save the arithmetical shift right in assembly:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:70:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt; ; input&amp;lt;br/&amp;gt; ;     ecx - shift amount,&amp;lt;br/&amp;gt; ;           left if positive&amp;lt;br/&amp;gt; ;           right if negative&amp;lt;br/&amp;gt; ;     rax - bitboard to shift&amp;lt;br/&amp;gt; mov   dl,  cl&amp;lt;br/&amp;gt; and   cl,  ch&amp;lt;br/&amp;gt; neg   cl&amp;lt;br/&amp;gt; shr   rax, cl&amp;lt;br/&amp;gt; add   cl,  dl&amp;lt;br/&amp;gt; shl   rax, cl&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt; ; input
 ;     ecx - shift amount,
 ;           left if positive
 ;           right if negative
 ;     rax - bitboard to shift
 mov   dl,  cl
 and   cl,  ch
 neg   cl
 shr   rax, cl
 add   cl,  dl
 shl   rax, cl&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:70 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:437:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@GenOneStep&amp;quot; title=&amp;quot;Anchor: GenOneStep&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;GenOneStep&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:437 --&gt;&lt;br /&gt;
&lt;strong&gt;One Step&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; rot64 works like a generalized shift with positive or negative shift amount - since it internally applies an unsigned modulo 64 ( &amp;amp; 63) and makes -i = 64-i. We need to clear either the lower or upper bits by intersection with a mask, which might be combined with the wrap-ands for &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#OneStepOnly&quot;&gt;one step&lt;/a&gt;. It might be applied to get attacks for both sides with a &lt;a class=&quot;wiki_link&quot; href=&quot;/Direction&quot;&gt;direction&lt;/a&gt; parameter and small lookups for shift amount and wrap-ands - instead of multiple code for eight directions. Of course generalized shift will be a bit slower due to lookups and using cl as the shift amount register.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:71:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;// positve left, negative right shifts&amp;lt;br/&amp;gt;int shift[8] = {9, 1,-7,-8,-9,-1, 7, 8};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 avoidWrap[8] =&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   0xfefefefefefefe00,&amp;lt;br/&amp;gt;   0xfefefefefefefefe,&amp;lt;br/&amp;gt;   0x00fefefefefefefe,&amp;lt;br/&amp;gt;   0x00ffffffffffffff,&amp;lt;br/&amp;gt;   0x007f7f7f7f7f7f7f,&amp;lt;br/&amp;gt;   0x7f7f7f7f7f7f7f7f,&amp;lt;br/&amp;gt;   0x7f7f7f7f7f7f7f00,&amp;lt;br/&amp;gt;   0xffffffffffffff00,&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 shiftOne (U64 b, int dir8) {&amp;lt;br/&amp;gt;   return _rotl64(b, shift[dir8]) &amp;amp;amp; avoidWrap[dir8];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// positve left, negative right shifts&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; shift&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;,&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;,&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;,&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 avoidWrap&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;nu12&quot;&gt;0xfefefefefefefe00&lt;/span&gt;,
   &lt;span class=&quot;nu12&quot;&gt;0xfefefefefefefefe&lt;/span&gt;,
   &lt;span class=&quot;nu12&quot;&gt;0x00fefefefefefefe&lt;/span&gt;,
   &lt;span class=&quot;nu12&quot;&gt;0x00ffffffffffffff&lt;/span&gt;,
   &lt;span class=&quot;nu12&quot;&gt;0x007f7f7f7f7f7f7f&lt;/span&gt;,
   &lt;span class=&quot;nu12&quot;&gt;0x7f7f7f7f7f7f7f7f&lt;/span&gt;,
   &lt;span class=&quot;nu12&quot;&gt;0x7f7f7f7f7f7f7f00&lt;/span&gt;,
   &lt;span class=&quot;nu12&quot;&gt;0xffffffffffffff00&lt;/span&gt;,
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
U64 shiftOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; dir8&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; _rotl64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, shift&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;dir8&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; avoidWrap&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;dir8&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:71 --&gt;The avoidWrap masks by some arbitrary dir8 enumeration and shift amount:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:72:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;6 == noWe -&amp;amp;gt; +7     7 == nort -&amp;amp;gt; +8     0 == noEa -&amp;amp;gt; +9&amp;lt;br/&amp;gt;0x7F7F7F7F7F7F7F00  0xFFFFFFFFFFFFFF00  0xFEFEFEFEFEFEFE00&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;5 == west -&amp;amp;gt; -1                         1 == east -&amp;amp;gt; +1&amp;lt;br/&amp;gt;0x7F7F7F7F7F7F7F7F                      0xFEFEFEFEFEFEFEFE&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .                         . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .                         . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .                         . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .                         . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .                         . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .                         . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .                         . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .                         . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;4 == soWe -&amp;amp;gt; -9     3 == sout -&amp;amp;gt; -8     2 == soEa -&amp;amp;gt; -7&amp;lt;br/&amp;gt;0x007F7F7F7F7F7F7F  0x00FFFFFFFFFFFFFF  0x00FEFEFEFEFEFEFE&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; noWe &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; nort &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; noEa &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;nu12&quot;&gt;0x7F7F7F7F7F7F7F00&lt;/span&gt;  &lt;span class=&quot;nu12&quot;&gt;0xFFFFFFFFFFFFFF00&lt;/span&gt;  &lt;span class=&quot;nu12&quot;&gt;0xFEFEFEFEFEFEFE00&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . . . . . . .     . . . . . . . .     . . . . . . . .
&amp;nbsp;
&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; west &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;                         &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; east &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu12&quot;&gt;0x7F7F7F7F7F7F7F7F&lt;/span&gt;                      &lt;span class=&quot;nu12&quot;&gt;0xFEFEFEFEFEFEFEFE&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .                         . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .                         . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .                         . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .                         . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .                         . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .                         . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .                         . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .                         . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; soWe &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; sout &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; soEa &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;nu12&quot;&gt;0x007F7F7F7F7F7F7F&lt;/span&gt;  &lt;span class=&quot;nu12&quot;&gt;0x00FFFFFFFFFFFFFF&lt;/span&gt;  &lt;span class=&quot;nu12&quot;&gt;0x00FEFEFEFEFEFEFE&lt;/span&gt;
. . . . . . . .     . . . . . . . .     . . . . . . . .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:72 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:280:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc17&quot;&gt;&lt;a name=&quot;Shifting Bitboards-See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:280 --&gt;See also&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pawn%20Pushes%20%28Bitboards%29#GeneralizedPush&quot;&gt;Generalized Pawn Push&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Dumb7Fill#GeneralizedRays&quot;&gt;Generalized Ray Attacks&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextAnchorRule:438:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BitbySquare&amp;quot; title=&amp;quot;Anchor: BitbySquare&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BitbySquare&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:438 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:282:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc18&quot;&gt;&lt;a name=&quot;Shifting Bitboards-Bit by Square&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:282 --&gt;Bit by Square&lt;/h2&gt;
 Since single populated bitboards are always power of two values, shifting 2^0 left implements pow2(square) to convert square-indices to a member of a bitboard.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:73:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 singleBitset = C64(1) &amp;amp;lt;&amp;amp;lt; square; // or lookup[square]&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 singleBitset &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; square&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// or lookup[square]&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:73 --&gt;&lt;em&gt;The inverse function square = log2(x), is topic of &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;bitscan&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboard%20Serialization&quot;&gt;bitboard serialization&lt;/a&gt;.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Shift versus Lookup&lt;/strong&gt; &lt;br /&gt;
While 1 &amp;lt;&amp;lt; square sounds cheap, it is rather expensive in 32-bit mode - and therefor often precalculated in a small lookup-table of 64-single bit bitboards. Also, on &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt;-processors a variable shift is restricted to the byte-register cl. Thus, two or more variable shifts are constrained by sequential execution &lt;!-- ws:start:WikiTextRefRule:223:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-chess.org/viewtopic.php?f=5&amp;amp;amp;t=2878&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;To shift or not to shift&amp;lt;/a&amp;gt; by thevinenator, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;OpenChess Forum&amp;lt;/a&amp;gt;, September 09, 2015&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-11&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-11&quot;&gt;[11]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:223 --&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Test&lt;/strong&gt; &lt;br /&gt;
Test a bit of a square-index by &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt;-operator &#039;and&#039;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:74:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;if (x &amp;amp;amp; singleBitset) -&amp;amp;gt; bit is set;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; singleBitset&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; bit is set&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:74 --&gt;&lt;strong&gt;Set&lt;/strong&gt; &lt;br /&gt;
Set a bit of a square-index by &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt;-operator &#039;or&#039;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:75:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x |=  singleBitset; // set bit&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  singleBitset&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// set bit&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:75 --&gt;&lt;strong&gt;Toggle&lt;/strong&gt; &lt;br /&gt;
Toggle a bit of square-index by &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ExclusiveOr&quot;&gt;xor&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:76:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x ^=  singleBitset; // toggle bit&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  singleBitset&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// toggle bit&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:76 --&gt;&lt;strong&gt;Reset&lt;/strong&gt; &lt;br /&gt;
Reset a bit of square-index by &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#RelativeComplement&quot;&gt;relative complement&lt;/a&gt; of the single bit.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:77:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x &amp;amp;amp;= ~singleBitset; // reset bit&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~singleBitset&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// reset bit&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:77 --&gt;Set and toggle (or, xor) might the faster way to reset a bit inside a register (not, and).&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:78:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x |=  singleBitset; // set bit&amp;lt;br/&amp;gt;x ^=  singleBitset; // resets set bit&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  singleBitset&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// set bit&lt;/span&gt;
x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  singleBitset&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// resets set bit&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:78 --&gt;If singleBitset needs to preserved, an extra register is needed for the complement.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-Instructions&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; processor provides a bit-test instruction family (bt, bts, btr, btc) with 32- and 64-bit operands. They may be used implicitly by compiler optimization or explicitly by inline assembler or compiler intrinsics. Take care that they are applied on local variables likely registers rather than memory references:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/h65k4tze%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_bittest64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/z56sc6y4%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_bittestandset64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/zbdxdb11%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_bittestandcomplement64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/hd0hzyf8%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_bittestandreset64&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextAnchorRule:439:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@UpdateByMove&amp;quot; title=&amp;quot;Anchor: UpdateByMove&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;UpdateByMove&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:439 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:284:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc19&quot;&gt;&lt;a name=&quot;Shifting Bitboards-Update by Move&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:284 --&gt;Update by Move&lt;/h2&gt;
 This technique to toggle &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit&quot;&gt;bits&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Squares&quot;&gt;square&lt;/a&gt; is likely used to initialize or &lt;a class=&quot;wiki_link&quot; href=&quot;/Incremental%20Updates&quot;&gt;update&lt;/a&gt; the &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboard%20Board-Definition&quot;&gt;bitboard board-definition&lt;/a&gt;. While &lt;a class=&quot;wiki_link&quot; href=&quot;/Make%20Move&quot;&gt;making&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Unmake%20Move&quot;&gt;unmaking moves&lt;/a&gt;, the single bit either correspondents with the &lt;a class=&quot;wiki_link&quot; href=&quot;/Origin%20Square&quot;&gt;from&lt;/a&gt;- or &lt;a class=&quot;wiki_link&quot; href=&quot;/Target%20Square&quot;&gt;to-square&lt;/a&gt; of the &lt;a class=&quot;wiki_link&quot; href=&quot;/Moves&quot;&gt;move&lt;/a&gt;. Which particular bitboard has to be updated depends on the moving &lt;a class=&quot;wiki_link&quot; href=&quot;/Pieces&quot;&gt;piece&lt;/a&gt; or captured piece.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;For simplicity we assume piece plus color and captured piece are member or method of a move-structure/class.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Quiet%20Moves&quot;&gt;Quiet moves&lt;/a&gt; toggle both from- and to-squares of the piece-bitboard, as well for the redundant union-sets:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:79:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 fromBB   = C64(1) &amp;amp;lt;&amp;amp;lt; move-&amp;amp;gt;from;&amp;lt;br/&amp;gt;U64 toBB     = C64(1) &amp;amp;lt;&amp;amp;lt; move-&amp;amp;gt;to;&amp;lt;br/&amp;gt;U64 fromToBB = fromBB ^ toBB; // |+&amp;lt;br/&amp;gt;pieceBB[move-&amp;amp;gt;piece]  ^=  fromToBB;   // update piece bitboard&amp;lt;br/&amp;gt;pieceBB[move-&amp;amp;gt;color]  ^=  fromToBB;   // update white or black color bitboard&amp;lt;br/&amp;gt;occupiedBB            ^=  fromToBB;   // update occupied ...&amp;lt;br/&amp;gt;emptyBB               ^=  fromToBB;   // ... and empty bitboard&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 fromBB   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; move&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;from&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
U64 toBB     &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; move&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;to&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
U64 fromToBB &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; fromBB &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; toBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// |+&lt;/span&gt;
pieceBB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;move&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;piece&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  fromToBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// update piece bitboard&lt;/span&gt;
pieceBB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;move&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;color&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  fromToBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// update white or black color bitboard&lt;/span&gt;
occupiedBB            &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  fromToBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// update occupied ...&lt;/span&gt;
emptyBB               &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  fromToBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// ... and empty bitboard&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:79 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Captures&quot;&gt;Captures&lt;/a&gt; need to consider the captured piece of course:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:80:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 fromBB   = C64(1) &amp;amp;lt;&amp;amp;lt; move-&amp;amp;gt;from;&amp;lt;br/&amp;gt;U64 toBB     = C64(1) &amp;amp;lt;&amp;amp;lt; move-&amp;amp;gt;to;&amp;lt;br/&amp;gt;U64 fromToBB = fromBB ^ toBB; // |+&amp;lt;br/&amp;gt;pieceBB[move-&amp;amp;gt;piece]  ^=  fromToBB;   // update piece bitboard&amp;lt;br/&amp;gt;pieceBB[move-&amp;amp;gt;color]  ^=  fromToBB;   // update white or black color bitboard&amp;lt;br/&amp;gt;pieceBB[move-&amp;amp;gt;cPiece] ^=  toBB;       // reset the captured piece&amp;lt;br/&amp;gt;pieceBB[move-&amp;amp;gt;cColor] ^=  toBB;       // update color bitboard by captured piece&amp;lt;br/&amp;gt;occupiedBB            ^=  fromBB;     // update occupied, only from becomes empty&amp;lt;br/&amp;gt;emptyBB               ^=  fromBB;     // update empty bitboard&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 fromBB   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; move&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;from&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
U64 toBB     &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; move&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;to&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
U64 fromToBB &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; fromBB &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; toBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// |+&lt;/span&gt;
pieceBB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;move&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;piece&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  fromToBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// update piece bitboard&lt;/span&gt;
pieceBB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;move&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;color&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  fromToBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// update white or black color bitboard&lt;/span&gt;
pieceBB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;move&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;cPiece&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  toBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;       &lt;span class=&quot;co1&quot;&gt;// reset the captured piece&lt;/span&gt;
pieceBB&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;move&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;cColor&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  toBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;       &lt;span class=&quot;co1&quot;&gt;// update color bitboard by captured piece&lt;/span&gt;
occupiedBB            &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  fromBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;     &lt;span class=&quot;co1&quot;&gt;// update occupied, only from becomes empty&lt;/span&gt;
emptyBB               &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  fromBB&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;     &lt;span class=&quot;co1&quot;&gt;// update empty bitboard&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:80 --&gt;Similar for special moves like &lt;a class=&quot;wiki_link&quot; href=&quot;/Castling&quot;&gt;castling&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Promotions&quot;&gt;promotions&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/En%20passant&quot;&gt;en passant captures&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:440:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@UpperAndLowerBits&amp;quot; title=&amp;quot;Anchor: UpperAndLowerBits&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;UpperAndLowerBits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:440 --&gt;&lt;br /&gt;
&lt;strong&gt;Upper Squares&lt;/strong&gt; &lt;br /&gt;
To get a set of all upper squares or bits, either shift ~1 or -2 left by square:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:81:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 upperBits =  C64(~1) &amp;amp;lt;&amp;amp;lt; sq;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 upperBits &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;~&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:81 --&gt;for instance d4 (27)&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:82:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;high = ~1 &amp;amp;lt;&amp;amp;lt; d4&amp;lt;br/&amp;gt; 1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; 1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; 1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; 1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; . . . . 1 1 1 1&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;high &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; d4
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .
 . . . . . . . .
 . . . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:82 --&gt;&lt;br /&gt;
&lt;strong&gt;Lower Squares&lt;/strong&gt; &lt;br /&gt;
Lower squares are simply Bit by Square minus one.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:83:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 lowerBits = (C64(1 ) &amp;amp;lt;&amp;amp;lt; sq) - 1);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 lowerBits &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:83 --&gt;for instance d4 (27)&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:84:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;low = (1&amp;amp;lt;&amp;amp;lt;d4)-1&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; . . . . . . . .&amp;lt;br/&amp;gt; 1 1 1 . . . . .&amp;lt;br/&amp;gt; 1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; 1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt; 1 1 1 1 1 1 1 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;low &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;d4&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 . . . . . . . .
 . . . . . . . .
 . . . . . . . .
 . . . . . . . .
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . .
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
 &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:84 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:441:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@SwappingBits&amp;quot; title=&amp;quot;Anchor: SwappingBits&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;SwappingBits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:441 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:286:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc20&quot;&gt;&lt;a name=&quot;Shifting Bitboards-Swapping Bits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:286 --&gt;Swapping Bits&lt;/h2&gt;
 &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://graphics.stanford.edu/%7Eseander/bithacks.html#SwappingBitsXOR&quot; rel=&quot;nofollow&quot;&gt;Swapping&lt;/a&gt; none overlapping bit-sequences in a bitboard is the base of a lot of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Permutation&quot; rel=&quot;nofollow&quot;&gt;permutation&lt;/a&gt; tricks.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;by Position&lt;/strong&gt; &lt;br /&gt;
Suppose we like to swap n &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit&quot;&gt;bits&lt;/a&gt; from two none overlapping bit locations of a bitboard. The trick is to set all n least significant bits by subtracting one from n power of 2. Both substrings are shifted to bit zero, exclusive ored and masked by the n ones. This sequence is then twice shifted back to their original places, while the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; (xor-union due to &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Disjoint&quot; rel=&quot;nofollow&quot;&gt;disjoint&lt;/a&gt; bits) is finally exclusive ored with the original bitboard to swap both sequences.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:85:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt; * swap n none overlapping bits of bit-index i with j&amp;lt;br/&amp;gt; * @param b any bitboard&amp;lt;br/&amp;gt; * @param i,j positions of bit sequences to swap&amp;lt;br/&amp;gt; * @param n number of consecutive bits to swap&amp;lt;br/&amp;gt; * @return bitboard b with swapped bit-sequences&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;U64 swapNBits(U64 b, int i, int j, int n) {&amp;lt;br/&amp;gt;   U64     m = ( 1 &amp;amp;lt;&amp;amp;lt; n) - 1;&amp;lt;br/&amp;gt;   U64     x = ((b &amp;amp;gt;&amp;amp;gt; i) ^ (b &amp;amp;gt;&amp;amp;gt; j)) &amp;amp;amp; m;&amp;lt;br/&amp;gt;   return  b ^  (x &amp;amp;lt;&amp;amp;lt; i) ^ (x &amp;amp;lt;&amp;amp;lt; j);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * swap n none overlapping bits of bit-index i with j
 * @param b any bitboard
 * @param i,j positions of bit sequences to swap
 * @param n number of consecutive bits to swap
 * @return bitboard b with swapped bit-sequences
 */&lt;/span&gt;
U64 swapNBits&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; j, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; n&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64     m &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; n&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   U64     x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; i&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; j&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; m&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt;  b &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; j&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:85 --&gt;For instance swap 6 bits each, from bit-index 9 (bits named ABCDEF, either 0,1) with bit-index 41 (abcdef):&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:86:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;b                                       m = (1&amp;amp;lt;&amp;amp;lt;6) - 1&amp;lt;br/&amp;gt;. . . . . . . .                         . . . . . . . .&amp;lt;br/&amp;gt;* . . . . . . .                         . . . . . . . .&amp;lt;br/&amp;gt;*|a b c d e f|*                         . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .                         . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .                         . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .                         . . . . . . . .&amp;lt;br/&amp;gt;*|A B C D E F|*                         . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .                         1 1 1 1 1 1 . .&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;b &amp;amp;gt;&amp;amp;gt; j           ^  b &amp;amp;gt;&amp;amp;gt; i          =&amp;amp;gt;  x = .xor &amp;amp;amp; m       with&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .    r = a ^ A&amp;lt;br/&amp;gt;. . . . . . . .     a b c d e f * *     . . . . . . . .    s = b ^ B&amp;lt;br/&amp;gt;. . . . . . . .  ^  . . . . . . . * =&amp;amp;gt;  . . . . . . . .    t = c ^ C&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .    u = d ^ D&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .    v = e ^ E&amp;lt;br/&amp;gt;a b c d e f * *     A B C D E F * .     r s t u v w . .    w = f ^ F&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;b               ^  x &amp;amp;lt;&amp;amp;lt; i | x &amp;amp;lt;&amp;amp;lt; j  =&amp;amp;gt; swapNBits(9,41,6)&amp;lt;br/&amp;gt;. . . . . . . .    . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;* . . . . . . .    . . . . . . . .     * . . . . . . .&amp;lt;br/&amp;gt;*|a b c d e f|*    . r s t u v w .     *|A B C D E F|*&amp;lt;br/&amp;gt;. . . . . . . .    . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . . ^  . . . . . . . .  =&amp;amp;gt; . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .    . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;*|A B C D E F|*    . r s t u v w .     *|a b c d e f|*&amp;lt;br/&amp;gt;. . . . . . . .    . . . . . . . .     . . . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;b                                       m &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . . . . . . .                         . . . . . . . .
&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; . . . . . . .                         . . . . . . . .
&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;a b c d e f&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;                         . . . . . . . .
. . . . . . . .                         . . . . . . . .
. . . . . . . .                         . . . . . . . .
. . . . . . . .                         . . . . . . . .
&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;A B C D E F&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;                         . . . . . . . .
. . . . . . . .                         &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
&amp;nbsp;
&lt;span class=&quot;me1&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; j           &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  b &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; i          &lt;span class=&quot;sy1&quot;&gt;=&amp;gt;&lt;/span&gt;  x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; .&lt;span class=&quot;me1&quot;&gt;xor&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; m       with
. . . . . . . .     . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .     . . . . . . . .    &lt;span class=&quot;me1&quot;&gt;r&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; A
. . . . . . . .     &lt;span class=&quot;me1&quot;&gt;a&lt;/span&gt; b c d e f &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;     . . . . . . . .    &lt;span class=&quot;me1&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; b &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; B
. . . . . . . .  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  . . . . . . . &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&amp;gt;&lt;/span&gt;  . . . . . . . .    &lt;span class=&quot;me1&quot;&gt;t&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; c &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; C
. . . . . . . .     . . . . . . . .     . . . . . . . .    &lt;span class=&quot;me1&quot;&gt;u&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; d &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; D
. . . . . . . .     . . . . . . . .     . . . . . . . .    &lt;span class=&quot;me1&quot;&gt;v&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; e &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; E
a b c d e f &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;     A B C D E F &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; .     &lt;span class=&quot;me1&quot;&gt;r&lt;/span&gt; s t u v w . .    &lt;span class=&quot;me1&quot;&gt;w&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; f &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; F
&amp;nbsp;
b               &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; i &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; j  &lt;span class=&quot;sy1&quot;&gt;=&amp;gt;&lt;/span&gt; swapNBits&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;41&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
. . . . . . . .    . . . . . . . .     . . . . . . . .
&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; . . . . . . .    . . . . . . . .     &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; . . . . . . .
&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;a b c d e f&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;    . &lt;span class=&quot;me1&quot;&gt;r&lt;/span&gt; s t u v w .     &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;A B C D E F&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;
. . . . . . . .    . . . . . . . .     . . . . . . . .
. . . . . . . . &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  . . . . . . . .  &lt;span class=&quot;sy1&quot;&gt;=&amp;gt;&lt;/span&gt; . . . . . . . .
. . . . . . . .    . . . . . . . .     . . . . . . . .
&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;A B C D E F&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;    . &lt;span class=&quot;me1&quot;&gt;r&lt;/span&gt; s t u v w .     &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;a b c d e f&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;
. . . . . . . .    . . . . . . . .     . . . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:86 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:442:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@DeltaSwap&amp;quot; title=&amp;quot;Anchor: DeltaSwap&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;DeltaSwap&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:442 --&gt;&lt;br /&gt;
&lt;strong&gt;Delta Swap&lt;/strong&gt; &lt;br /&gt;
To swap any none overlapping pairs we can shift by the difference (j-i, with j&amp;gt;i) and supply an explicit mask with a &#039;1&#039; on the least significant position for each pair supposed to be swapped.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:87:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt; * swap any none overlapping pairs of bits&amp;lt;br/&amp;gt; *   that are delta places apart&amp;lt;br/&amp;gt; * @param b any bitboard&amp;lt;br/&amp;gt; * @param mask has a 1 on the least significant position&amp;lt;br/&amp;gt; *             for each pair supposed to be swapped&amp;lt;br/&amp;gt; * @param delta of pairwise swapped bits&amp;lt;br/&amp;gt; * @return bitboard b with bits swapped&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;U64 deltaSwap(U64 b, U64 mask, int delta) {&amp;lt;br/&amp;gt;   U64 x = (b ^ (b &amp;amp;gt;&amp;amp;gt; delta)) &amp;amp;amp; mask;&amp;lt;br/&amp;gt;   return   x ^ (x &amp;amp;lt;&amp;amp;lt; delta)  ^ b;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * swap any none overlapping pairs of bits
 *   that are delta places apart
 * @param b any bitboard
 * @param mask has a 1 on the least significant position
 *             for each pair supposed to be swapped
 * @param delta of pairwise swapped bits
 * @return bitboard b with bits swapped
 */&lt;/span&gt;
U64 deltaSwap&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b, U64 mask, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; delta&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; delta&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; mask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt;   x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; delta&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:87 --&gt;To apply the swapping of the swapNBits sample above, we call deltaSwap with delta of 32 and 0x7E00 as mask. But we may apply any arbitrary and often periodic mask pattern, as long as no overlapping occurs. The &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; of mask with (mask &amp;lt;&amp;lt; delta) must therefor be empty. But we can also swap odd or even files of a bitboard by calling deltaSwap with delta of one, and mask of 0x5555555555555555:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:88:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;1 . 1 . 1 . 1 .&amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .&amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .&amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .&amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .&amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .&amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .&amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:88 --&gt;Applications of delta swaps are &lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating&quot;&gt;flipping, mirroring and rotating&lt;/a&gt;. In &lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Knuth&#039;s&lt;/a&gt; &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming&quot; rel=&quot;nofollow&quot;&gt;The Art of Computer Programming&lt;/a&gt;, Vol 4, page 13, bit permutation in general&lt;/em&gt; &lt;!-- ws:start:WikiTextRefRule:231:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Donald%20Knuth&amp;quot;&amp;gt;Donald Knuth&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2009&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The Art of Computer Programming&amp;lt;/a&amp;gt;, Volume 4, Fascicle 1: Bitwise tricks &amp;amp;amp; techniques&amp;lt;/em&amp;gt;, as &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www-cs-faculty.stanford.edu/%7Eknuth/fasc1a.ps.gz&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Pre-Fascicle 1a postscript&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-12&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-12&quot;&gt;[12]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:231 --&gt;, he mentions 2^k delta swaps with k = {0,1,2,3,4,5,4,3,2,1,0} to obtain any arbitrary permutation. Special cases might be cheaper.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:443:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@ArithmeticalOperations&amp;quot; title=&amp;quot;Anchor: ArithmeticalOperations&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;ArithmeticalOperations&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:443 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:288:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc21&quot;&gt;&lt;a name=&quot;Arithmetic Operations&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:288 --&gt;Arithmetic Operations&lt;/h1&gt;
 At the first glance, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Arithmetic#Arithmetic_operations&quot; rel=&quot;nofollow&quot;&gt;arithmetic operations&lt;/a&gt;, that is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Addition&quot; rel=&quot;nofollow&quot;&gt;addition&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Subtraction&quot; rel=&quot;nofollow&quot;&gt;subtraction&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Multiplication&quot; rel=&quot;nofollow&quot;&gt;multiplication&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Division_%28mathematics%29&quot; rel=&quot;nofollow&quot;&gt;division&lt;/a&gt;, doesn&#039;t make much sense with bitboards. Still, there are some &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling&quot;&gt;bit-twiddling&lt;/a&gt; applications related to least significant one bit (LS1B), to &lt;a class=&quot;wiki_link&quot; href=&quot;/Traversing%20Subsets%20of%20a%20Set&quot;&gt;enumerate all subsets of a set&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Subtracting%20a%20rook%20from%20a%20blocking%20piece&quot;&gt;sliding attack generation&lt;/a&gt;. Multiplication of certain pattern has some applications as well, most likely to calculate hash-indicies of &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy%20of%20any%20Line#Multiplication&quot;&gt;masked occupancies&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:290:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc22&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Derived from Bitwise&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:290 --&gt;Derived from Bitwise&lt;/h2&gt;
Unlike bitwise boolean operations on 64-bit words, which are in fact 64 parallel operations on each bit without any interaction between them, arithmetic operations like addition need to propagate possible &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Carry_%28arithmetic%29&quot; rel=&quot;nofollow&quot;&gt;carries&lt;/a&gt; from lower to higher bits. Despite, Add and Sub are usually as fast their bitwise boolean counterparts, because they are implemented in Hardware within the &lt;a class=&quot;wiki_link&quot; href=&quot;/Combinatorial%20Logic#ALU&quot;&gt;ALU&lt;/a&gt; of the CPU. A so called &lt;a class=&quot;wiki_link&quot; href=&quot;/Combinatorial%20Logic#Adder&quot;&gt;half-adder&lt;/a&gt; to add two bits (A, B), requires an &lt;a class=&quot;wiki_link&quot; href=&quot;/Combinatorial%20Logic#AND&quot;&gt;And-Gate&lt;/a&gt; for the carry (C) and a &lt;a class=&quot;wiki_link&quot; href=&quot;/Combinatorial%20Logic#XOR&quot;&gt;Xor-Gate&lt;/a&gt; for the sum (S):&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextLocalImageRule:1267:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/Half_adder#Half_adder&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/180px-Half_Adder.svg.png/399786768/180px-Half_Adder.svg.png&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Half_adder#Half_adder&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/180px-Half_Adder.svg.png/399786768/180px-Half_Adder.svg.png&quot; alt=&quot;180px-Half_Adder.svg.png&quot; title=&quot;180px-Half_Adder.svg.png&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:1267 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:89:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;two_bitsum = (bitA ^ bitB) | ((bitA &amp;amp;amp; bitB) &amp;amp;lt;&amp;amp;lt; 1);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;two_bitsum &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bitA &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; bitB&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bitA &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; bitB&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:89 --&gt;&lt;br /&gt;
To get an idea of the &amp;quot;complexity&amp;quot; of a simple addition, and how to implement an &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Carry-lookahead_adder&quot; rel=&quot;nofollow&quot;&gt;carry-lookahead adder&lt;/a&gt; in software with bitwise boolean and shift instructions only, and presumption on &lt;a class=&quot;wiki_link&quot; href=&quot;/Parallel%20Prefix%20Algorithms&quot;&gt;parallel prefix algorithms&lt;/a&gt;, this is how a 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Parallel%20Prefix%20Algorithms#FurtherElaborationsOnKoggeStone&quot;&gt;Kogge-Stone&lt;/a&gt; adder would look like in C:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:90:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 koggeStoneAdd(U64 a, U64 b) {&amp;lt;br/&amp;gt;   U64 gen = a&amp;amp;amp;b;  // carries&amp;lt;br/&amp;gt;   U64 pro = a^b;  // sum&amp;lt;br/&amp;gt;   gen |= pro &amp;amp;amp; (gen &amp;amp;lt;&amp;amp;lt; 1);&amp;lt;br/&amp;gt;   pro  = pro &amp;amp;amp; (pro &amp;amp;lt;&amp;amp;lt; 1);&amp;lt;br/&amp;gt;   gen |= pro &amp;amp;amp; (gen &amp;amp;lt;&amp;amp;lt; 2);&amp;lt;br/&amp;gt;   pro  = pro &amp;amp;amp; (pro &amp;amp;lt;&amp;amp;lt; 2);&amp;lt;br/&amp;gt;   gen |= pro &amp;amp;amp; (gen &amp;amp;lt;&amp;amp;lt; 4);&amp;lt;br/&amp;gt;   pro  = pro &amp;amp;amp; (pro &amp;amp;lt;&amp;amp;lt; 4);&amp;lt;br/&amp;gt;   gen |= pro &amp;amp;amp; (gen &amp;amp;lt;&amp;amp;lt; 8);&amp;lt;br/&amp;gt;   pro  = pro &amp;amp;amp; (pro &amp;amp;lt;&amp;amp;lt; 8);&amp;lt;br/&amp;gt;   gen |= pro &amp;amp;amp; (gen &amp;amp;lt;&amp;amp;lt;16);&amp;lt;br/&amp;gt;   pro  = pro &amp;amp;amp; (pro &amp;amp;lt;&amp;amp;lt;16);&amp;lt;br/&amp;gt;   gen |= pro &amp;amp;amp; (gen &amp;amp;lt;&amp;amp;lt;32);&amp;lt;br/&amp;gt;   return a^b ^ (gen &amp;amp;lt;&amp;amp;lt; 1);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 koggeStoneAdd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 a, U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 gen &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; a&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// carries&lt;/span&gt;
   U64 pro &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; a&lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// sum&lt;/span&gt;
   gen &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pro &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gen &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   pro  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pro &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;pro &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   gen &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pro &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gen &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   pro  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pro &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;pro &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   gen &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pro &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gen &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   pro  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pro &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;pro &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   gen &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pro &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gen &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   pro  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pro &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;pro &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   gen &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pro &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gen &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   pro  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pro &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;pro &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   gen &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pro &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gen &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; a&lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;b &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gen &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:90 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:444:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Addition&amp;quot; title=&amp;quot;Anchor: Addition&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Addition&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:444 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:292:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc23&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Addition&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:292 --&gt;Addition&lt;/h2&gt;
 &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Addition&quot; rel=&quot;nofollow&quot;&gt;Addition&lt;/a&gt; might be used instead of bitwise &#039;xor&#039; or &#039;or&#039; for a &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; of &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Disjoint&quot; rel=&quot;nofollow&quot;&gt;disjoint&lt;/a&gt; (intersection zero) sets, which may yield to simplification of the surrounding expression or may take advantage of certain address calculation instruction such as &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; load effective address (lea).&lt;br /&gt;
&lt;br /&gt;
The enriched algebra with arithmetical and bitwise-boolean operations becomes aware with following relation - the bitwise overflows are the intersection, otherwise the sum modulo two is the symmetric difference - thus the arithmetical sum is the xor-sum plus the carries shifted left one:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:91:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;x + y = (x ^ y) + 2*(x &amp;amp;amp; y)&amp;lt;br/&amp;gt;x ^ y =  x + y  - 2*(x &amp;amp;amp; y)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;x + y = (x ^ y) + 2*(x &amp;amp; y)
x ^ y =  x + y  - 2*(x &amp;amp; y)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:91 --&gt;This is particular interesting in &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques#SWAR&quot;&gt;SWAR-arithmetic&lt;/a&gt;, or if we like to compute the average without possible temporary overflows:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:92:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;(x + y) / 2 = ((x ^ y)&amp;amp;gt;&amp;amp;gt;1) + (x &amp;amp;amp; y)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;(x + y) / 2 = ((x ^ y)&amp;gt;&amp;gt;1) + (x &amp;amp; y)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:92 --&gt;&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:93:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;add  rax, rbx ; rax += rbx&amp;lt;br/&amp;gt;lea  rax, [rcx + rdx + const ] ; rax = rcx + rdx + const&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;add  rax, rbx ; rax += rbx
lea  rax, [rcx + rdx + const ] ; rax = rcx + rdx + const&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:93 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:445:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Subtraction&amp;quot; title=&amp;quot;Anchor: Subtraction&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Subtraction&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:445 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:294:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc24&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Subtraction&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:294 --&gt;Subtraction&lt;/h2&gt;
 &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Subtraction&quot; rel=&quot;nofollow&quot;&gt;Subtraction&lt;/a&gt; (like xor) might be used to implement the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#RelativeComplement&quot;&gt;relative complement&lt;/a&gt;, of a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Subset&quot; rel=&quot;nofollow&quot;&gt;subset&lt;/a&gt; inside it&#039;s superset. As mentioned, subtraction may be useful in calculating &lt;a class=&quot;wiki_link&quot; href=&quot;/Subtracting%20a%20rook%20from%20a%20blocking%20piece&quot;&gt;sliding attacks&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:94:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;sub  rax, rbx ; rax -= rbx&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;sub  rax, rbx ; rax -= rbx&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:94 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:446:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@TheTwosComplement&amp;quot; title=&amp;quot;Anchor: TheTwosComplement&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;TheTwosComplement&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:446 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:296:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc25&quot;&gt;&lt;a name=&quot;Arithmetic Operations-The Two&#039;s Complement&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:296 --&gt;The Two&#039;s Complement&lt;/h2&gt;
 A lot of &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling&quot;&gt;bit-twiddling&lt;/a&gt; tricks on bitboards to traverse or isolate subsets, rely on &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Two%27s_complement&quot; rel=&quot;nofollow&quot;&gt;two&#039;s complement&lt;/a&gt; arithmetic. Most recent processors (and compiler or interpreter for these processors) use the two&#039;s complement to implement the unary minus operator for signed as well for unsigned integer types. In &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; it is guaranteed for unsigned integer types. &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt; guarantees two&#039;s complement for all implicit signed integral types char, short, int, long.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:95:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;neg  rax;  rax = -rax; rax *= -1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;neg  rax;  rax = -rax; rax *= -1&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:95 --&gt;&lt;br /&gt;
&lt;em&gt;2^N is used as power operator in this paragraph not xor !&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Increment of Complement&lt;/strong&gt; &lt;br /&gt;
The two&#039;s complement is defined as a value, we need to add to the original value to get 2^64 which is an &amp;quot;overflowed&amp;quot; zero - since all 64-bit values are implicitly modulo 2^64. Thus, the two&#039;s complement is defined as &lt;strong&gt;ones&#039; complement plus one&lt;/strong&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:96:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;-x == ~x + 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; ~x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:96 --&gt;That fulfills the condition that x + (-x) == 2 ^ bitsize (2 ^ 64) which overflows to zero:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:97:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x + (-x)     == 0&amp;lt;br/&amp;gt;x +  ~x + 1  == 0&amp;lt;br/&amp;gt;==&amp;amp;gt;   x + ~x == -1 the universal set&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;     &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  ~x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;sy1&quot;&gt;==&amp;gt;&lt;/span&gt;   x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; ~x &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; the universal set&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:97 --&gt;&lt;strong&gt;Complement of Decrement&lt;/strong&gt; &lt;br /&gt;
Replacing x by x - 1 in the increment of complement formula, leaves another definition - two&#039;s complement or Negation is also the ones&#039; complement of the ones&#039; decrement:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:98:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;-x == ~(x - 1)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; ~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:98 --&gt;Thus, we can reduce subtraction by addition and ones&#039; complement:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:99:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;~(x - y) ==   ~x + y&amp;lt;br/&amp;gt;  x - y  == ~(~x + y)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt;   ~x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; y
  x &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; y  &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; ~&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;~x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:99 --&gt;&lt;br /&gt;
&lt;strong&gt;Bitwise Copy/Invert&lt;/strong&gt; &lt;br /&gt;
The two&#039;s complement may also defined by a bitwise copy-loop from right (LSB) to left (MSB):&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:100:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;Copy bits from source to destination from right to left&amp;lt;br/&amp;gt;- until the first binary &amp;amp;quot;one&amp;amp;quot; is copied.&amp;lt;br/&amp;gt;Then invert each of the remaining higher bits.&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;Copy bits from source to destination from right to left
- until the first binary &amp;quot;one&amp;quot; is copied.
Then invert each of the remaining higher bits.&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:100 --&gt;&lt;br /&gt;
&lt;strong&gt;Signed-Unsigned&lt;/strong&gt; &lt;br /&gt;
This works independently whether we interpret &#039;x&#039; as signed or unsigned. While 0 is is the synonym for all bits clear, -1 is the synonym for all bits set in a computer word of any arbitrary bit-size, also for 64-bit words such as bitboards.&lt;br /&gt;
&lt;br /&gt;
The signed-unsigned &amp;quot;independence&amp;quot; of the two&#039;s complement is the reason that processors don&#039;t need different add or sub instructions for signed or unsigned integers. The binary pattern of the result is the same, only the interpretation differs and processors flag different overflow- or underflow conditions simultaneously.&lt;br /&gt;
&lt;br /&gt;
Unsigned 64-bit values as used for bitboards have this value range:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:101:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;       hexadecimal                      decimal    pow2&amp;lt;br/&amp;gt;0x0000000000000000                            0           0&amp;lt;br/&amp;gt;0x0000000000000001                            1           1&amp;lt;br/&amp;gt;..&amp;lt;br/&amp;gt;0x7fffffffffffffff    9,223,372,036,854,775,807    2^63 - 1&amp;lt;br/&amp;gt;0x8000000000000000    9,223,372,036,854,775,808    2^63&amp;lt;br/&amp;gt;..&amp;lt;br/&amp;gt;0xffffffffffffffff   18,446,744,073,709,551,615    2^64 - 1&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;       hexadecimal                      decimal    pow2
0x0000000000000000                            0           0
0x0000000000000001                            1           1
..
0x7fffffffffffffff    9,223,372,036,854,775,807    2^63 - 1
0x8000000000000000    9,223,372,036,854,775,808    2^63
..
0xffffffffffffffff   18,446,744,073,709,551,615    2^64 - 1
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:101 --&gt;With signed interpretation, the positive numbers are subset of the unsigned with MSB clear:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:102:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;       hexadecimal                      decimal    pow2&amp;lt;br/&amp;gt;0x0000000000000000                            0           0&amp;lt;br/&amp;gt;0x0000000000000001                            1           1&amp;lt;br/&amp;gt;..&amp;lt;br/&amp;gt;0x7fffffffffffffff    9,223,372,036,854,775,807    2^63 - 1&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;       hexadecimal                      decimal    pow2
0x0000000000000000                            0           0
0x0000000000000001                            1           1
..
0x7fffffffffffffff    9,223,372,036,854,775,807    2^63 - 1
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:102 --&gt;Negative numbers have MSB set to one, thus the sign bit interpretation&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:103:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;       hexadecimal                      decimal    pow2&amp;lt;br/&amp;gt;0x8000000000000000   -9,223,372,036,854,775,808  -(2^63)&amp;lt;br/&amp;gt;0x8000000000000001   -9,223,372,036,854,775,807  -(2^63) +1&amp;lt;br/&amp;gt;..&amp;lt;br/&amp;gt;0xfffffffffffffffe                           -2          -2&amp;lt;br/&amp;gt;0xffffffffffffffff                           -1          -1&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;       hexadecimal                      decimal    pow2
0x8000000000000000   -9,223,372,036,854,775,808  -(2^63)
0x8000000000000001   -9,223,372,036,854,775,807  -(2^63) +1
..
0xfffffffffffffffe                           -2          -2
0xffffffffffffffff                           -1          -1
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:103 --&gt;There is no &amp;quot;negative&amp;quot; zero. What makes the value range of negative values one greater than the positive numbers - and implies that&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:104:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt; -0x8000000000000000 == 0x8000000000000000&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt; -0x8000000000000000 == 0x8000000000000000&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:104 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:447:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@TheLeastSignificantOneBitLS1B&amp;quot; title=&amp;quot;Anchor: TheLeastSignificantOneBitLS1B&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;TheLeastSignificantOneBitLS1B&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:447 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:298:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc26&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Least Significant One&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:298 --&gt;Least Significant One&lt;/h2&gt;
 At some point bitboards require &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboard%20Serialization&quot;&gt;serialization&lt;/a&gt;, thus isolation of single populated sub-sets which are power of two values if interpreted as number. Dependent on the bitboard-api those values need a further &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;log2(powOfTwo)&lt;/a&gt; to convert them into the square index range from 0 to 63. Bitwise boolean operations (and, xor, or) with two&#039;s complement or ones&#039; decrement can compute relatives of a set x in several useful ways.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:448:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@LS1BIsolation&amp;quot; title=&amp;quot;Anchor: LS1BIsolation&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;LS1BIsolation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:448 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:300:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc27&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Least Significant One-Isolation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:300 --&gt;Isolation&lt;/h3&gt;
 The &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; of a none empty bitboard with it&#039;s two&#039;s complement isolates the LS1B:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:105:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;LS1B_of_x = x &amp;amp;amp; -x;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;LS1B_of_x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;x&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:105 --&gt;With some arbitrary sample set:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:106:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;      x          &amp;amp;amp;        -x         =     LS1B_of_x&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     . . . . . . . .&amp;lt;br/&amp;gt;. . 1 . 1 . . .     1 1 . 1 . 1 1 1     . . . . . . . .&amp;lt;br/&amp;gt;. 1 . . . 1 . .     1 . 1 1 1 . 1 1     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     . . . . . . . .&amp;lt;br/&amp;gt;. 1 . . . 1 . .  &amp;amp;amp;  1 . 1 1 1 . 1 1  =  . . . . . . . .&amp;lt;br/&amp;gt;. . 1 . 1 . . .     . . 1 1 . 1 1 1     . . 1 . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;      x          &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;        &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;x         &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;     LS1B_of_x
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  . . . . . . . .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . .
. . . . . . . .     . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .     . . . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:106 --&gt;Some C++ compiler warn -x still unsigned - (0-x) may used to avoid that with no overhead.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; expansion &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt; has LS1B bit isolation:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:107:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;blsi  rax, rbx ; BMI1  rax = rbx &amp;amp;amp; -rbx &amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;blsi  rax, rbx ; BMI1  rax = rbx &amp;amp; -rbx &lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:107 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt;-intrinsic &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.felixcloutier.com/x86/BLSI.html&quot; rel=&quot;nofollow&quot;&gt;_blsi_u32/64&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; expansion &lt;a class=&quot;wiki_link&quot; href=&quot;/TBM&quot;&gt;TBM&lt;/a&gt; further has a &lt;a class=&quot;wiki_link&quot; href=&quot;/TBM#BLSIC&quot;&gt;Isolate Lowest Set Bit and Complement&lt;/a&gt; instruction, which applies &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#DeMorganslaws&quot;&gt;De Morgan&#039;s law&lt;/a&gt; to get the complement of the LS1B:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:108:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;blsic rax, rbx ; TBM:  rax = ~rbx | (rbx - 1);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;blsic rax, rbx ; TBM:  rax = ~rbx | (rbx - 1);&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:108 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:449:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@LS1BReset&amp;quot; title=&amp;quot;Anchor: LS1BReset&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;LS1BReset&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:449 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:302:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc28&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Least Significant One-Reset&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:302 --&gt;Reset&lt;/h3&gt;
 The &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; of a none empty bitboard with it&#039;s ones&#039; decrement resets the LS1B &lt;!-- ws:start:WikiTextRefRule:239:&amp;amp;lt;ref&amp;amp;gt; &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#PWegner&amp;quot;&amp;gt;Peter Wegner&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1960&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;A technique for counting ones in a binary computer&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Communications_of_the_ACM&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Communications of the ACM&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.informatik.uni-trier.de/~ley/db/journals/cacm/cacm3.html#Wegner60&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Volume 3, 1960&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-13&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-13&quot;&gt;[13]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:239 --&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:109:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x_with_reset_LS1B = x &amp;amp;amp; (x-1);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x_with_reset_LS1B &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:109 --&gt;With some arbitrary sample set:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:110:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;      x          &amp;amp;amp;      (x-1)        =  x_with_reset_LS1B&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . 1 . 1 . . .     . . 1 . 1 . . .     . . 1 . 1 . . .&amp;lt;br/&amp;gt;. 1 . . . 1 . .     . 1 . . . 1 . .     . 1 . . . 1 . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. 1 . . . 1 . .  &amp;amp;amp;  . 1 . . . 1 . .  =  . 1 . . . 1 . .&amp;lt;br/&amp;gt;. . 1 . 1 . . .     1 1 . . 1 . . .     . . . . 1 . . .&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     . . . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;      x          &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;        &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  x_with_reset_LS1B
. . . . . . . .     . . . . . . . .     . . . . . . . .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . . . . . . .     . . . . . . . .     . . . . . . . .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;  . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:110 --&gt;... since we already know two&#039;s complement (-x) and ones&#039; decrement (x-1) are complement sets.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; expansion &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt; has LS1B bit reset:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:111:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;blsr  rax, rbx ; BMI1  rax = rbx &amp;amp;amp; (rbx - 1)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;blsr  rax, rbx ; BMI1  rax = rbx &amp;amp; (rbx - 1)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:111 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt;-intrinsic &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.felixcloutier.com/x86/BLSR.html&quot; rel=&quot;nofollow&quot;&gt;_blsr_u32/64&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:450:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@LS1BSeparation&amp;quot; title=&amp;quot;Anchor: LS1BSeparation&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;LS1BSeparation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:450 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:304:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc29&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Least Significant One-Separation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:304 --&gt;Separation&lt;/h3&gt;
 Masks separated by LS1B by xor with two&#039;s complement or ones&#039; decrement. Intersection of one&#039;s complement with decrement leaves the below mask excluding LS1B:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:112:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;above_LS1B_mask           =  x ^  -x;&amp;lt;br/&amp;gt;below_LSB1_mask_including =  x ^ (x-1);&amp;lt;br/&amp;gt;below_LSB1_mask           = ~x &amp;amp;amp; (x-1);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;above_LS1B_mask           &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;x&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
below_LSB1_mask_including &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
below_LSB1_mask           &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:112 --&gt;With some arbitrary sample set:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:113:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;      x          ^        -x         =   above_LS1B_mask&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . 1 . 1 . . .     1 1 . 1 . 1 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. 1 . . . 1 . .     1 . 1 1 1 . 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. 1 . . . 1 . .  ^  1 . 1 1 1 . 1 1  =  1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . 1 . 1 . . .     . . 1 1 . 1 1 1     . . . 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;      x          ^      (x-1)        =  below_LSB1_mask_including&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . 1 . 1 . . .     . . 1 . 1 . . .     . . . . . . . .&amp;lt;br/&amp;gt;. 1 . . . 1 . .     . 1 . . . 1 . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. 1 . . . 1 . .  ^  . 1 . . . 1 . .  =  . . . . . . . .&amp;lt;br/&amp;gt;. . 1 . 1 . . .     1 1 . . 1 . . .     1 1 1 . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;     ~x          &amp;amp;amp;      (x-1)        =  below_LSB1_mask&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 1     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;1 1 . 1 . 1 1 1     . . 1 . 1 . . .     . . . . . . . .&amp;lt;br/&amp;gt;1 . 1 1 1 . 1 1     . 1 . . . 1 . .     . . . . . . . .&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 1     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;1 . 1 1 1 . 1 1  &amp;amp;amp;  . 1 . . . 1 . .  =  . . . . . . . .&amp;lt;br/&amp;gt;1 1 . 1 . 1 1 1     1 1 . . 1 . . .     1 1 . . . . . .&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;      x          &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;        &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;x         &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;   above_LS1B_mask
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . . . . . . .     . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .     . . . . . . . .
&amp;nbsp;
      &lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;          &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;        &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  below_LSB1_mask_including
. . . . . . . .     . . . . . . . .     . . . . . . . .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . . . . . . .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . . . . . . . .
. . . . . . . .     . . . . . . . .     . . . . . . . .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;  . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  . . . . . . . .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . .
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&amp;nbsp;
     ~x          &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;        &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  below_LSB1_mask
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .     . . . . . . . .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . . . . . . .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . . . . . . . .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . . . . . . .     . . . . . . . .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;  . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  . . . . . . . .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . .
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:113 --&gt;&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; expansion &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt; has &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1#BLSMSK&quot;&gt;BLSMSK&lt;/a&gt; (Mask Up to Lowest Set Bit = below_LSB1_mask_including), &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; expansion &lt;a class=&quot;wiki_link&quot; href=&quot;/TBM&quot;&gt;TBM&lt;/a&gt; has &lt;a class=&quot;wiki_link&quot; href=&quot;/TBM#TZMSK&quot;&gt;TZMSK&lt;/a&gt; (Mask From Trailing Zeros = below_LSB1_mask):&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:114:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;blsmsk rax, rbx ; BMI1:  rax =  rbx ^ (rbx - 1)&amp;lt;br/&amp;gt;tzmsk  rax, rbx ; TBM:   rax = ~rbx &amp;amp;amp; (rbx - 1)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;blsmsk rax, rbx ; BMI1:  rax =  rbx ^ (rbx - 1)
tzmsk  rax, rbx ; TBM:   rax = ~rbx &amp;amp; (rbx - 1)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:114 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt;-intrinsic &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://software.intel.com/en-us/node/514041&quot; rel=&quot;nofollow&quot;&gt;_blsmsk_u32/64&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:306:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc30&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Least Significant One-Smearing&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:306 --&gt;Smearing&lt;/h3&gt;
 To smear the LS1B up and down, we use the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; with two&#039;s complement or ones&#039; decrement:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:115:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;smearsLS1BUp   = x |  -x;&amp;lt;br/&amp;gt;smearsLS1BDown = x | (x-1);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;smearsLS1BUp   &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;  &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;x&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
smearsLS1BDown &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:115 --&gt;With some arbitrary sample set:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:116:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;      x          |        -x         =  smearsLS1BUp&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . 1 . 1 . . .     1 1 . 1 . 1 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. 1 . . . 1 . .     1 . 1 1 1 . 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. 1 . . . 1 . .  |  1 . 1 1 1 . 1 1  =  1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . 1 . 1 . . .     . . 1 1 . 1 1 1     . . 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;      x          |      (x-1)        =  smearsLS1BDown&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . 1 . 1 . . .     . . 1 . 1 . . .     . . 1 . 1 . . .&amp;lt;br/&amp;gt;. 1 . . . 1 . .     . 1 . . . 1 . .     . 1 . . . 1 . .&amp;lt;br/&amp;gt;. . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. 1 . . . 1 . .  |  . 1 . . . 1 . .  =  . 1 . . . 1 . .&amp;lt;br/&amp;gt;. . 1 . 1 . . .     1 1 . . 1 . . .     1 1 1 . 1 . . .&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;      x          &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;        &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;x         &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  smearsLS1BUp
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . . . . . . .     . . . . . . . .     . . . . . . . .
. . . . . . . .     . . . . . . . .     . . . . . . . .
&amp;nbsp;
      &lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;          &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;        &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  smearsLS1BDown
. . . . . . . .     . . . . . . . .     . . . . . . . .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . . . . . . .     . . . . . . . .     . . . . . . . .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;  . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:116 --&gt;&lt;strong&gt;x86-mnemonics&lt;/strong&gt; &lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; expansion &lt;a class=&quot;wiki_link&quot; href=&quot;/TBM&quot;&gt;TBM&lt;/a&gt; has a &lt;a class=&quot;wiki_link&quot; href=&quot;/TBM#BLSFILL&quot;&gt;Fill From Lowest Set Bit&lt;/a&gt; instruction:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:117:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;blsfill  rax, rbx ; TBM:  rax = rbx | (rbx - 1)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;blsfill  rax, rbx ; TBM:  rax = rbx | (rbx - 1)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:117 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:451:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@TheLeastSignificantZeroBitLS0B&amp;quot; title=&amp;quot;Anchor: TheLeastSignificantZeroBitLS0B&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;TheLeastSignificantZeroBitLS0B&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:451 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:308:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc31&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Least Significant Zero&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:308 --&gt;Least Significant Zero&lt;/h2&gt;
Dealing with the least significant zero bit (LS0B) or clear bit can be derived from the complement of the LS1B. &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; expansion &lt;a class=&quot;wiki_link&quot; href=&quot;/TBM&quot;&gt;TBM&lt;/a&gt; has six instructions based on boolean operations with the one&#039;s increment:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/TBM#BLCI&quot;&gt;Isolate Lowest Clear Bit&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; with the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;complement&lt;/a&gt; of the increment&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/TBM#BLCIC&quot;&gt;Isolate Lowest Clear Bit and Complement&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; of the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;complement&lt;/a&gt; with the increment&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/TBM#BLCFILL&quot;&gt;Fill From Lowest Clear Bit&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; with the increment&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/TBM#BLCMSK&quot;&gt;Mask From Lowest Clear Bit&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ExclusiveOr&quot;&gt;exclusive or&lt;/a&gt; with the increment&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/TBM#BLCS&quot;&gt;Set Lowest Clear Bit&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; with the increment&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/TBM#T1MSKC&quot;&gt;Inverse Mask From Trailing Ones&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;complement&lt;/a&gt; and increment&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextAnchorRule:452:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@TheMostSignificantOneBitMS1B&amp;quot; title=&amp;quot;Anchor: TheMostSignificantOneBitMS1B&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;TheMostSignificantOneBitMS1B&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:452 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:310:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc32&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Most Significant One&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:310 --&gt;Most Significant One&lt;/h2&gt;
 The MS1B is not that simple to isolate as long we have no reverse arithmetic with carries propagating from left to right. To isolate MS1B, one needs to set all lower bits below MS1B, shift the resulting mask right by one and finally add one.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:453:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@parallelPrefixMSB&amp;quot; title=&amp;quot;Anchor: parallelPrefixMSB&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;parallelPrefixMSB&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:453 --&gt;&lt;br /&gt;
Setting all lower bits in the general case requires 63 times x |= x &amp;gt;&amp;gt; 1 which might be done in &lt;a class=&quot;wiki_link&quot; href=&quot;/Parallel%20Prefix%20Algorithms&quot;&gt;parallel prefix&lt;/a&gt; manner in log2(64) = 6 steps:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:118:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x |= x &amp;amp;gt;&amp;amp;gt; 32;&amp;lt;br/&amp;gt;x |= x &amp;amp;gt;&amp;amp;gt; 16;&amp;lt;br/&amp;gt;x |= x &amp;amp;gt;&amp;amp;gt;  8;&amp;lt;br/&amp;gt;x |= x &amp;amp;gt;&amp;amp;gt;  4;&amp;lt;br/&amp;gt;x |= x &amp;amp;gt;&amp;amp;gt;  2;&amp;lt;br/&amp;gt;x |= x &amp;amp;gt;&amp;amp;gt;  1;&amp;lt;br/&amp;gt;MS1B = (x &amp;amp;gt;&amp;amp;gt; 1) + 1;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
MS1B &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:118 --&gt;Still quite expensive - better to traverse sets the other way around or rely on intrinsic functions to use special processor instructions like &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#Bitscanreverse&quot;&gt;BitScanReverse&lt;/a&gt; or LeadingZeroCount, which implicitly performs not only the isolation but also the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Binary_logarithm&quot; rel=&quot;nofollow&quot;&gt;log2&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Common MS1B&lt;/strong&gt; &lt;br /&gt;
Two sets have a common MS1B, if the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; is greater than the xor sum:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:119:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;if ((a &amp;amp;amp; b) &amp;amp;gt; (a ^ b)) -&amp;amp;gt; a and b have common MS1B&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; a and b have common MS1B&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:119 --&gt;This is because a common MS1B is set in the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; but cleared in the xor sum. Otherwise, with no common MS1B, the xor-sum is greater except equal for two zero operands.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:454:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Multiplication&amp;quot; title=&amp;quot;Anchor: Multiplication&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Multiplication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:454 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:312:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc33&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Multiplication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:312 --&gt;Multiplication&lt;/h2&gt;
 64-bit &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Multiplication&quot; rel=&quot;nofollow&quot;&gt;Multiplication&lt;/a&gt; has become awfully fast on recent processors. Shift left is of course still faster than multiplication by power of two, but if we have more than one bit set in a factor, it already makes sense to replace for instance&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:120:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;y  = (x &amp;amp;lt;&amp;amp;lt; 8) + (x &amp;amp;lt;&amp;amp;lt; 16);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;y  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:120 --&gt;by&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:121:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;y  = x * 0x00010100;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;y  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00010100&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:121 --&gt;&lt;strong&gt;Fill-Multiplication&lt;/strong&gt; &lt;br /&gt;
In fact, we can replace &lt;a class=&quot;wiki_link&quot; href=&quot;/Parallel%20Prefix%20Algorithms&quot;&gt;parallel prefix&lt;/a&gt; left shifts like,&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:122:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x |= x &amp;amp;lt;&amp;amp;lt; 32;&amp;lt;br/&amp;gt;x |= x &amp;amp;lt;&amp;amp;lt; 16;&amp;lt;br/&amp;gt;x |= x &amp;amp;lt;&amp;amp;lt;  8;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
x &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:122 --&gt;where x has max one bit per file, and we can therefor safely replace &#039;or&#039; by &#039;add&#039;&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:123:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;x += x &amp;amp;lt;&amp;amp;lt; 32;&amp;lt;br/&amp;gt;x += x &amp;amp;lt;&amp;amp;lt; 16;&amp;lt;br/&amp;gt;x += x &amp;amp;lt;&amp;amp;lt;  8;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:123 --&gt;by multiplication with 0x0101010101010101 (which is the A-File in little endian mapping):&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:124:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;. . . . . . . .     1 . . . . . . .     . 1 1 . 1 1 . .&amp;lt;br/&amp;gt;. . . . . . . .     1 . . . . . . .     . 1 1 . 1 1 . .&amp;lt;br/&amp;gt;. . . . . . . .     1 . . . . . . .     . 1 1 . 1 1 . .&amp;lt;br/&amp;gt;. . . . . . . .     1 . . . . . . .     . 1 1 . 1 1 . .&amp;lt;br/&amp;gt;. 1 . . . 1 . .  *  1 . . . . . . .  =  . 1 1 . 1 1 . .&amp;lt;br/&amp;gt;. . 1 . 1 . . .     1 . . . . . . .     . . 1 . 1 . . .&amp;lt;br/&amp;gt;. . . . . . . .     1 . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .     1 . . . . . . .     . . . . . . . .&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .     . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .  &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . .
. . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .     . . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . .
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .     . . . . . . . .
. . . . . . . .     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; . . . . . . .     . . . . . . . .&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:124 --&gt;See &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;Kindergarten-Bitboards&lt;/a&gt;- or &lt;a class=&quot;wiki_link&quot; href=&quot;/Magic%20Bitboards&quot;&gt;Magic-Bitboards&lt;/a&gt; as applications of fill-multiplication.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;De Bruijn Multiplication&lt;/strong&gt; &lt;br /&gt;
Another bitboard related application of multiplication is to determine the bit-index of the least significant one bit. A isolated, single bit is multiplied with a &lt;a class=&quot;wiki_link&quot; href=&quot;/De%20Bruijn%20sequence&quot;&gt;De Bruijn sequence&lt;/a&gt; to implement a &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitscan#DeBruijnMultiplation&quot;&gt;bitscan&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:455:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Division&amp;quot; title=&amp;quot;Anchor: Division&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Division&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:455 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:314:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc34&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Division&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:314 --&gt;Division&lt;/h2&gt;
 64-bit &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Division_%28mathematics%29&quot; rel=&quot;nofollow&quot;&gt;Division&lt;/a&gt; is still a slow instruction which takes a lot of cycles - it should be avoided at runtime. Division by a power of two is done by right shift.&lt;br /&gt;
&lt;br /&gt;
An interesting application to calculate various masks for &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#DeltaSwap&quot;&gt;delta swaps&lt;/a&gt;, e.g. swapping &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit&quot;&gt;bits&lt;/a&gt;, bit-duos, &lt;a class=&quot;wiki_link&quot; href=&quot;/Nibble&quot;&gt;nibbles&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;bytes&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;words&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;double words&lt;/a&gt;, is the 2-&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/P-adic_number&quot; rel=&quot;nofollow&quot;&gt;adic&lt;/a&gt; division of the universal set (-1) by 2^(2^i) plus one, which may be done at compile time:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:125:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;-1 / ( 2^(2^0) + 1) == -1 / (         2 + 1) == 0x5555555555555555&amp;lt;br/&amp;gt;-1 / ( 2^(2^1) + 1) == -1 / (         4 + 1) == 0x3333333333333333&amp;lt;br/&amp;gt;-1 / ( 2^(2^2) + 1) == -1 / (        16 + 1) == 0x0f0f0f0f0f0f0f0f&amp;lt;br/&amp;gt;-1 / ( 2^(2^3) + 1) == -1 / (       256 + 1) == 0x00ff00ff00ff00ff&amp;lt;br/&amp;gt;-1 / ( 2^(2^4) + 1) == -1 / (     65536 + 1) == 0x0000ffff0000ffff&amp;lt;br/&amp;gt;-1 / ( 2^(2^5) + 1) == -1 / (4294967296 + 1) == 0x00000000ffffffff&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;-1 / ( 2^(2^0) + 1) == -1 / (         2 + 1) == 0x5555555555555555
-1 / ( 2^(2^1) + 1) == -1 / (         4 + 1) == 0x3333333333333333
-1 / ( 2^(2^2) + 1) == -1 / (        16 + 1) == 0x0f0f0f0f0f0f0f0f
-1 / ( 2^(2^3) + 1) == -1 / (       256 + 1) == 0x00ff00ff00ff00ff
-1 / ( 2^(2^4) + 1) == -1 / (     65536 + 1) == 0x0000ffff0000ffff
-1 / ( 2^(2^5) + 1) == -1 / (4294967296 + 1) == 0x00000000ffffffff&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:125 --&gt;See &lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating#Generalized&quot;&gt;generalized flipping, mirroring and reversion&lt;/a&gt;. Often used masks and factors are the 2-adic division of the universal set (-1) by 2^(2^i) minus one, which results in the lowest bit of &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques#SWAR&quot;&gt;SWAR-wise&lt;/a&gt; bits set, bit-duos, nibbles, bytes, words and double words:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:126:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;-1 / ( 2^(2^0) - 1) == -1 / (         2 - 1) == 0xffffffffffffffff&amp;lt;br/&amp;gt;-1 / ( 2^(2^1) - 1) == -1 / (         4 - 1) == 0x5555555555555555&amp;lt;br/&amp;gt;-1 / ( 2^(2^2) - 1) == -1 / (        16 - 1) == 0x1111111111111111&amp;lt;br/&amp;gt;-1 / ( 2^(2^3) - 1) == -1 / (       256 - 1) == 0x0101010101010101&amp;lt;br/&amp;gt;-1 / ( 2^(2^4) - 1) == -1 / (     65536 - 1) == 0x0001000100010001&amp;lt;br/&amp;gt;-1 / ( 2^(2^5) - 1) == -1 / (4294967296 - 1) == 0x0000000100000001&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;-1 / ( 2^(2^0) - 1) == -1 / (         2 - 1) == 0xffffffffffffffff
-1 / ( 2^(2^1) - 1) == -1 / (         4 - 1) == 0x5555555555555555
-1 / ( 2^(2^2) - 1) == -1 / (        16 - 1) == 0x1111111111111111
-1 / ( 2^(2^3) - 1) == -1 / (       256 - 1) == 0x0101010101010101
-1 / ( 2^(2^4) - 1) == -1 / (     65536 - 1) == 0x0001000100010001
-1 / ( 2^(2^5) - 1) == -1 / (4294967296 - 1) == 0x0000000100000001&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:126 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:456:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Modulo&amp;quot; title=&amp;quot;Anchor: Modulo&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Modulo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:456 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:316:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc35&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Modulo&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:316 --&gt;Modulo&lt;/h2&gt;
 &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Modular_arithmetic&quot; rel=&quot;nofollow&quot;&gt;Modular arithmetic&lt;/a&gt; with 64-bit &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Modulo_operation&quot; rel=&quot;nofollow&quot;&gt;modulo&lt;/a&gt; by a constant, has applications in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Cryptography&quot; rel=&quot;nofollow&quot;&gt;Cryptography&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:241:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Modular_exponentiation&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Modular exponentiation from Wikipedia&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-14&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-14&quot;&gt;[14]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:241 --&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Hash%20Table&quot;&gt;Hashing&lt;/a&gt;, and with Bitboards in &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan#BitscanByModulo&quot;&gt;Bit Scanning&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#Castingout&quot;&gt;Population Count&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Congruent%20Modulo%20Bitboards&quot;&gt;Congruent Modulo Bitboards&lt;/a&gt; for &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:457:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Castingout255&amp;quot; title=&amp;quot;Anchor: Castingout255&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Castingout255&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:457 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:318:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc36&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Modulo-Casting out 255&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:318 --&gt;Casting out 255&lt;/h3&gt;
Similar to &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Casting_out_nines&quot; rel=&quot;nofollow&quot;&gt;Casting out nines&lt;/a&gt; with decimals and due to the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Congruence_relation&quot; rel=&quot;nofollow&quot;&gt;congruence relation&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:147:
[[math]]&amp;lt;br/&amp;gt;
{Base^n} \equiv 1 \pmod{Base-1}&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;{Base^n} \equiv 1 \pmod{Base-1}&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:147 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
casting out 255 can be used to add all the eight bytes within a &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques#SWAR&quot;&gt;SWAR-wise&lt;/a&gt; 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;quad word&lt;/a&gt; if the sum is less than 255, as mentioned, applicable in &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#Castingout&quot;&gt;Population Count&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Congruent%20Modulo%20Bitboards#Castingout255&quot;&gt;Congruent Modulo Bitboards - Casting out 255&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:458:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@ReciprocalMultiplication&amp;quot; title=&amp;quot;Anchor: ReciprocalMultiplication&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;ReciprocalMultiplication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:458 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:320:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc37&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Modulo-Reciprocal Multiplication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:320 --&gt;Reciprocal Multiplication&lt;/h3&gt;
Likely 64-bit compiler will optimize modulo (and division) by reciprocal, 2^64 div constant, to perform a 64*64 = 128bit fixed point multiplication to get the quotient in the upper 64-bit, and a second multiplication and subtraction to finally get the remainder. Here some sample &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; assembly:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:127:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;r11d := r10 % 257&amp;lt;br/&amp;gt; mov    r11d, r10 ; masked diagonal&amp;lt;br/&amp;gt; mov    rax, ff00ff00ff00ff01H ; 2^(64+8) / 257&amp;lt;br/&amp;gt; mul    r10&amp;lt;br/&amp;gt; shr    rdx, 8&amp;lt;br/&amp;gt; imul   edx, 257 ; 00000101H&amp;lt;br/&amp;gt; sub    r11d, edx&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;r11d := r10 % 257
 mov    r11d, r10 ; masked diagonal
 mov    rax, ff00ff00ff00ff01H ; 2^(64+8) / 257
 mul    r10
 shr    rdx, 8
 imul   edx, 257 ; 00000101H
 sub    r11d, edx&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:127 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:322:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc38&quot;&gt;&lt;a name=&quot;Arithmetic Operations-Modulo-Power of Two&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:322 --&gt;Power of Two&lt;/h3&gt;
 As a remainder, and to close the cycle to &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Bitwisebooleanoperations&quot;&gt;bitwise boolean operations&lt;/a&gt;, the well known trick is mentioned, to replace modulo by power of two by &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;intersection&lt;/a&gt; with power of two minus one:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:128:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt; a % 2^n == a &amp;amp;amp; (2^n - 1)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt; a % 2^n == a &amp;amp; (2^n - 1)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:128 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:324:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc39&quot;&gt;&lt;a name=&quot;Selected Publications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:324 --&gt;Selected Publications&lt;/h1&gt;
&lt;!-- ws:start:WikiTextHeadingRule:326:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc40&quot;&gt;&lt;a name=&quot;Selected Publications-1847 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:326 --&gt;1847 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#Boole&quot;&gt;George Boole&lt;/a&gt; (&lt;strong&gt;1847&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://archive.org/stream/mathematicalanal00booluoft/mathematicalanal00booluoft_djvu.txt&quot; rel=&quot;nofollow&quot;&gt;The Mathematical Analysis of Logic, Being an Essay towards a Calculus of Deductive Reasoning&lt;/a&gt;&lt;/em&gt;. Macmillan, Barclay &amp;amp; Macmillan&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#Boole&quot;&gt;George Boole&lt;/a&gt; (&lt;strong&gt;1848&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.maths.tcd.ie/pub/HistMath/People/Boole/CalcLogic/&quot; rel=&quot;nofollow&quot;&gt;The Calculus of Logic&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/The_Quarterly_Journal_of_Pure_and_Applied_Mathematics&quot; rel=&quot;nofollow&quot;&gt;Cambridge and Dublin Mathematical Journal&lt;/a&gt;, Vol. III&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#ADeMorgan&quot;&gt;Augustus De Morgan&lt;/a&gt; (&lt;strong&gt;1860&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://books.google.com/books?id=Od3jgF5rZtgC&quot; rel=&quot;nofollow&quot;&gt;Syllabus of a Proposed System of Logic&lt;/a&gt;&lt;/em&gt;. Walton &amp;amp; Malbery&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#CSPeirce&quot;&gt;Charles S. Peirce&lt;/a&gt; (&lt;strong&gt;1867&lt;/strong&gt;). &lt;em&gt;On an Improvement in Boole&#039;s Calculus of Logic&lt;/em&gt;. Proceedings of the American Academy of Arts and Sciences, Series Vol. 7&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#Cantor&quot;&gt;Georg Cantor&lt;/a&gt; (&lt;strong&gt;1874&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://glossar.hs-augsburg.de/Cantor,_G._(1874):_Ueber_eine_Eigenschaft_des_Inbegriffs_aller_reellen_algebraischen_Zahlen&quot; rel=&quot;nofollow&quot;&gt;Ueber eine Eigenschaft des Inbegriffes aller reellen algebraischen Zahlen&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Crelle%27s_Journal&quot; rel=&quot;nofollow&quot;&gt;Journal für die reine und angewandte Mathematik&lt;/a&gt;, No. 77&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#CSPeirce&quot;&gt;Charles S. Peirce&lt;/a&gt; (&lt;strong&gt;1880&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://archive.org/details/jstor-2369442&quot; rel=&quot;nofollow&quot;&gt;On the Algebra of Logic&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/American_Journal_of_Mathematics&quot; rel=&quot;nofollow&quot;&gt;American Journal of Mathematics&lt;/a&gt;, Vol. 3&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#CSPeirce&quot;&gt;Charles S. Peirce&lt;/a&gt; (&lt;strong&gt;1880&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://archive.org/details/jstor-2369442&quot; rel=&quot;nofollow&quot;&gt;On the Algebra of Logic&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/American_Journal_of_Mathematics&quot; rel=&quot;nofollow&quot;&gt;American Journal of Mathematics&lt;/a&gt;, Vol. 3&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#Venn&quot;&gt;John Venn&lt;/a&gt; (&lt;strong&gt;1880&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.tandfonline.com/doi/abs/10.1080/14786448008626877#.U3kRnHYfwgI&quot; rel=&quot;nofollow&quot;&gt;On the Diagrammatic and Mechanical Representation of Propositions and Reasonings&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Philosophical_Magazine&quot; rel=&quot;nofollow&quot;&gt;Philosophical Magazine&lt;/a&gt;, Vol. 9, No. 5&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#Venn&quot;&gt;John Venn&lt;/a&gt; (&lt;strong&gt;1881&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://archive.org/details/symboliclogic00venniala&quot; rel=&quot;nofollow&quot;&gt;Symbolic Logic&lt;/a&gt;&lt;/em&gt;. MacMillan &amp;amp; Co.&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:328:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc41&quot;&gt;&lt;a name=&quot;Selected Publications-1950 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:328 --&gt;1950 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Lazar_Lyusternik&quot; rel=&quot;nofollow&quot;&gt;Lazar A. Lyusternik&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.mathnet.ru/php/person.phtml?personid=30351&amp;amp;option_lang=eng&quot; rel=&quot;nofollow&quot;&gt;Aleksandr A. Abramov&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Victor_Shestakov&quot; rel=&quot;nofollow&quot;&gt;Victor I. Shestakov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Mikhail%20R.%20Shura-Bura&quot;&gt;Mikhail R. Shura-Bura&lt;/a&gt; (&lt;strong&gt;1952&lt;/strong&gt;). &lt;em&gt;Programming for High-Speed Electronic Computers&lt;/em&gt;. (Программирование для электронных счетных машин)&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Christopher%20Strachey&quot;&gt;Christopher Strachey&lt;/a&gt; (&lt;strong&gt;1961&lt;/strong&gt;). &lt;em&gt;Bitwise operations&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/ACM#Communications&quot;&gt;Communications of the ACM&lt;/a&gt;, Vol. 4, No. 3&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:330:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc42&quot;&gt;&lt;a name=&quot;Selected Publications-2000 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:330 --&gt;2000 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Henry%20S.%20Warren%2C%20Jr.&quot;&gt;Henry S. Warren, Jr.&lt;/a&gt; (&lt;strong&gt;2002, 2012&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Henry%20S.%20Warren%2C%20Jr.#HackersDelight&quot;&gt;Hacker&#039;s Delight&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Addison%E2%80%93Wesley&quot; rel=&quot;nofollow&quot;&gt;Addison-Wesley&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Donald Knuth&lt;/a&gt; (&lt;strong&gt;2009&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html&quot; rel=&quot;nofollow&quot;&gt;The Art of Computer Programming&lt;/a&gt;, Volume 4, Fascicle 1: Bitwise tricks &amp;amp; techniques&lt;/em&gt;, as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/fasc1a.ps.gz&quot; rel=&quot;nofollow&quot;&gt;Pre-Fascicle 1a postscript&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:332:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc43&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:332 --&gt;Forum Posts&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=306882&quot; rel=&quot;nofollow&quot;&gt;curiosity killed the cat... hi/lo bit C verses Assembly&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Dann%20Corbit&quot;&gt;Dann Corbit&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, July 17, 2003&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=450730&quot; rel=&quot;nofollow&quot;&gt;mask of highest bit&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Andrew%20Shapira&quot;&gt;Andrew Shapira&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 21, 2005&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=47710&quot; rel=&quot;nofollow&quot;&gt;How to Shift Left (by) a Negative Number??&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Steve%20Maughan&quot;&gt;Steve Maughan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 05, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-chess.org/viewtopic.php?f=5&amp;amp;t=2878&quot; rel=&quot;nofollow&quot;&gt;To shift or not to shift&lt;/a&gt; by thevinenator, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;OpenChess Forum&lt;/a&gt;, September 09, 2015&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:334:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc44&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:334 --&gt;External Links&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:336:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc45&quot;&gt;&lt;a name=&quot;External Links-Sets&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:336 --&gt;Sets&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Set_%28mathematics%29&quot; rel=&quot;nofollow&quot;&gt;Set (mathematics) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Portal:Set_theory&quot; rel=&quot;nofollow&quot;&gt;Portal:Set theory from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Finite_set&quot; rel=&quot;nofollow&quot;&gt;Finite set from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Fuzzy_set&quot; rel=&quot;nofollow&quot;&gt;Fuzzy set from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Set_theory&quot; rel=&quot;nofollow&quot;&gt;Set theory from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Naive_set_theory&quot; rel=&quot;nofollow&quot;&gt;Naive set theory from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Zermelo%E2%80%93Fraenkel_set_theory&quot; rel=&quot;nofollow&quot;&gt;Zermelo–Fraenkel set theory from Wikipedia&lt;/a&gt; » &lt;a class=&quot;wiki_link&quot; href=&quot;/Ernst%20Zermelo&quot;&gt;Ernst Zermelo&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#AbrahamFraenkel&quot;&gt;Abraham Fraenkel&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://plato.stanford.edu/entries/set-theory/&quot; rel=&quot;nofollow&quot;&gt;Set Theory (Stanford Encyclopedia of Philosophy)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Venn_diagram&quot; rel=&quot;nofollow&quot;&gt;Venn diagram from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:338:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc46&quot;&gt;&lt;a name=&quot;External Links-Algebra&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:338 --&gt;Algebra&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Algebra&quot; rel=&quot;nofollow&quot;&gt;Algebra from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Elementary_algebra&quot; rel=&quot;nofollow&quot;&gt;Elementary algebra from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Abstract_algebra&quot; rel=&quot;nofollow&quot;&gt;Abstract algebra from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Algebraic_structure&quot; rel=&quot;nofollow&quot;&gt;Algebraic structure from Wikipedia&lt;/a&gt; (&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Model_theory&quot; rel=&quot;nofollow&quot;&gt;Model theory&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Algebra_of_sets&quot; rel=&quot;nofollow&quot;&gt;Algebra of sets from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_algebra&quot; rel=&quot;nofollow&quot;&gt;Boolean algebra from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_algebra_%28logic%29&quot; rel=&quot;nofollow&quot;&gt;Boolean algebra (logic) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_algebra_%28structure%29&quot; rel=&quot;nofollow&quot;&gt;Boolean algebra (structure) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_algebras_canonically_defined&quot; rel=&quot;nofollow&quot;&gt;Boolean algebras canonically defined from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Boolean_ring&quot; rel=&quot;nofollow&quot;&gt;Boolean ring from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Finite_field&quot; rel=&quot;nofollow&quot;&gt;Finite field from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/GF%282%29&quot; rel=&quot;nofollow&quot;&gt;GF(2) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://plato.stanford.edu/entries/boolalg-math/&quot; rel=&quot;nofollow&quot;&gt;The Mathematics of Boolean Algebra (Stanford Encyclopedia of Philosophy)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:340:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc47&quot;&gt;&lt;a name=&quot;External Links-Logic&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:340 --&gt;Logic&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logic&quot; rel=&quot;nofollow&quot;&gt;Logic from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Portal:Logic&quot; rel=&quot;nofollow&quot;&gt;Portal:Logic from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Mathematical_logic&quot; rel=&quot;nofollow&quot;&gt;Mathematical logic from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Algebraic_logic&quot; rel=&quot;nofollow&quot;&gt;Algebraic logic from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Propositional_calculus&quot; rel=&quot;nofollow&quot;&gt;Propositional calculus from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Predicate_logic&quot; rel=&quot;nofollow&quot;&gt;Predicate logic from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Entailment&quot; rel=&quot;nofollow&quot;&gt;Entailment from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Syllogism&quot; rel=&quot;nofollow&quot;&gt;Syllogism from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_connective&quot; rel=&quot;nofollow&quot;&gt;Logical connective from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:342:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc48&quot;&gt;&lt;a name=&quot;External Links-Operations&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:342 --&gt;Operations&lt;/h2&gt;
&lt;!-- ws:start:WikiTextHeadingRule:344:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc49&quot;&gt;&lt;a name=&quot;External Links-Operations-Setwise&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:344 --&gt;Setwise&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Set_%28mathematics%29#Basic_operations&quot; rel=&quot;nofollow&quot;&gt;Set (mathematics) - Basic operations from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intersection_%28set_theory%29&quot; rel=&quot;nofollow&quot;&gt;Intersection (set theory) from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Union_%28set_theory%29&quot; rel=&quot;nofollow&quot;&gt;Union (set theory) from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Complement_%28set_theory%29&quot; rel=&quot;nofollow&quot;&gt;Complement (set theory) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:346:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc50&quot;&gt;&lt;a name=&quot;External Links-Operations-Bitwise&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:346 --&gt;Bitwise&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bitwise_operation&quot; rel=&quot;nofollow&quot;&gt;Bitwise operation from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_conjunction&quot; rel=&quot;nofollow&quot;&gt;Logical conjunction from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Logical_disjunction&quot; rel=&quot;nofollow&quot;&gt;Logical disjunction from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Exclusive_or&quot; rel=&quot;nofollow&quot;&gt;Exclusive or from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Negation&quot; rel=&quot;nofollow&quot;&gt;Negation from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts&quot; rel=&quot;nofollow&quot;&gt;Bit Shifts from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Circular_shift&quot; rel=&quot;nofollow&quot;&gt;Circular shift from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:348:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc51&quot;&gt;&lt;a name=&quot;External Links-Operations-Arithmetic&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:348 --&gt;Arithmetic&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Arithmetic#Arithmetic_operations&quot; rel=&quot;nofollow&quot;&gt;Arithmetic operations from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Addition&quot; rel=&quot;nofollow&quot;&gt;Addition from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Subtraction&quot; rel=&quot;nofollow&quot;&gt;Subtraction from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Two%27s_complement&quot; rel=&quot;nofollow&quot;&gt;Two&#039;s complement from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Multiplication&quot; rel=&quot;nofollow&quot;&gt;Multiplication from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Division_%28mathematics%29&quot; rel=&quot;nofollow&quot;&gt;Division from Wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Modulo_operation&quot; rel=&quot;nofollow&quot;&gt;Modulo operation from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:350:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc52&quot;&gt;&lt;a name=&quot;External Links-Operations-Modular arithmetic&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:350 --&gt;Modular arithmetic&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Congruence_relation&quot; rel=&quot;nofollow&quot;&gt;Congruence relation from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Modular_arithmetic&quot; rel=&quot;nofollow&quot;&gt;Modular arithmetic from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Linear_congruence_theorem&quot; rel=&quot;nofollow&quot;&gt;Linear congruence theorem from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:352:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc53&quot;&gt;&lt;a name=&quot;External Links-Misc&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:352 --&gt;Misc&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#Casiopea&quot;&gt;Casiopea&lt;/a&gt; - Conjunction, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Casiopea_Perfect_Live_II&quot; rel=&quot;nofollow&quot;&gt;Perfect Live&lt;/a&gt; (1986), &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:242:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/custom/24036556?h=0&amp;amp;w=0&amp;quot; class=&amp;quot;WikiMedia WikiMediaCustom&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;custom&amp;amp;quot; key=&amp;amp;quot;24036556&amp;amp;quot;&amp;quot; title=&amp;quot;Custom Media&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;480&quot; height=&quot;360&quot; src=&quot;//www.youtube.com/embed/zdU2KCDYROU?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:242 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#HuxFlux&quot;&gt;Hux Flux&lt;/a&gt; - Bitshifter, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Division_by_Zero_%28album%29&quot; rel=&quot;nofollow&quot;&gt;Division by Zero&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:243:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/custom/24036546?h=0&amp;amp;w=0&amp;quot; class=&amp;quot;WikiMedia WikiMediaCustom&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;custom&amp;amp;quot; key=&amp;amp;quot;24036546&amp;amp;quot;&amp;quot; title=&amp;quot;Custom Media&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;480&quot; height=&quot;360&quot; src=&quot;//www.youtube.com/embed/ONhwqC6_NY0?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:243 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:354:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc54&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:354 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:2726:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#Ershov&quot;&gt;Andrey Ershov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Mikhail%20R.%20Shura-Bura&quot;&gt;Mikhail R. Shura-Bura&lt;/a&gt; (&lt;strong&gt;1980&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://ershov.iis.nsk.su/archive/eaindex.asp?lang=2&amp;amp;gid=910&quot; rel=&quot;nofollow&quot;&gt;The Early Development of Programming in the USSR&lt;/a&gt;&lt;/em&gt;. in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Nicholas_C._Metropolis&quot; rel=&quot;nofollow&quot;&gt;Nicholas C. Metropolis&lt;/a&gt; (ed.) &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://dl.acm.org/citation.cfm?id=578384&quot; rel=&quot;nofollow&quot;&gt;A History of Computing in the Twentieth Century&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Academic_Press&quot; rel=&quot;nofollow&quot;&gt;Academic Press&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://ershov.iis.nsk.su/archive/eaimage.asp?did=28792&amp;amp;fileid=173670&quot; rel=&quot;nofollow&quot;&gt;preprint pp. 43&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Lazar_Lyusternik&quot; rel=&quot;nofollow&quot;&gt;Lazar A. Lyusternik&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.mathnet.ru/php/person.phtml?personid=30351&amp;amp;option_lang=eng&quot; rel=&quot;nofollow&quot;&gt;Aleksandr A. Abramov&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Victor_Shestakov&quot; rel=&quot;nofollow&quot;&gt;Victor I. Shestakov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Mikhail%20R.%20Shura-Bura&quot;&gt;Mikhail R. Shura-Bura&lt;/a&gt; (&lt;strong&gt;1952&lt;/strong&gt;). &lt;em&gt;Programming for High-Speed Electronic Computers&lt;/em&gt;. (Программирование для электронных счетных машин)&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#Venn&quot;&gt;John Venn&lt;/a&gt; (&lt;strong&gt;1880&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.tandfonline.com/doi/abs/10.1080/14786448008626877#.U3kRnHYfwgI&quot; rel=&quot;nofollow&quot;&gt;On the Diagrammatic and Mechanical Representation of Propositions and Reasonings&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Philosophical_Magazine&quot; rel=&quot;nofollow&quot;&gt;Philosophical Magazine&lt;/a&gt;, Vol. 9, No. 59&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.reisser-kunstpostkarten.de/en/index.asp?aid=3076&quot; rel=&quot;nofollow&quot;&gt;Wassily Kandinsky - Yellow Circle, 1926&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.reisser-kunstpostkarten.de/en/&quot; rel=&quot;nofollow&quot;&gt;Art-postcards and museum-shop, Reisser-Kunstpostkarten.de&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; Greater or less in the arithmetical sense is usually not relevant with bitboards, but see greater condition in &lt;a class=&quot;wiki_link&quot; href=&quot;/Thor%27s%20Hammer#MoveGeneration&quot;&gt;Thor&#039;s Hammer&#039;s move generation&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#Boole&quot;&gt;George Boole&lt;/a&gt; (&lt;strong&gt;1847&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://archive.org/stream/mathematicalanal00booluoft/mathematicalanal00booluoft_djvu.txt&quot; rel=&quot;nofollow&quot;&gt;The Mathematical Analysis of Logic, Being an Essay towards a Calculus of Deductive Reasoning&lt;/a&gt;&lt;/em&gt;. Macmillan, Barclay &amp;amp; Macmillan&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#CSPeirce&quot;&gt;Charles S. Peirce&lt;/a&gt; (&lt;strong&gt;1880&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://archive.org/details/jstor-2369442&quot; rel=&quot;nofollow&quot;&gt;On the Algebra of Logic&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/American_Journal_of_Mathematics&quot; rel=&quot;nofollow&quot;&gt;American Journal of Mathematics&lt;/a&gt;, Vol. 3&lt;/li&gt;
&lt;li id=&quot;cite_note-8&quot;&gt;&lt;a href=&quot;#cite_ref-8&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#ADeMorgan&quot;&gt;Augustus De Morgan&lt;/a&gt; (&lt;strong&gt;1860&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://books.google.com/books?id=Od3jgF5rZtgC&quot; rel=&quot;nofollow&quot;&gt;Syllabus of a Proposed System of Logic&lt;/a&gt;&lt;/em&gt;. Walton &amp;amp; Malbery&lt;/li&gt;
&lt;li id=&quot;cite_note-9&quot;&gt;&lt;a href=&quot;#cite_ref-9&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Marvin%20Minsky&quot;&gt;Marvin Minsky&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#SPapert&quot;&gt;Seymour Papert&lt;/a&gt; (1969, &lt;strong&gt;1972&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Perceptrons_%28book%29&quot; rel=&quot;nofollow&quot;&gt;Perceptrons: An Introduction to Computational Geometry&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/MIT_Press&quot; rel=&quot;nofollow&quot;&gt;The MIT Press&lt;/a&gt;, ISBN 0-262-63022-2&lt;/li&gt;
&lt;li id=&quot;cite_note-10&quot;&gt;&lt;a href=&quot;#cite_ref-10&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/d/msg/rec.games.chess.computer/o3AMPvhmY3o/1yZhMk3_VlIJ&quot; rel=&quot;nofollow&quot;&gt;Re: Java chess program?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Moritz%20Berger&quot;&gt;Moritz Berger&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;rgcc&lt;/a&gt;, May 29, 1997 » &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ShiftingBitboards&quot;&gt;Shifting Bitboards&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-11&quot;&gt;&lt;a href=&quot;#cite_ref-11&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-chess.org/viewtopic.php?f=5&amp;amp;t=2878&quot; rel=&quot;nofollow&quot;&gt;To shift or not to shift&lt;/a&gt; by thevinenator, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;OpenChess Forum&lt;/a&gt;, September 09, 2015&lt;/li&gt;
&lt;li id=&quot;cite_note-12&quot;&gt;&lt;a href=&quot;#cite_ref-12&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Donald Knuth&lt;/a&gt; (&lt;strong&gt;2009&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html&quot; rel=&quot;nofollow&quot;&gt;The Art of Computer Programming&lt;/a&gt;, Volume 4, Fascicle 1: Bitwise tricks &amp;amp; techniques&lt;/em&gt;, as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/fasc1a.ps.gz&quot; rel=&quot;nofollow&quot;&gt;Pre-Fascicle 1a postscript&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-13&quot;&gt;&lt;a href=&quot;#cite_ref-13&quot;&gt;^&lt;/a&gt;  &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#PWegner&quot;&gt;Peter Wegner&lt;/a&gt; (&lt;strong&gt;1960&lt;/strong&gt;). &lt;em&gt;A technique for counting ones in a binary computer&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Communications_of_the_ACM&quot; rel=&quot;nofollow&quot;&gt;Communications of the ACM&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informatik.uni-trier.de/~ley/db/journals/cacm/cacm3.html#Wegner60&quot; rel=&quot;nofollow&quot;&gt;Volume 3, 1960&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-14&quot;&gt;&lt;a href=&quot;#cite_ref-14&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Modular_exponentiation&quot; rel=&quot;nofollow&quot;&gt;Modular exponentiation from Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:2726 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:356:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc55&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:356 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:0130:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;General Setwise Operations&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;160&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;General Setwise Operations&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;160&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-General_Setwise_Operations includeBody-General%20Setwise%20Operations includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Aleks+Peshkov&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Aleks Peshkov&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 13, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Alen+Shapiro&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Alen Shapiro&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 3, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Algorithms&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Algorithms&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/All+Shortest+Paths&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;All Shortest Paths&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 21, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AltiVec&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AltiVec&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Andrew+Shapira&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Andrew Shapira&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Assembly&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Assembly&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Attack+Spans&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Attack Spans&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 4, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX-512&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX-512&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Backtracking&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Backtracking&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 29, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit-Twiddling&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit-Twiddling&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Board-Definition&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Board-Definition&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 23, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Serialization&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Serialization&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitfoot&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitfoot&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 8, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BitScan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BitScan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Blockage+Detection&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Blockage Detection&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Blockers+and+Beyond&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Blockers and Beyond&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 21, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Board+Representation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Board Representation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 11, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Captures&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Captures&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chess+0.5&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chess 0.5&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 20, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Classical+Approach&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Classical Approach&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Color+Flipping&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Color Flipping&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Color+of+a+Square&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Color of a Square&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 24, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Combinatorial+Logic&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Combinatorial Logic&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Congruent+Modulo+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Congruent Modulo Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Control+of+Stop+and+Telestop&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Control of Stop and Telestop&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Crafty&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Crafty&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dictionary&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dictionary&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DirGolem&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DirGolem&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double+Attack&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double Attack&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 22, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dumb7Fill&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dumb7Fill&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Duo+Trio+Quart+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Duo Trio Quart (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 18, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ferranti+Mark+1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ferranti Mark 1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fill+Algorithms&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fill Algorithms&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 6, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Flipping+Mirroring+and+Rotating&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Flipping Mirroring and Rotating&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 14, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/GiuChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;GiuChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Henry+S.+Warren%2C+Jr.&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Henry S. Warren, Jr.&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 14, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Holes&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Holes&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Horizontal+Mirroring&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Horizontal Mirroring&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 29, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Houdini&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Houdini&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 14, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hyperbola+Quintessence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hyperbola Quintessence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Incremental+Updates&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Incremental Updates&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Intersection+Squares&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Intersection Squares&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 4, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Isolated+Pawns+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Isolated Pawns (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 18, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ivan+Bratko&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ivan Bratko&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Java&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Java&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Joker+IT&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Joker IT&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Jonathan+Warkentin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Jonathan Warkentin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 29, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kim+Walisch&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kim Walisch&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kindergarten+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kindergarten Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/King+Pattern&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;King Pattern&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 15, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Knight+Pattern&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Knight Pattern&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 23, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kogge-Stone+Algorithm&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kogge-Stone Algorithm&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kurt&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kurt&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 20, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Magic+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Magic Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Make+Move&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Make Move&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mate+at+a+Glance&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mate at a Glance&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mathematician&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mathematician&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mikhail+R.+Shura-Bura&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mikhail R. Shura-Bura&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 30, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Moritz+Berger&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Moritz Berger&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Moves&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Moves&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Obstruction+Difference&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Obstruction Difference&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Occupancy&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Occupancy&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Occupancy+of+any+Line&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Occupancy of any Line&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/OliThink&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;OliThink&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Opposition&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Opposition&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 2, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Othello&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Othello&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Parallel+Prefix+Algorithms&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Parallel Prefix Algorithms&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 22, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Passed+Pawn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Passed Pawn&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 11, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Passed+Pawns+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Passed Pawns (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 23, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Attacks+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Attacks (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 4, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Islands+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Islands (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Pushes+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Pushes (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Rams+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Rams (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawns+and+Files+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawns and Files (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 16, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Piece-Sets&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Piece-Sets&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pieces+versus+Directions&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pieces versus Directions&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 6, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Population+Count&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Population Count&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Reverse+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Reverse Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rotated+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rotated Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ryan+Mack&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ryan Mack&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 18, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SBAMG&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SBAMG&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 4, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Score&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Score&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 14, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shared+Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shared Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 11, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shifted+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shifted Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 9, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Simona+Tancig&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Simona Tancig&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 7, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sloppy&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sloppy&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Space-Time+Tradeoff&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Space-Time Tradeoff&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 17, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Square+Attacked+By&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Square Attacked By&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Subtracting+a+Rook+from+a+Blocking+Piece&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Subtracting a Rook from a Blocking Piece&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/TBM&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;TBM&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 28, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Thor%27s+Hammer&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Thor&amp;#039;s Hammer&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 23, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Transposition+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Transposition Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Traversing+Subsets+of+a+Set&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Traversing Subsets of a Set&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 14, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tunguska&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tunguska&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Unmake+Move&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Unmake Move&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vertical+Flipping&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vertical Flipping&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 10, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vice&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vice&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/XOP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;XOP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Zdenek+Zdrahal&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Zdenek Zdrahal&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 4, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Zevra&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Zevra&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 12, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Zobrist+Hashing&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Zobrist Hashing&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 22, 2018&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:0130 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Hyperbola Quintessence</title>
      <link>https://chessprogramming.wikispaces.com/Hyperbola+Quintessence</link>
      <dc:creator>camleon</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Hyperbola+Quintessence</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Hyperbola+Quintessence</comments>
      <pubDate>Sat, 25 Mar 2017 14:31:28 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; * Hyperbola Quintessence&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:162:&amp;lt;a href=&amp;quot;http://www.puckergallery.com/artists/bak_chess/bak_chess_all.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Reflexion.jpg/157859941/313x258/Reflexion.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;height: 258px; width: 313px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://www.puckergallery.com/artists/bak_chess/bak_chess_all.html&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Reflexion.jpg/157859941/313x258/Reflexion.jpg&quot; alt=&quot;Reflexion.jpg&quot; title=&quot;Reflexion.jpg&quot; style=&quot;height: 258px; width: 313px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:162 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;Hyperbola Quintessence&lt;/strong&gt; applies the &lt;a class=&quot;wiki_link&quot; href=&quot;/Subtracting%20a%20rook%20from%20a%20blocking%20piece&quot;&gt;o^(o-2r)-trick&lt;/a&gt; also for vertical or diagonal &lt;a class=&quot;wiki_link&quot; href=&quot;/On%20an%20empty%20Board#NegativeRays&quot;&gt;negative Rays&lt;/a&gt; - by reversing the bit-order of up to one bit per rank or &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;byte&lt;/a&gt; with a &lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating#FlipVertically&quot;&gt;vertical flip&lt;/a&gt; aka &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;bswap&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:15:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/a3140177.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_byteswap_uint64&amp;lt;/a&amp;gt; Visual C++ Developer Center - Run-Time Library Reference&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:15 --&gt; . It is somehow a resurrection of the &lt;a class=&quot;wiki_link&quot; href=&quot;/Reverse%20Bitboards&quot;&gt;reverse bitboards&lt;/a&gt; idea of &lt;a class=&quot;wiki_link&quot; href=&quot;/Ryan%20Mack&quot;&gt;Ryan Mack&#039;s&lt;/a&gt; &lt;em&gt;Hyperbola Project&lt;/em&gt; on the fly, and was created by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;. Improvements by &lt;a class=&quot;wiki_link&quot; href=&quot;/Aleks%20Peshkov&quot;&gt;Aleks Peshkov&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:20:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;amp;p=140314&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: BitBoard Tests Magic v Non-Rotated 32 Bits v 64 Bits&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Aleks%20Peshkov&amp;quot;&amp;gt;Aleks Peshkov&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, August 25, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Timeline#2007&amp;quot;&amp;gt;2007&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:20 --&gt; made it applicable and competitive.&lt;br /&gt;
&lt;!-- ws:start:WikiTextIncludeRule:014:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/page?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; title=&amp;quot;Include page: page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a href=&quot;/Square%20Mapping%20Considerations&quot;&gt;&lt;img src=&quot;/file/view/mapping.JPG/93134172/mapping.JPG&quot; alt=&quot;mapping.JPG&quot; title=&quot;mapping.JPG&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;em&gt;Code samples and bitboard diagrams rely on &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations#LittleEndianRankFileMapping&quot;&gt;Little endian file and rank mapping&lt;/a&gt;&lt;/em&gt;.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:end:WikiTextIncludeRule:014 --&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Arts#Bak&quot;&gt;Samuel Bak&lt;/a&gt; - Reflexion, 1990 &lt;!-- ws:start:WikiTextRefRule:23:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.puckergallery.com/artists/bak_chess/bak_chess_all.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The Game of War&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.puckergallery.com/artists/bak_index/bak_publications.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Samuel Bak - represented by Pucker Gallery since 1969&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:23 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:77:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:77 --&gt;&lt;!-- ws:start:WikiTextTocRule:78: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Reverse Math&quot;&gt;Reverse Math&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:78 --&gt;&lt;!-- ws:start:WikiTextTocRule:79: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Source Code&quot;&gt;Source Code&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:79 --&gt;&lt;!-- ws:start:WikiTextTocRule:80: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Source Code-C&quot;&gt;C&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:80 --&gt;&lt;!-- ws:start:WikiTextTocRule:81: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Source Code-Generalized set-wise attacks&quot;&gt;Generalized set-wise attacks&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:81 --&gt;&lt;!-- ws:start:WikiTextTocRule:82: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Source Code-x86-64 assembly&quot;&gt;x86-64 assembly&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:82 --&gt;&lt;!-- ws:start:WikiTextTocRule:83: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Source Code-Java&quot;&gt;Java&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:83 --&gt;&lt;!-- ws:start:WikiTextTocRule:84: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#AMD&#039;s SIMD Future in 2011&quot;&gt;AMD&#039;s SIMD Future in 2011&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:84 --&gt;&lt;!-- ws:start:WikiTextTocRule:85: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:85 --&gt;&lt;!-- ws:start:WikiTextTocRule:86: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:86 --&gt;&lt;!-- ws:start:WikiTextTocRule:87: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:87 --&gt;&lt;!-- ws:start:WikiTextTocRule:88: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Hyperbola&quot;&gt;Hyperbola&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:88 --&gt;&lt;!-- ws:start:WikiTextTocRule:89: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Quintessence&quot;&gt;Quintessence&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:89 --&gt;&lt;!-- ws:start:WikiTextTocRule:90: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Misc&quot;&gt;Misc&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:90 --&gt;&lt;!-- ws:start:WikiTextTocRule:91: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:91 --&gt;&lt;!-- ws:start:WikiTextTocRule:92: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:92 --&gt;&lt;!-- ws:start:WikiTextTocRule:93: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:93 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:47:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Reverse Math&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:47 --&gt;Reverse Math&lt;/h1&gt;
 Assume following masked &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy&quot;&gt;occupancy&lt;/a&gt; on a &lt;a class=&quot;wiki_link&quot; href=&quot;/Files&quot;&gt;file&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Diagonals&quot;&gt;diagonal&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Anti-Diagonals&quot;&gt;anti-diagonal&lt;/a&gt; - for simplicity as a flat byte (in a real bitboard with masked files or diagonals you have 6..8 scratch-bits between the bits of this byte). Thus, vertical flip reverses the bits of this byte.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;o&#039; = reverse(o)&amp;lt;br/&amp;gt;r&#039; = reverse(r)&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;       normal    reversed&amp;lt;br/&amp;gt; o     11010101  10101011 o&#039; occupancy including slider&amp;lt;br/&amp;gt; r     00010000  00001000 r&#039; slider&amp;lt;br/&amp;gt; o-r   11000101  10100011 o&#039;-r&#039;  1. sub clears the slider&amp;lt;br/&amp;gt; o-2r  10110101  10011011 o&#039;-2r&#039; 2. sub borrows &amp;amp;quot;one&amp;amp;quot; from next blocker&amp;lt;br/&amp;gt;       |......|  \....../&amp;lt;br/&amp;gt;normal 10110101   \..../&amp;lt;br/&amp;gt;       11011001 &amp;amp;lt;&amp;amp;#45;-XXXX   re-reverse&amp;lt;br/&amp;gt;single&amp;lt;br/&amp;gt;xor    01101100 -&amp;amp;gt; to get the attack set&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;o&#039; = reverse(o)
r&#039; = reverse(r)
&amp;nbsp;
       normal    reversed
 o     11010101  10101011 o&#039; occupancy including slider
 r     00010000  00001000 r&#039; slider
 o-r   11000101  10100011 o&#039;-r&#039;  1. sub clears the slider
 o-2r  10110101  10011011 o&#039;-2r&#039; 2. sub borrows &amp;quot;one&amp;quot; from next blocker
       |......|  \....../
normal 10110101   \..../
       11011001 &amp;lt;--XXXX   re-reverse
single
xor    01101100 -&amp;gt; to get the attack set&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;The first subtraction of (o-2r) is done implicitly by masking off the line, removing the slider from the occupied set. The second subtraction borrows a &amp;quot;one&amp;quot; from the next nearest blocker in msb-direction, falling through all unset bits outside the line. Of course, if no blocker is available, it borrows a &amp;quot;one&amp;quot; in usual arithmetical manner from the hidden 2^N. Only the changed bits (from original o, o&#039;) are the appropriate sliding attacks, including the blocker but excluding the slider. The result finally needs to be intersected with the same line mask as previously the occupancy, to clear the wrapped borrow one bits outside the file or diagonal. The fine optimization by &lt;a class=&quot;wiki_link&quot; href=&quot;/Aleks%20Peshkov&quot;&gt;Aleks Peshkov&lt;/a&gt; covers the final &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;union&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/On%20an%20empty%20Board#PositiveRays&quot;&gt;positive&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/On%20an%20empty%20Board#NegativeRays&quot;&gt;negative ray-attacks&lt;/a&gt;. Since opposed &lt;a class=&quot;wiki_link&quot; href=&quot;/Rays#RayDirections&quot;&gt;ray-directions&lt;/a&gt; are always disjoint sets, using &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ExclusiveOr&quot;&gt;xor&lt;/a&gt; instead of &lt;em&gt;bitwise or&lt;/em&gt; safes two instructions per line-attack. That is because bit-reversal or any &lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating&quot;&gt;mirroring or flipping&lt;/a&gt; is own inverse and distributive over xor.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;reverse(a ^ b) == reverse (a) ^ reverse(b)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;reverse(a ^ b) == reverse (a) ^ reverse(b)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;thus&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;lineAttacks = o^(o-2r) ^ reverse((o&#039;-2r&#039;)^o&#039;)&amp;lt;br/&amp;gt;lineAttacks = o^(o-2r) ^ reverse( o&#039;-2r&#039;) ^ reverse(o&#039;)&amp;lt;br/&amp;gt;lineAttacks = o^(o-2r) ^ reverse( o&#039;-2r&#039;) ^ o&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;lineAttacks = o^(o-2r) ^ reverse((o&#039;-2r&#039;)^o&#039;)
lineAttacks = o^(o-2r) ^ reverse( o&#039;-2r&#039;) ^ reverse(o&#039;)
lineAttacks = o^(o-2r) ^ reverse( o&#039;-2r&#039;) ^ o&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;and finally&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;lineAttacks =   (o-2r) ^ reverse( o&#039;-2r&#039;)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;lineAttacks =   (o-2r) ^ reverse( o&#039;-2r&#039;)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;Beside shorter code this reduces register pressure - and clearly outperforms &lt;a class=&quot;wiki_link&quot; href=&quot;/Kindergarten%20Bitboards&quot;&gt;kindergarten bitboards&lt;/a&gt; - &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Instructions_Per_Cycle&quot; rel=&quot;nofollow&quot;&gt;ipc&lt;/a&gt;-wise, in code size and memory requirements.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:49:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Source Code&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:49 --&gt;Source Code&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:51:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Source Code-C&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:51 --&gt;C&lt;/h2&gt;
 The three &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;-routines only differ by the line-mask applied:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 diagonalAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   U64 forward, reverse;&amp;lt;br/&amp;gt;   forward = occ &amp;amp;amp; smsk[sq].diagonalMaskEx;&amp;lt;br/&amp;gt;   reverse  = _byteswap_uint64(forward);&amp;lt;br/&amp;gt;   forward -= smsk[sq].bitMask;&amp;lt;br/&amp;gt;   reverse -= _byteswap_uint64(smsk[sq].bitMask);&amp;lt;br/&amp;gt;   forward ^= _byteswap_uint64(reverse);&amp;lt;br/&amp;gt;   forward &amp;amp;amp;= smsk[sq].diagonalMaskEx;&amp;lt;br/&amp;gt;   return forward;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 antiDiagAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   U64 forward, reverse;&amp;lt;br/&amp;gt;   forward  = occ &amp;amp;amp; smsk[sq].antidiagMaskEx;&amp;lt;br/&amp;gt;   reverse  = _byteswap_uint64(forward);&amp;lt;br/&amp;gt;   forward -= smsk[sq].bitMask;&amp;lt;br/&amp;gt;   reverse -= _byteswap_uint64(smsk[sq].bitMask);&amp;lt;br/&amp;gt;   forward ^= _byteswap_uint64(reverse);&amp;lt;br/&amp;gt;   forward &amp;amp;amp;= smsk[sq].antidiagMaskEx;&amp;lt;br/&amp;gt;   return forward;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 fileAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   U64 forward, reverse;&amp;lt;br/&amp;gt;   forward  = occ &amp;amp;amp; smsk[sq].fileMaskEx;&amp;lt;br/&amp;gt;   reverse  = _byteswap_uint64(forward);&amp;lt;br/&amp;gt;   forward -= smsk[sq].bitMask;&amp;lt;br/&amp;gt;   reverse -= _byteswap_uint64(smsk[sq].bitMask);&amp;lt;br/&amp;gt;   forward ^= _byteswap_uint64(reverse);&amp;lt;br/&amp;gt;   forward &amp;amp;amp;= smsk[sq].fileMaskEx;&amp;lt;br/&amp;gt;   return forward;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;U64 bishopAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   return diagonalAttacks (occ, sq)&amp;lt;br/&amp;gt;        + antiDiagAttacks (occ, sq);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 diagonalAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 forward, reverse&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;diagonalMaskEx&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   reverse  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _byteswap_uint64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;forward&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;bitMask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   reverse &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _byteswap_uint64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;bitMask&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _byteswap_uint64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;reverse&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;diagonalMaskEx&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; forward&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 antiDiagAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 forward, reverse&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;antidiagMaskEx&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   reverse  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _byteswap_uint64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;forward&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;bitMask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   reverse &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _byteswap_uint64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;bitMask&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _byteswap_uint64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;reverse&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;antidiagMaskEx&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; forward&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 fileAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 forward, reverse&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; occ &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;fileMaskEx&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   reverse  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _byteswap_uint64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;forward&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;bitMask&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   reverse &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _byteswap_uint64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;bitMask&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _byteswap_uint64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;reverse&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   forward &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;fileMaskEx&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; forward&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
U64 bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; diagonalAttacks &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; antiDiagAttacks &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:94:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@ArrayOfStructs&amp;quot; title=&amp;quot;Anchor: ArrayOfStructs&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;ArrayOfStructs&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:94 --&gt;&lt;br /&gt;
For better locality of the &lt;a class=&quot;wiki_link&quot; href=&quot;/On%20an%20empty%20Board&quot;&gt;line-attacks&lt;/a&gt; on the otherwise empty board, we may use an properly aligned array of structs.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;struct&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   U64 bitMask;         // 1 &amp;amp;lt;&amp;amp;lt; sq for convenience&amp;lt;br/&amp;gt;   U64 diagonalMaskEx;&amp;lt;br/&amp;gt;   U64 antidiagMaskEx;&amp;lt;br/&amp;gt;   U64 fileMaskEx;&amp;lt;br/&amp;gt;} smsk[64]; // 2 KByte&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 bitMask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;         &lt;span class=&quot;co1&quot;&gt;// 1 &amp;lt;&amp;lt; sq for convenience&lt;/span&gt;
   U64 diagonalMaskEx&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   U64 antidiagMaskEx&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   U64 fileMaskEx&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; smsk&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 2 KByte&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;Using &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;bswap&lt;/a&gt; makes it quite competitive for bishops and files, on &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Athlon_64&quot; rel=&quot;nofollow&quot;&gt;K8&lt;/a&gt; or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/AMD_K10&quot; rel=&quot;nofollow&quot;&gt;K10&lt;/a&gt; it has a latency of one cycle with a throughput of 1/3, like other cheap instructions. However, &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; is tad slower - while the recent &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Intel_Core_2&quot; rel=&quot;nofollow&quot;&gt;Core 2 duo&lt;/a&gt; processors perform 128-bit SIMD-instructions with 128-bit alus, that is bitwise logical instructions with a latency of one cycle and throughput of 1/3, the general purpose bswap-instruction takes four cycles with a throughput of one. In &lt;em&gt;Intel 64 and IA32 Architectures Optimization Reference Manual&lt;/em&gt; &lt;!-- ws:start:WikiTextRefRule:25:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.intel.com/assets/pdf/manual/248966.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Intel 64 and IA32 Architectures Optimization Reference Manual&amp;lt;/a&amp;gt; (pdf)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:25 --&gt; , it is therefor recommend (5.6.5. endian conversion) to use the &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3&quot;&gt;SSSE3&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#Pshufb&quot;&gt;pshufb&lt;/a&gt; instruction to swap bytes, available through intrinsic &lt;!-- ws:start:WikiTextRefRule:27:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/bb531427.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_mm_shuffle_epi8&amp;lt;/a&amp;gt; Visual C++ Developer Center - Run-Time Library Reference&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:27 --&gt; , see &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#SSSE3Version&quot;&gt;SSSE3 Hyperbola Quintessence&lt;/a&gt; for bishop attacks.&lt;br /&gt;
&lt;br /&gt;
As long there is no fast bit reversal instruction, there is no general solution for all four lines, and the rook attack-getter still needs some standard technique for the &lt;a class=&quot;wiki_link&quot; href=&quot;/First%20Rank%20Attacks#AttacksOnAllRanks&quot;&gt;rank-attacks&lt;/a&gt;. Tim Cooijmans proposed to map the rank to the main diagonal before applying HQ, and to re-map the calculated attacks back to the original rank &lt;!-- ws:start:WikiTextRefRule:30:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://timcooijmans.blogspot.co.uk/2014/04/hyperbola-quintessence-for-rooks-along.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Hyperbola Quintessence for rooks along ranks&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://www.blogger.com/profile/11033414990764447420&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Tim Cooijmans&amp;lt;/a&amp;gt;, April 6, 2014&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:30 --&gt; .&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:53:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Source Code-Generalized set-wise attacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:53 --&gt;Generalized set-wise attacks&lt;/h2&gt;
 &lt;br /&gt;
Hyperbola quintessence can be generalized to work on whole sets of sliding pieces instead on individual pieces, whose ranks to be masked. The problem arising, when not masking the rank of the piece is that attacks wrap around the board during subtraction. This is shown below:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;     ........       ........                            11111111&amp;lt;br/&amp;gt;     ........       ........                            11111111&amp;lt;br/&amp;gt;     ........       ........                            11111111&amp;lt;br/&amp;gt; r = ........ , o = ........ this leads to   o - 2*r =  11111111&amp;lt;br/&amp;gt;     ........       ........                            11111111&amp;lt;br/&amp;gt;     ........       ........                            11111111&amp;lt;br/&amp;gt;     ....1...       ....1...                            11111...&amp;lt;br/&amp;gt;     ........       ........                            ........&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;instead of&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;........&amp;lt;br/&amp;gt;........&amp;lt;br/&amp;gt;........&amp;lt;br/&amp;gt;........&amp;lt;br/&amp;gt;........&amp;lt;br/&amp;gt;........&amp;lt;br/&amp;gt;11111...&amp;lt;br/&amp;gt;........&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;     ........       ........                            11111111
     ........       ........                            11111111
     ........       ........                            11111111
 r = ........ , o = ........ this leads to   o - 2*r =  11111111
     ........       ........                            11111111
     ........       ........                            11111111
     ....1...       ....1...                            11111...
     ........       ........                            ........
&amp;nbsp;
instead of
&amp;nbsp;
........
........
........
........
........
........
11111...
........&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;This is not the intended result. It can be avioded, by bitwise adding an overflow barrier on the right-hand side. Afterwards this barrier needs to be removed from the attack set:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;u64 right = 0x0101010101010101ULL;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;     ......1.      1..1..1.                              1...1111&amp;lt;br/&amp;gt;     ....1...      1...1...                              .1111..1&amp;lt;br/&amp;gt;     ......1.      11....1.                              1.111111&amp;lt;br/&amp;gt;r =  .....1..  o = .11..1..   now: ((o | right) - 2*r) = .1.111.1&amp;lt;br/&amp;gt;     ........      ........                              ........&amp;lt;br/&amp;gt;     ......1.      ......1.                              1111111.&amp;lt;br/&amp;gt;     .......1      .......1                              1111111.&amp;lt;br/&amp;gt;     1.......      1.......                              1......1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Note, that the 4th rank was not flooded by the subtraction! Next, the blockers are removed as usual:&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;                          ...111.1&amp;lt;br/&amp;gt;                          1111...1&amp;lt;br/&amp;gt;                          .11111.1&amp;lt;br/&amp;gt;o ^ ((o | right) - 2*r) = ..111..1&amp;lt;br/&amp;gt;                          ........&amp;lt;br/&amp;gt;                          111111..&amp;lt;br/&amp;gt;                          11111111&amp;lt;br/&amp;gt;                          .......1&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;The last step is to remove the barrier at the right side that became visible after the last operation.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;                                     ...111..&amp;lt;br/&amp;gt;                                     1111...&amp;lt;br/&amp;gt;                                     .11111..&amp;lt;br/&amp;gt;(o ^ ((o | right) - 2*r) &amp;amp;amp; ~right =  ..111...&amp;lt;br/&amp;gt;                                     ........&amp;lt;br/&amp;gt;                                     111111..&amp;lt;br/&amp;gt;                                     1111111.&amp;lt;br/&amp;gt;                                     ........&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;This is the correct attack set for the left direction.&amp;lt;br/&amp;gt;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;u64 right = 0x0101010101010101ULL;
&amp;nbsp;
     ......1.      1..1..1.                              1...1111
     ....1...      1...1...                              .1111..1
     ......1.      11....1.                              1.111111
r =  .....1..  o = .11..1..   now: ((o | right) - 2*r) = .1.111.1
     ........      ........                              ........
     ......1.      ......1.                              1111111.
     .......1      .......1                              1111111.
     1.......      1.......                              1......1
&amp;nbsp;
Note, that the 4th rank was not flooded by the subtraction! Next, the blockers are removed as usual:
&amp;nbsp;
                          ...111.1
                          1111...1
                          .11111.1
o ^ ((o | right) - 2*r) = ..111..1
                          ........
                          111111..
                          11111111
                          .......1
&amp;nbsp;
The last step is to remove the barrier at the right side that became visible after the last operation.
&amp;nbsp;
                                     ...111..
                                     1111...
                                     .11111..
(o ^ ((o | right) - 2*r) &amp;amp; ~right =  ..111...
                                     ........
                                     111111..
                                     1111111.
                                     ........
&amp;nbsp;
This is the correct attack set for the left direction.
&amp;nbsp;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;the complete algorithm for the left direction is therefore:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;const u64 right = 0x0101010101010101ULL;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;u64 leftAttacks = ((o ^ ((o | right) - 2*r) &amp;amp;amp; ~right);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;const u64 right = 0x0101010101010101ULL;
&amp;nbsp;
u64 leftAttacks = ((o ^ ((o | right) - 2*r) &amp;amp; ~right);&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;For the right-hand direction, the bits need to be reversed rank-wise.&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:55:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Source Code-x86-64 assembly&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:55 --&gt;x86-64 assembly&lt;/h2&gt;
 The VC2005 generated &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly&quot;&gt;assembly&lt;/a&gt; of bishopAttacks indicates what &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Instructions_Per_Cycle&quot; rel=&quot;nofollow&quot;&gt;ipc&lt;/a&gt;-monster Hyperbola Quintessence is:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;occ$ = 16&amp;lt;br/&amp;gt;sq$ = 24&amp;lt;br/&amp;gt;?bishopAttacks@@YA_K_KI@Z PROC&amp;lt;br/&amp;gt;  00000   40 53                push    rbx&amp;lt;br/&amp;gt;  00002   8b c2                mov    eax, edx&amp;lt;br/&amp;gt;  00004   4c 8d 15 00 00 00 00 lea    r10, OFFSET FLAT:?smsk&amp;lt;br/&amp;gt;  0000b   48 c1 e0 05          shl    rax, 5&amp;lt;br/&amp;gt;  0000f   4a 8b 5c 10 08       mov    rbx, QWORD PTR [rax+r10+8]  ; diagonalMaskEx&amp;lt;br/&amp;gt;  00014   4e 8b 4c 10 10       mov    r9,  QWORD PTR [rax+r10+16] ; antidiagMaskEx&amp;lt;br/&amp;gt;  00019   4e 8b 14 10          mov    r10, QWORD PTR [rax+r10]    ; r := 1 &amp;amp;lt;&amp;amp;lt; sq&amp;lt;br/&amp;gt;  0001d   4c 8b db             mov    r11, rbx                    ; diagonalMaskEx&amp;lt;br/&amp;gt;  00020   49 8b d1             mov    rdx, r9                     ; antidiagMaskEx&amp;lt;br/&amp;gt;  00023   4d 8b c2             mov    r8, r10                     ; r := 1 &amp;amp;lt;&amp;amp;lt; sq&amp;lt;br/&amp;gt;  00026   48 23 d1             and    rdx, rcx                    ; anti &amp;amp;amp; occ&amp;lt;br/&amp;gt;  00029   4c 23 d9             and    r11, rcx                    ; dia  &amp;amp;amp; occ&amp;lt;br/&amp;gt;  0002c   49 0f c8             bswap  r8                          ; r&#039;&amp;lt;br/&amp;gt;  0002f   48 8b c2             mov    rax, rdx                    ; ant&amp;lt;br/&amp;gt;  00032   49 8b cb             mov    rcx, r11                    ; dia&amp;lt;br/&amp;gt;  00035   49 2b d2             sub    rdx, r10                    ; ant - r&amp;lt;br/&amp;gt;  00038   48 0f c8             bswap  rax                         ; ant&#039;&amp;lt;br/&amp;gt;  0003b   48 0f c9             bswap  rcx                         ; dia&#039;&amp;lt;br/&amp;gt;  0003e   4d 2b da             sub    r11, r10                    ; dia - r&amp;lt;br/&amp;gt;  00041   49 2b c0             sub    rax, r8                     ; ant&#039; - r&#039;&amp;lt;br/&amp;gt;  00044   49 2b c8             sub    rcx, r8                     ; dia&#039; - r&#039;&amp;lt;br/&amp;gt;  00047   48 0f c8             bswap  rax                         ;(ant&#039; - r&#039;)&#039;&amp;lt;br/&amp;gt;  0004a   48 0f c9             bswap  rcx                         ;(dia&#039; - r&#039;)&#039;&amp;lt;br/&amp;gt;  0004d   48 33 c2             xor    rax, rdx                    ; ant := (ant&#039; - r&#039;)&#039; ^ (ant - r)&amp;lt;br/&amp;gt;  00050   49 33 cb             xor    rcx, r11                    ; dia := (dia&#039; - r&#039;)&#039; ^ (dia - r)&amp;lt;br/&amp;gt;  00053   49 23 c1             and    rax, r9                     ; ant &amp;amp;amp;= antidiagMaskEx&amp;lt;br/&amp;gt;  00056   48 23 cb             and    rcx, rbx                    ; dia &amp;amp;amp;= diagonalMaskEx&amp;lt;br/&amp;gt;  00059   48 03 c1             add    rax, rcx                    ; attacks := dia + ant&amp;lt;br/&amp;gt;  0005c   5b                   pop    rbx&amp;lt;br/&amp;gt;  0005d   c3                   ret    0&amp;lt;br/&amp;gt;?bishopAttacks@@YA_K_KI@Z ENDP&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;occ$ = 16
sq$ = 24
?bishopAttacks@@YA_K_KI@Z PROC
  00000   40 53                push    rbx
  00002   8b c2                mov    eax, edx
  00004   4c 8d 15 00 00 00 00 lea    r10, OFFSET FLAT:?smsk
  0000b   48 c1 e0 05          shl    rax, 5
  0000f   4a 8b 5c 10 08       mov    rbx, QWORD PTR [rax+r10+8]  ; diagonalMaskEx
  00014   4e 8b 4c 10 10       mov    r9,  QWORD PTR [rax+r10+16] ; antidiagMaskEx
  00019   4e 8b 14 10          mov    r10, QWORD PTR [rax+r10]    ; r := 1 &amp;lt;&amp;lt; sq
  0001d   4c 8b db             mov    r11, rbx                    ; diagonalMaskEx
  00020   49 8b d1             mov    rdx, r9                     ; antidiagMaskEx
  00023   4d 8b c2             mov    r8, r10                     ; r := 1 &amp;lt;&amp;lt; sq
  00026   48 23 d1             and    rdx, rcx                    ; anti &amp;amp; occ
  00029   4c 23 d9             and    r11, rcx                    ; dia  &amp;amp; occ
  0002c   49 0f c8             bswap  r8                          ; r&#039;
  0002f   48 8b c2             mov    rax, rdx                    ; ant
  00032   49 8b cb             mov    rcx, r11                    ; dia
  00035   49 2b d2             sub    rdx, r10                    ; ant - r
  00038   48 0f c8             bswap  rax                         ; ant&#039;
  0003b   48 0f c9             bswap  rcx                         ; dia&#039;
  0003e   4d 2b da             sub    r11, r10                    ; dia - r
  00041   49 2b c0             sub    rax, r8                     ; ant&#039; - r&#039;
  00044   49 2b c8             sub    rcx, r8                     ; dia&#039; - r&#039;
  00047   48 0f c8             bswap  rax                         ;(ant&#039; - r&#039;)&#039;
  0004a   48 0f c9             bswap  rcx                         ;(dia&#039; - r&#039;)&#039;
  0004d   48 33 c2             xor    rax, rdx                    ; ant := (ant&#039; - r&#039;)&#039; ^ (ant - r)
  00050   49 33 cb             xor    rcx, r11                    ; dia := (dia&#039; - r&#039;)&#039; ^ (dia - r)
  00053   49 23 c1             and    rax, r9                     ; ant &amp;amp;= antidiagMaskEx
  00056   48 23 cb             and    rcx, rbx                    ; dia &amp;amp;= diagonalMaskEx
  00059   48 03 c1             add    rax, rcx                    ; attacks := dia + ant
  0005c   5b                   pop    rbx
  0005d   c3                   ret    0
?bishopAttacks@@YA_K_KI@Z ENDP&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:95:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Java&amp;quot; title=&amp;quot;Anchor: Java&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Java&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:95 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:57:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Source Code-Java&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:57 --&gt;Java&lt;/h2&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt; programmer may try &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Long.html#reverseBytes%28long%29&quot; rel=&quot;nofollow&quot;&gt;Long.reverseBytes&lt;/a&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;java5&amp;quot;&amp;gt;    static private final long[] bitMask = {&amp;lt;br/&amp;gt;        0x0000000000000001, 0x0000000000000002, 0x0000000000000004, 0x0000000000000008,&amp;lt;br/&amp;gt;        0x0000000000000010, 0x0000000000000020, 0x0000000000000040, 0x0000000000000080,&amp;lt;br/&amp;gt;        ...&amp;lt;br/&amp;gt;    };&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    static private final long[] diagonalMaskEx = {&amp;lt;br/&amp;gt;        0x8040201008040200, 0x0080402010080400, 0x0000804020100800, 0x0000008040201000,&amp;lt;br/&amp;gt;        0x0000000080402000, 0x0000000000804000, 0x0000000000008000, 0x0000000000000000,&amp;lt;br/&amp;gt;        ...&amp;lt;br/&amp;gt;    };&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    /**&amp;lt;br/&amp;gt;     * @param occ - occupancy&amp;lt;br/&amp;gt;     *        sq  - from square&amp;lt;br/&amp;gt;     * @return diagonal attacks from sq with occupancy occ&amp;lt;br/&amp;gt;     */&amp;lt;br/&amp;gt;    static public long diagonalAttacks(long occ, int sq)&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;       long forward = occ &amp;amp;amp; diagonalMaskEx[sq];&amp;lt;br/&amp;gt;       long reverse = Long.reverseBytes(forward);&amp;lt;br/&amp;gt;       forward -= bitMask[sq];&amp;lt;br/&amp;gt;       reverse -= bitMask[sq^56];&amp;lt;br/&amp;gt;       forward ^= Long.reverseBytes(reverse);&amp;lt;br/&amp;gt;       forward &amp;amp;amp;= diagonalMaskEx[sq];&amp;lt;br/&amp;gt;       return forward;&amp;lt;br/&amp;gt;    }&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.java5  {font-family:monospace;}
.java5 .imp {font-weight: bold; color: red;}
.java5 .kw1 {color: #000000;  font-weight: bold;}
.java5 .kw2 {color: #000000; font-weight: bold;}
.java5 .kw3 {color: #006600; font-weight: bold;}
.java5 .kw4 {color: #006600; font-weight: bold;}
.java5 .kw5 {color: #003399; font-weight: bold;}
.java5 .kw6 {color: #003399; font-weight: bold;}
.java5 .kw7 {color: #003399; font-weight: bold;}
.java5 .kw8 {color: #003399; font-weight: bold;}
.java5 .kw9 {color: #003399; font-weight: bold;}
.java5 .kw10 {color: #003399; font-weight: bold;}
.java5 .kw11 {color: #003399; font-weight: bold;}
.java5 .kw12 {color: #003399; font-weight: bold;}
.java5 .kw13 {color: #003399; font-weight: bold;}
.java5 .kw14 {color: #003399; font-weight: bold;}
.java5 .kw15 {color: #003399; font-weight: bold;}
.java5 .kw16 {color: #003399; font-weight: bold;}
.java5 .kw17 {color: #003399; font-weight: bold;}
.java5 .kw18 {color: #003399; font-weight: bold;}
.java5 .kw19 {color: #003399; font-weight: bold;}
.java5 .kw20 {color: #003399; font-weight: bold;}
.java5 .kw21 {color: #003399; font-weight: bold;}
.java5 .kw22 {color: #003399; font-weight: bold;}
.java5 .kw23 {color: #003399; font-weight: bold;}
.java5 .kw24 {color: #003399; font-weight: bold;}
.java5 .kw25 {color: #003399; font-weight: bold;}
.java5 .kw26 {color: #003399; font-weight: bold;}
.java5 .kw27 {color: #003399; font-weight: bold;}
.java5 .kw28 {color: #003399; font-weight: bold;}
.java5 .kw29 {color: #003399; font-weight: bold;}
.java5 .kw30 {color: #003399; font-weight: bold;}
.java5 .kw31 {color: #003399; font-weight: bold;}
.java5 .kw32 {color: #003399; font-weight: bold;}
.java5 .kw33 {color: #003399; font-weight: bold;}
.java5 .kw34 {color: #003399; font-weight: bold;}
.java5 .kw35 {color: #003399; font-weight: bold;}
.java5 .kw36 {color: #003399; font-weight: bold;}
.java5 .kw37 {color: #003399; font-weight: bold;}
.java5 .kw38 {color: #003399; font-weight: bold;}
.java5 .kw39 {color: #003399; font-weight: bold;}
.java5 .kw40 {color: #003399; font-weight: bold;}
.java5 .kw41 {color: #003399; font-weight: bold;}
.java5 .kw42 {color: #003399; font-weight: bold;}
.java5 .kw43 {color: #003399; font-weight: bold;}
.java5 .kw44 {color: #003399; font-weight: bold;}
.java5 .kw45 {color: #003399; font-weight: bold;}
.java5 .kw46 {color: #003399; font-weight: bold;}
.java5 .kw47 {color: #003399; font-weight: bold;}
.java5 .kw48 {color: #003399; font-weight: bold;}
.java5 .kw49 {color: #003399; font-weight: bold;}
.java5 .kw50 {color: #003399; font-weight: bold;}
.java5 .kw51 {color: #003399; font-weight: bold;}
.java5 .kw52 {color: #003399; font-weight: bold;}
.java5 .kw53 {color: #003399; font-weight: bold;}
.java5 .kw54 {color: #003399; font-weight: bold;}
.java5 .kw55 {color: #003399; font-weight: bold;}
.java5 .kw56 {color: #003399; font-weight: bold;}
.java5 .kw57 {color: #003399; font-weight: bold;}
.java5 .kw58 {color: #003399; font-weight: bold;}
.java5 .kw59 {color: #003399; font-weight: bold;}
.java5 .kw60 {color: #003399; font-weight: bold;}
.java5 .kw61 {color: #003399; font-weight: bold;}
.java5 .kw62 {color: #003399; font-weight: bold;}
.java5 .kw63 {color: #003399; font-weight: bold;}
.java5 .kw64 {color: #003399; font-weight: bold;}
.java5 .kw65 {color: #003399; font-weight: bold;}
.java5 .kw66 {color: #003399; font-weight: bold;}
.java5 .kw67 {color: #003399; font-weight: bold;}
.java5 .kw68 {color: #003399; font-weight: bold;}
.java5 .kw69 {color: #003399; font-weight: bold;}
.java5 .kw70 {color: #003399; font-weight: bold;}
.java5 .kw71 {color: #003399; font-weight: bold;}
.java5 .kw72 {color: #003399; font-weight: bold;}
.java5 .kw73 {color: #003399; font-weight: bold;}
.java5 .kw74 {color: #003399; font-weight: bold;}
.java5 .kw75 {color: #003399; font-weight: bold;}
.java5 .kw76 {color: #003399; font-weight: bold;}
.java5 .kw77 {color: #003399; font-weight: bold;}
.java5 .kw78 {color: #003399; font-weight: bold;}
.java5 .kw79 {color: #003399; font-weight: bold;}
.java5 .kw80 {color: #003399; font-weight: bold;}
.java5 .kw81 {color: #003399; font-weight: bold;}
.java5 .kw82 {color: #003399; font-weight: bold;}
.java5 .kw83 {color: #003399; font-weight: bold;}
.java5 .kw84 {color: #003399; font-weight: bold;}
.java5 .kw85 {color: #003399; font-weight: bold;}
.java5 .kw86 {color: #003399; font-weight: bold;}
.java5 .kw87 {color: #003399; font-weight: bold;}
.java5 .kw88 {color: #003399; font-weight: bold;}
.java5 .kw89 {color: #003399; font-weight: bold;}
.java5 .kw90 {color: #003399; font-weight: bold;}
.java5 .kw91 {color: #003399; font-weight: bold;}
.java5 .kw92 {color: #003399; font-weight: bold;}
.java5 .kw93 {color: #003399; font-weight: bold;}
.java5 .kw94 {color: #003399; font-weight: bold;}
.java5 .kw95 {color: #003399; font-weight: bold;}
.java5 .kw96 {color: #003399; font-weight: bold;}
.java5 .kw97 {color: #003399; font-weight: bold;}
.java5 .kw98 {color: #003399; font-weight: bold;}
.java5 .kw99 {color: #003399; font-weight: bold;}
.java5 .kw100 {color: #003399; font-weight: bold;}
.java5 .kw101 {color: #003399; font-weight: bold;}
.java5 .kw102 {color: #003399; font-weight: bold;}
.java5 .kw103 {color: #003399; font-weight: bold;}
.java5 .kw104 {color: #003399; font-weight: bold;}
.java5 .kw105 {color: #003399; font-weight: bold;}
.java5 .kw106 {color: #003399; font-weight: bold;}
.java5 .kw107 {color: #003399; font-weight: bold;}
.java5 .kw108 {color: #003399; font-weight: bold;}
.java5 .kw109 {color: #003399; font-weight: bold;}
.java5 .kw110 {color: #003399; font-weight: bold;}
.java5 .kw111 {color: #003399; font-weight: bold;}
.java5 .kw112 {color: #003399; font-weight: bold;}
.java5 .kw113 {color: #003399; font-weight: bold;}
.java5 .kw114 {color: #003399; font-weight: bold;}
.java5 .kw115 {color: #003399; font-weight: bold;}
.java5 .kw116 {color: #003399; font-weight: bold;}
.java5 .kw117 {color: #003399; font-weight: bold;}
.java5 .kw118 {color: #003399; font-weight: bold;}
.java5 .kw119 {color: #003399; font-weight: bold;}
.java5 .kw120 {color: #003399; font-weight: bold;}
.java5 .kw121 {color: #003399; font-weight: bold;}
.java5 .kw122 {color: #003399; font-weight: bold;}
.java5 .kw123 {color: #003399; font-weight: bold;}
.java5 .kw124 {color: #003399; font-weight: bold;}
.java5 .kw125 {color: #003399; font-weight: bold;}
.java5 .kw126 {color: #003399; font-weight: bold;}
.java5 .kw127 {color: #003399; font-weight: bold;}
.java5 .kw128 {color: #003399; font-weight: bold;}
.java5 .kw129 {color: #003399; font-weight: bold;}
.java5 .kw130 {color: #003399; font-weight: bold;}
.java5 .kw131 {color: #003399; font-weight: bold;}
.java5 .kw132 {color: #003399; font-weight: bold;}
.java5 .kw133 {color: #003399; font-weight: bold;}
.java5 .kw134 {color: #003399; font-weight: bold;}
.java5 .kw135 {color: #003399; font-weight: bold;}
.java5 .kw136 {color: #003399; font-weight: bold;}
.java5 .kw137 {color: #003399; font-weight: bold;}
.java5 .kw138 {color: #003399; font-weight: bold;}
.java5 .kw139 {color: #003399; font-weight: bold;}
.java5 .kw140 {color: #003399; font-weight: bold;}
.java5 .kw141 {color: #003399; font-weight: bold;}
.java5 .kw142 {color: #003399; font-weight: bold;}
.java5 .kw143 {color: #003399; font-weight: bold;}
.java5 .kw144 {color: #003399; font-weight: bold;}
.java5 .kw145 {color: #003399; font-weight: bold;}
.java5 .kw146 {color: #003399; font-weight: bold;}
.java5 .kw147 {color: #003399; font-weight: bold;}
.java5 .kw148 {color: #003399; font-weight: bold;}
.java5 .kw149 {color: #003399; font-weight: bold;}
.java5 .kw150 {color: #003399; font-weight: bold;}
.java5 .kw151 {color: #003399; font-weight: bold;}
.java5 .kw152 {color: #003399; font-weight: bold;}
.java5 .kw153 {color: #003399; font-weight: bold;}
.java5 .kw154 {color: #003399; font-weight: bold;}
.java5 .kw155 {color: #003399; font-weight: bold;}
.java5 .kw156 {color: #003399; font-weight: bold;}
.java5 .kw157 {color: #003399; font-weight: bold;}
.java5 .kw158 {color: #003399; font-weight: bold;}
.java5 .kw159 {color: #003399; font-weight: bold;}
.java5 .kw160 {color: #003399; font-weight: bold;}
.java5 .kw161 {color: #003399; font-weight: bold;}
.java5 .kw162 {color: #003399; font-weight: bold;}
.java5 .kw163 {color: #003399; font-weight: bold;}
.java5 .kw164 {color: #003399; font-weight: bold;}
.java5 .kw165 {color: #003399; font-weight: bold;}
.java5 .kw166 {color: #003399; font-weight: bold;}
.java5 .co1 {color: #666666; font-style: italic;}
.java5 .co2 {color: #006699;}
.java5 .co3 {color: #008000; font-style: italic; font-weight: bold;}
.java5 .coMULTI {color: #666666; font-style: italic;}
.java5 .es0 {color: #000099; font-weight: bold;}
.java5 .br0 {color: #009900;}
.java5 .sy0 {color: #339933;}
.java5 .st0 {color: #0000ff;}
.java5 .nu0 {color: #cc66cc;}
.java5 .me1 {color: #006633;}
.java5 .me2 {color: #006633;}
.java5 span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;java5&quot;&gt;    &lt;span class=&quot;kw2&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; bitMask = &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        0x0000000000000001, 0x0000000000000002, 0x0000000000000004, 0x0000000000000008,
        0x0000000000000010, 0x0000000000000020, 0x0000000000000040, 0x0000000000000080,
        ...
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw2&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; diagonalMaskEx = &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        0x8040201008040200, 0x0080402010080400, 0x0000804020100800, 0x0000008040201000,
        0x0000000080402000, 0x0000000000804000, 0x0000000000008000, 0x0000000000000000,
        ...
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;co3&quot;&gt;/**
     * @param occ - occupancy
     *        sq  - from square
     * @return diagonal attacks from sq with occupancy occ
     */&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; diagonalAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; occ, &lt;span class=&quot;kw3&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
       &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; forward = occ &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt; diagonalMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; reverse = &lt;a href=&quot;http://java.sun.com/j2se/1%2E5%2E0/docs/api/java/lang/Long.html&quot;&gt;&lt;span class=&quot;kw21&quot;&gt;Long&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;reverseBytes&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;forward&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       forward -= bitMask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       reverse -= bitMask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq^&lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       forward ^= &lt;a href=&quot;http://java.sun.com/j2se/1%2E5%2E0/docs/api/java/lang/Long.html&quot;&gt;&lt;span class=&quot;kw21&quot;&gt;Long&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;reverseBytes&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;reverse&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       forward &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt;= diagonalMaskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       &lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; forward&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Long.html#reverse%28long%29&quot; rel=&quot;nofollow&quot;&gt;Long.reverse&lt;/a&gt; for a generalized attack getter even for ranks is too expensive, except a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Java_Virtual_Machine&quot; rel=&quot;nofollow&quot;&gt;JVM&lt;/a&gt; can use a machine instruction rather than a &lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating#Rotationby180degrees&quot;&gt;bit-reversal&lt;/a&gt; routine:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;java5&amp;quot;&amp;gt;    /**&amp;lt;br/&amp;gt;     * @param occ  - occupancy&amp;lt;br/&amp;gt;     *        line - {0..3} {rank, file, diagonal, antidiagonal}&amp;lt;br/&amp;gt;     *        sq   - from square&amp;lt;br/&amp;gt;     * @return attacks from sq on line with occupancy occ&amp;lt;br/&amp;gt;     */&amp;lt;br/&amp;gt;    static public long attacks(long occ, int line, int sq)&amp;lt;br/&amp;gt;    {&amp;lt;br/&amp;gt;       long forward = occ &amp;amp;amp; maskEx[sq][line];&amp;lt;br/&amp;gt;       long reverse = Long.reverse(forward);&amp;lt;br/&amp;gt;       forward -= bitMask[sq];&amp;lt;br/&amp;gt;       reverse -= bitMask[sq^63];&amp;lt;br/&amp;gt;       forward ^= Long.reverse(reverse);&amp;lt;br/&amp;gt;       forward &amp;amp;amp;= maskEx[sq][line];&amp;lt;br/&amp;gt;       return forward;&amp;lt;br/&amp;gt;    }&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.java5  {font-family:monospace;}
.java5 .imp {font-weight: bold; color: red;}
.java5 .kw1 {color: #000000;  font-weight: bold;}
.java5 .kw2 {color: #000000; font-weight: bold;}
.java5 .kw3 {color: #006600; font-weight: bold;}
.java5 .kw4 {color: #006600; font-weight: bold;}
.java5 .kw5 {color: #003399; font-weight: bold;}
.java5 .kw6 {color: #003399; font-weight: bold;}
.java5 .kw7 {color: #003399; font-weight: bold;}
.java5 .kw8 {color: #003399; font-weight: bold;}
.java5 .kw9 {color: #003399; font-weight: bold;}
.java5 .kw10 {color: #003399; font-weight: bold;}
.java5 .kw11 {color: #003399; font-weight: bold;}
.java5 .kw12 {color: #003399; font-weight: bold;}
.java5 .kw13 {color: #003399; font-weight: bold;}
.java5 .kw14 {color: #003399; font-weight: bold;}
.java5 .kw15 {color: #003399; font-weight: bold;}
.java5 .kw16 {color: #003399; font-weight: bold;}
.java5 .kw17 {color: #003399; font-weight: bold;}
.java5 .kw18 {color: #003399; font-weight: bold;}
.java5 .kw19 {color: #003399; font-weight: bold;}
.java5 .kw20 {color: #003399; font-weight: bold;}
.java5 .kw21 {color: #003399; font-weight: bold;}
.java5 .kw22 {color: #003399; font-weight: bold;}
.java5 .kw23 {color: #003399; font-weight: bold;}
.java5 .kw24 {color: #003399; font-weight: bold;}
.java5 .kw25 {color: #003399; font-weight: bold;}
.java5 .kw26 {color: #003399; font-weight: bold;}
.java5 .kw27 {color: #003399; font-weight: bold;}
.java5 .kw28 {color: #003399; font-weight: bold;}
.java5 .kw29 {color: #003399; font-weight: bold;}
.java5 .kw30 {color: #003399; font-weight: bold;}
.java5 .kw31 {color: #003399; font-weight: bold;}
.java5 .kw32 {color: #003399; font-weight: bold;}
.java5 .kw33 {color: #003399; font-weight: bold;}
.java5 .kw34 {color: #003399; font-weight: bold;}
.java5 .kw35 {color: #003399; font-weight: bold;}
.java5 .kw36 {color: #003399; font-weight: bold;}
.java5 .kw37 {color: #003399; font-weight: bold;}
.java5 .kw38 {color: #003399; font-weight: bold;}
.java5 .kw39 {color: #003399; font-weight: bold;}
.java5 .kw40 {color: #003399; font-weight: bold;}
.java5 .kw41 {color: #003399; font-weight: bold;}
.java5 .kw42 {color: #003399; font-weight: bold;}
.java5 .kw43 {color: #003399; font-weight: bold;}
.java5 .kw44 {color: #003399; font-weight: bold;}
.java5 .kw45 {color: #003399; font-weight: bold;}
.java5 .kw46 {color: #003399; font-weight: bold;}
.java5 .kw47 {color: #003399; font-weight: bold;}
.java5 .kw48 {color: #003399; font-weight: bold;}
.java5 .kw49 {color: #003399; font-weight: bold;}
.java5 .kw50 {color: #003399; font-weight: bold;}
.java5 .kw51 {color: #003399; font-weight: bold;}
.java5 .kw52 {color: #003399; font-weight: bold;}
.java5 .kw53 {color: #003399; font-weight: bold;}
.java5 .kw54 {color: #003399; font-weight: bold;}
.java5 .kw55 {color: #003399; font-weight: bold;}
.java5 .kw56 {color: #003399; font-weight: bold;}
.java5 .kw57 {color: #003399; font-weight: bold;}
.java5 .kw58 {color: #003399; font-weight: bold;}
.java5 .kw59 {color: #003399; font-weight: bold;}
.java5 .kw60 {color: #003399; font-weight: bold;}
.java5 .kw61 {color: #003399; font-weight: bold;}
.java5 .kw62 {color: #003399; font-weight: bold;}
.java5 .kw63 {color: #003399; font-weight: bold;}
.java5 .kw64 {color: #003399; font-weight: bold;}
.java5 .kw65 {color: #003399; font-weight: bold;}
.java5 .kw66 {color: #003399; font-weight: bold;}
.java5 .kw67 {color: #003399; font-weight: bold;}
.java5 .kw68 {color: #003399; font-weight: bold;}
.java5 .kw69 {color: #003399; font-weight: bold;}
.java5 .kw70 {color: #003399; font-weight: bold;}
.java5 .kw71 {color: #003399; font-weight: bold;}
.java5 .kw72 {color: #003399; font-weight: bold;}
.java5 .kw73 {color: #003399; font-weight: bold;}
.java5 .kw74 {color: #003399; font-weight: bold;}
.java5 .kw75 {color: #003399; font-weight: bold;}
.java5 .kw76 {color: #003399; font-weight: bold;}
.java5 .kw77 {color: #003399; font-weight: bold;}
.java5 .kw78 {color: #003399; font-weight: bold;}
.java5 .kw79 {color: #003399; font-weight: bold;}
.java5 .kw80 {color: #003399; font-weight: bold;}
.java5 .kw81 {color: #003399; font-weight: bold;}
.java5 .kw82 {color: #003399; font-weight: bold;}
.java5 .kw83 {color: #003399; font-weight: bold;}
.java5 .kw84 {color: #003399; font-weight: bold;}
.java5 .kw85 {color: #003399; font-weight: bold;}
.java5 .kw86 {color: #003399; font-weight: bold;}
.java5 .kw87 {color: #003399; font-weight: bold;}
.java5 .kw88 {color: #003399; font-weight: bold;}
.java5 .kw89 {color: #003399; font-weight: bold;}
.java5 .kw90 {color: #003399; font-weight: bold;}
.java5 .kw91 {color: #003399; font-weight: bold;}
.java5 .kw92 {color: #003399; font-weight: bold;}
.java5 .kw93 {color: #003399; font-weight: bold;}
.java5 .kw94 {color: #003399; font-weight: bold;}
.java5 .kw95 {color: #003399; font-weight: bold;}
.java5 .kw96 {color: #003399; font-weight: bold;}
.java5 .kw97 {color: #003399; font-weight: bold;}
.java5 .kw98 {color: #003399; font-weight: bold;}
.java5 .kw99 {color: #003399; font-weight: bold;}
.java5 .kw100 {color: #003399; font-weight: bold;}
.java5 .kw101 {color: #003399; font-weight: bold;}
.java5 .kw102 {color: #003399; font-weight: bold;}
.java5 .kw103 {color: #003399; font-weight: bold;}
.java5 .kw104 {color: #003399; font-weight: bold;}
.java5 .kw105 {color: #003399; font-weight: bold;}
.java5 .kw106 {color: #003399; font-weight: bold;}
.java5 .kw107 {color: #003399; font-weight: bold;}
.java5 .kw108 {color: #003399; font-weight: bold;}
.java5 .kw109 {color: #003399; font-weight: bold;}
.java5 .kw110 {color: #003399; font-weight: bold;}
.java5 .kw111 {color: #003399; font-weight: bold;}
.java5 .kw112 {color: #003399; font-weight: bold;}
.java5 .kw113 {color: #003399; font-weight: bold;}
.java5 .kw114 {color: #003399; font-weight: bold;}
.java5 .kw115 {color: #003399; font-weight: bold;}
.java5 .kw116 {color: #003399; font-weight: bold;}
.java5 .kw117 {color: #003399; font-weight: bold;}
.java5 .kw118 {color: #003399; font-weight: bold;}
.java5 .kw119 {color: #003399; font-weight: bold;}
.java5 .kw120 {color: #003399; font-weight: bold;}
.java5 .kw121 {color: #003399; font-weight: bold;}
.java5 .kw122 {color: #003399; font-weight: bold;}
.java5 .kw123 {color: #003399; font-weight: bold;}
.java5 .kw124 {color: #003399; font-weight: bold;}
.java5 .kw125 {color: #003399; font-weight: bold;}
.java5 .kw126 {color: #003399; font-weight: bold;}
.java5 .kw127 {color: #003399; font-weight: bold;}
.java5 .kw128 {color: #003399; font-weight: bold;}
.java5 .kw129 {color: #003399; font-weight: bold;}
.java5 .kw130 {color: #003399; font-weight: bold;}
.java5 .kw131 {color: #003399; font-weight: bold;}
.java5 .kw132 {color: #003399; font-weight: bold;}
.java5 .kw133 {color: #003399; font-weight: bold;}
.java5 .kw134 {color: #003399; font-weight: bold;}
.java5 .kw135 {color: #003399; font-weight: bold;}
.java5 .kw136 {color: #003399; font-weight: bold;}
.java5 .kw137 {color: #003399; font-weight: bold;}
.java5 .kw138 {color: #003399; font-weight: bold;}
.java5 .kw139 {color: #003399; font-weight: bold;}
.java5 .kw140 {color: #003399; font-weight: bold;}
.java5 .kw141 {color: #003399; font-weight: bold;}
.java5 .kw142 {color: #003399; font-weight: bold;}
.java5 .kw143 {color: #003399; font-weight: bold;}
.java5 .kw144 {color: #003399; font-weight: bold;}
.java5 .kw145 {color: #003399; font-weight: bold;}
.java5 .kw146 {color: #003399; font-weight: bold;}
.java5 .kw147 {color: #003399; font-weight: bold;}
.java5 .kw148 {color: #003399; font-weight: bold;}
.java5 .kw149 {color: #003399; font-weight: bold;}
.java5 .kw150 {color: #003399; font-weight: bold;}
.java5 .kw151 {color: #003399; font-weight: bold;}
.java5 .kw152 {color: #003399; font-weight: bold;}
.java5 .kw153 {color: #003399; font-weight: bold;}
.java5 .kw154 {color: #003399; font-weight: bold;}
.java5 .kw155 {color: #003399; font-weight: bold;}
.java5 .kw156 {color: #003399; font-weight: bold;}
.java5 .kw157 {color: #003399; font-weight: bold;}
.java5 .kw158 {color: #003399; font-weight: bold;}
.java5 .kw159 {color: #003399; font-weight: bold;}
.java5 .kw160 {color: #003399; font-weight: bold;}
.java5 .kw161 {color: #003399; font-weight: bold;}
.java5 .kw162 {color: #003399; font-weight: bold;}
.java5 .kw163 {color: #003399; font-weight: bold;}
.java5 .kw164 {color: #003399; font-weight: bold;}
.java5 .kw165 {color: #003399; font-weight: bold;}
.java5 .kw166 {color: #003399; font-weight: bold;}
.java5 .co1 {color: #666666; font-style: italic;}
.java5 .co2 {color: #006699;}
.java5 .co3 {color: #008000; font-style: italic; font-weight: bold;}
.java5 .coMULTI {color: #666666; font-style: italic;}
.java5 .es0 {color: #000099; font-weight: bold;}
.java5 .br0 {color: #009900;}
.java5 .sy0 {color: #339933;}
.java5 .st0 {color: #0000ff;}
.java5 .nu0 {color: #cc66cc;}
.java5 .me1 {color: #006633;}
.java5 .me2 {color: #006633;}
.java5 span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;java5&quot;&gt;    &lt;span class=&quot;co3&quot;&gt;/**
     * @param occ  - occupancy
     *        line - {0..3} {rank, file, diagonal, antidiagonal}
     *        sq   - from square
     * @return attacks from sq on line with occupancy occ
     */&lt;/span&gt;
    &lt;span class=&quot;kw2&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; attacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; occ, &lt;span class=&quot;kw3&quot;&gt;int&lt;/span&gt; line, &lt;span class=&quot;kw3&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
       &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; forward = occ &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt; maskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;line&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       &lt;span class=&quot;kw3&quot;&gt;long&lt;/span&gt; reverse = &lt;a href=&quot;http://java.sun.com/j2se/1%2E5%2E0/docs/api/java/lang/Long.html&quot;&gt;&lt;span class=&quot;kw21&quot;&gt;Long&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;reverse&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;forward&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       forward -= bitMask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       reverse -= bitMask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq^&lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       forward ^= &lt;a href=&quot;http://java.sun.com/j2se/1%2E5%2E0/docs/api/java/lang/Long.html&quot;&gt;&lt;span class=&quot;kw21&quot;&gt;Long&lt;/span&gt;&lt;/a&gt;.&lt;span class=&quot;me1&quot;&gt;reverse&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;reverse&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       forward &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt;= maskEx&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;line&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
       &lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; forward&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:59:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;AMD&#039;s SIMD Future in 2011&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:59 --&gt;AMD&#039;s SIMD Future in 2011&lt;/h1&gt;
 In 2007 &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; announced the hypothetical &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE5&quot;&gt;SSE5&lt;/a&gt; instruction set &lt;!-- ws:start:WikiTextRefRule:33:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://developer.amd.com/cpu/SSE5/Pages/default.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;128-Bit SSE5 Instruction Set&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://developer.amd.com/pages/default.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AMD Developer Central&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:33 --&gt; with a PPERM instruction &lt;!-- ws:start:WikiTextRefRule:35:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.enrupt.com/index.php/2008/09/03/sse5_permutations&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;SSE5 permutations&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-8&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:35 --&gt; , which would be able to reverse vectors of two bitboards. In May 2009 AMD revised &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE5&quot;&gt;SSE5&lt;/a&gt;, to become more compatible with Intel&#039;s &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;Advanced Vector Extensions&lt;/a&gt;, and also expanding the SIMD-register width from 128 to 256-bit, the renamed &lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt; instruction set &lt;!-- ws:start:WikiTextRefRule:37:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/XOP_instruction_set&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;XOP instruction set from Wikipedia&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-9&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-9&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:37 --&gt; . However, the successor of the planned PPERM SSE5-instruction is now called &lt;a class=&quot;wiki_link&quot; href=&quot;/XOP#VPPERM&quot;&gt;VPPERM&lt;/a&gt;, but still works on 128-bit XMM registers &lt;!-- ws:start:WikiTextRefRule:39:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://support.amd.com/us/Embedded_TechDocs/43479.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Volume 6: 128-Bit and 256-Bit XOP, FMA4 and CVT16 Instructions&amp;lt;/a&amp;gt; (pdf), see VPPERM pg. 221&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-10&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-10&quot;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:39 --&gt; . VPPERM instruction requires four operands (xmm-registers):&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt; VPPERM dest, src1, src2, selector&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt; VPPERM dest, src1, src2, selector&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;For each of 16 destination bytes the corresponding selector-byte addresses one of 32 input bytes (from src1, src2) and a logical operation including bit-reversal:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:13:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;char src[32];   // src2:src1&amp;lt;br/&amp;gt;char select[16];&amp;lt;br/&amp;gt;char dest[16];&amp;lt;br/&amp;gt;for (int i = 0; i &amp;amp;lt; 16; i++) {&amp;lt;br/&amp;gt;   char opera = select[i] &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; 5; // unsigned shift&amp;lt;br/&amp;gt;   char idx32 = select[i] &amp;amp;amp; 31;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;   switch ( opera ) {&amp;lt;br/&amp;gt;      case 0: dest[i] =  src[idx32]; break;&amp;lt;br/&amp;gt;      case 1: dest[i] = ~src[idx32]; break;&amp;lt;br/&amp;gt;      case 2: dest[i] =  bitreverse( src[idx32]); break;&amp;lt;br/&amp;gt;      case 3: dest[i] = ~bitreverse( src[idx32]); break;&amp;lt;br/&amp;gt;      case 4: dest[i] = 0x00; break;&amp;lt;br/&amp;gt;      case 5: dest[i] = 0xFF; break;&amp;lt;br/&amp;gt;      case 6: dest[i] =  src[idx32] &amp;amp;gt;&amp;amp;gt; 7;  break; // signed shift&amp;lt;br/&amp;gt;      case 7: dest[i] = ~src[idx32] &amp;amp;gt;&amp;amp;gt; 7;  break; // signed shift&amp;lt;br/&amp;gt;   }&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; src&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// src2:src1&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; select&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; dest&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; opera &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; select&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// unsigned shift&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; idx32 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; select&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;31&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw1&quot;&gt;switch&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; opera &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; dest&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  src&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;idx32&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; dest&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~src&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;idx32&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; dest&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  bitreverse&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; src&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;idx32&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; dest&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~bitreverse&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; src&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;idx32&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; dest&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; dest&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xFF&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; dest&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  src&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;idx32&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// signed shift&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;case&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; dest&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; ~src&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;idx32&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// signed shift&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:13 --&gt;Since VPPERM can simultaneously reverse bits and bytes, it can for instance reverse two bitboards in one run, even from different sources, to make Hyperbola Quintessence work for all four lines.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:61:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:61 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Reverse%20Bitboards&quot;&gt;Reverse Bitboards&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Obstruction%20Difference&quot;&gt;Obstruction Difference&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SBAMG&quot;&gt;SBAMG&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#SSSE3Version&quot;&gt;SSSE3 Hyperbola Quintessence&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Subtracting%20a%20Rook%20from%20a%20Blocking%20Piece&quot;&gt;Subtracting a Rook from a Blocking Piece&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:63:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:63 --&gt;Forum Posts&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=140314&quot; rel=&quot;nofollow&quot;&gt;Re: BitBoard Tests Magic v Non-Rotated 32 Bits v 64 Bits&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Aleks%20Peshkov&quot;&gt;Aleks Peshkov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 25, 2007&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=25979&quot; rel=&quot;nofollow&quot;&gt;Hyperbola Quiesscene: hardly any improvement&lt;/a&gt; by trojanfoe, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 13, 2009&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=58795&quot; rel=&quot;nofollow&quot;&gt;Comparison of bitboard attack-getter variants&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Sven%20Sch%C3%BCle&quot;&gt;Sven Schüle&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 04, 2016&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=58667&amp;amp;start=106&quot; rel=&quot;nofollow&quot;&gt;Re: The wrong way&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Aleks%20Peshkov&quot;&gt;Aleks Peshkov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 05, 2016 » &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#SSSE3Version&quot;&gt;SSSE3 Hyperbola Quintessence&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:65:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc9&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:65 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.youtube.com/watch?v=bCH4YK6oq8M&amp;amp;list=SPQV5mozTHmacMeRzJCW_8K3qw2miYqd0c&amp;amp;index=9&quot; rel=&quot;nofollow&quot;&gt;Sliding Pieces (Part 1) - Advanced Java Chess Engine Tutorial 8&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Jonathan%20Warkentin&quot;&gt;Jonathan Warkentin&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://timcooijmans.blogspot.co.uk/2014/04/hyperbola-quintessence-for-rooks-along.html&quot; rel=&quot;nofollow&quot;&gt;Hyperbola Quintessence for rooks along ranks&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.blogger.com/profile/11033414990764447420&quot; rel=&quot;nofollow&quot;&gt;Tim Cooijmans&lt;/a&gt;, April 6, 2014 &lt;!-- ws:start:WikiTextRefRule:43:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=58795&amp;amp;amp;start=10&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: Comparison of bitboard attack-getter variants&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Matthew%20R.%20Brades&amp;quot;&amp;gt;Matthew R. Brades&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, January 04, 2016&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-11&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-11&quot;&gt;[11]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:43 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:67:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc10&quot;&gt;&lt;a name=&quot;External Links-Hyperbola&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:67 --&gt;Hyperbola&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Hyperbola&quot; rel=&quot;nofollow&quot;&gt;Hyperbola from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.paideiaschool.org/TeacherPages/Steve_Sigur/resources/Eulerian%20hyperbola/Eulerian%20hyperbola.html&quot; rel=&quot;nofollow&quot;&gt;The Eulerian Hyperbola&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.mathwords.com/f/foci_hyperbola.htm&quot; rel=&quot;nofollow&quot;&gt;Foci of a Hyperbola&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.mathwords.com/&quot; rel=&quot;nofollow&quot;&gt;mathwords.com&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:69:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc11&quot;&gt;&lt;a name=&quot;External Links-Quintessence&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:69 --&gt;Quintessence&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Quintessence&quot; rel=&quot;nofollow&quot;&gt;Quintessence from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Quintessence_(physics)&quot; rel=&quot;nofollow&quot;&gt;Quintessence (physics) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Aether_(classical_element)#Fifth_element&quot; rel=&quot;nofollow&quot;&gt;Quintessence the Fifth Element from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:71:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc12&quot;&gt;&lt;a name=&quot;External Links-Misc&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:71 --&gt;Misc&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#Focus&quot;&gt;Focus&lt;/a&gt; - &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Hocus_Pocus_%28song%29&quot; rel=&quot;nofollow&quot;&gt;Hocus Pocus&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Pinkpop_Festival&quot; rel=&quot;nofollow&quot;&gt;Pinkpop Festival&lt;/a&gt; 1972, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Geleen&quot; rel=&quot;nofollow&quot;&gt;Geleen&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:44:&amp;lt;img src=&amp;quot;http://www.wikispaces.com/site/embedthumbnail/custom/23950926?h=0&amp;amp;w=0&amp;quot; class=&amp;quot;WikiMedia WikiMediaCustom&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;custom&amp;amp;quot; key=&amp;amp;quot;23950926&amp;amp;quot;&amp;quot; title=&amp;quot;Custom Media&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;480&quot; height=&quot;360&quot; src=&quot;//www.youtube.com/embed/5-adsDeltaM?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:44 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:73:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc13&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:73 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:304:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/a3140177.aspx&quot; rel=&quot;nofollow&quot;&gt;_byteswap_uint64&lt;/a&gt; Visual C++ Developer Center - Run-Time Library Reference&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=140314&quot; rel=&quot;nofollow&quot;&gt;Re: BitBoard Tests Magic v Non-Rotated 32 Bits v 64 Bits&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Aleks%20Peshkov&quot;&gt;Aleks Peshkov&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 25, &lt;a class=&quot;wiki_link&quot; href=&quot;/Timeline#2007&quot;&gt;2007&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.puckergallery.com/artists/bak_chess/bak_chess_all.html&quot; rel=&quot;nofollow&quot;&gt;The Game of War&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.puckergallery.com/artists/bak_index/bak_publications.html&quot; rel=&quot;nofollow&quot;&gt;Samuel Bak - represented by Pucker Gallery since 1969&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.intel.com/assets/pdf/manual/248966.pdf&quot; rel=&quot;nofollow&quot;&gt;Intel 64 and IA32 Architectures Optimization Reference Manual&lt;/a&gt; (pdf)&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb531427.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_shuffle_epi8&lt;/a&gt; Visual C++ Developer Center - Run-Time Library Reference&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://timcooijmans.blogspot.co.uk/2014/04/hyperbola-quintessence-for-rooks-along.html&quot; rel=&quot;nofollow&quot;&gt;Hyperbola Quintessence for rooks along ranks&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.blogger.com/profile/11033414990764447420&quot; rel=&quot;nofollow&quot;&gt;Tim Cooijmans&lt;/a&gt;, April 6, 2014&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/cpu/SSE5/Pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;128-Bit SSE5 Instruction Set&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;AMD Developer Central&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-8&quot;&gt;&lt;a href=&quot;#cite_ref-8&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.enrupt.com/index.php/2008/09/03/sse5_permutations&quot; rel=&quot;nofollow&quot;&gt;SSE5 permutations&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-9&quot;&gt;&lt;a href=&quot;#cite_ref-9&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/XOP_instruction_set&quot; rel=&quot;nofollow&quot;&gt;XOP instruction set from Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-10&quot;&gt;&lt;a href=&quot;#cite_ref-10&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Embedded_TechDocs/43479.pdf&quot; rel=&quot;nofollow&quot;&gt;Volume 6: 128-Bit and 256-Bit XOP, FMA4 and CVT16 Instructions&lt;/a&gt; (pdf), see VPPERM pg. 221&lt;/li&gt;
&lt;li id=&quot;cite_note-11&quot;&gt;&lt;a href=&quot;#cite_ref-11&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=58795&amp;amp;start=10&quot; rel=&quot;nofollow&quot;&gt;Re: Comparison of bitboard attack-getter variants&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Matthew%20R.%20Brades&quot;&gt;Matthew R. Brades&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 04, 2016&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:304 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:75:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc14&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:75 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:015:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Hyperbola Quintessence&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Hyperbola Quintessence&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Hyperbola_Quintessence includeBody-Hyperbola%20Quintessence includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Aleks+Peshkov&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Aleks Peshkov&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 13, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amoeba&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amoeba&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dumb&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dumb&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 10, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Endianness&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Endianness&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fill+Algorithms&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fill Algorithms&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 6, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/First+Rank+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;First Rank Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 28, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Flipping+Mirroring+and+Rotating&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Flipping Mirroring and Rotating&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 14, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hiding+the+Implementation&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hiding the Implementation&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 3, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hyperbola+Quintessence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hyperbola Quintessence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Java&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Java&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Jonathan+Warkentin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Jonathan Warkentin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 29, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Karlo+Bala+Jr.&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Karlo Bala Jr.&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kindergarten+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kindergarten Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kogge-Stone+Algorithm&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kogge-Stone Algorithm&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Parallel+Prefix+Algorithms&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Parallel Prefix Algorithms&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 22, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Reverse+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Reverse Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ryan+Mack&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ryan Mack&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 18, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SBAMG&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SBAMG&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 4, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Subtracting+a+Rook+from+a+Blocking+Piece&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Subtracting a Rook from a Blocking Piece&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Syed+Fahad&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Syed Fahad&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/XOP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;XOP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:015 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>MMX</title>
      <link>https://chessprogramming.wikispaces.com/MMX</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/MMX</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/MMX</comments>
      <pubDate>Sun, 05 Jun 2016 21:59:15 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; * MMX&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextRemoteImageRule:115:&amp;lt;a href=&amp;quot;http://en.wikipedia.org/wiki/Intel_P5_%28microarchitecture%29&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/P-MMX.JPG/150px-P-MMX.JPG&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; style=&amp;quot;height: 165px; width: 169px;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Intel_P5_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/P-MMX.JPG/150px-P-MMX.JPG&quot; alt=&quot;external image 150px-P-MMX.JPG&quot; title=&quot;external image 150px-P-MMX.JPG&quot; style=&quot;height: 165px; width: 169px;&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextRemoteImageRule:115 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;MMX&lt;/strong&gt; is a &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD&lt;/a&gt; (Single instruction, multiple data) instruction set of &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; processors, starting in 1996 with &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Intel_P5_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Pentium MMX&lt;/a&gt;. In 1998, &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; enhanced Intel&#039;s MMX with the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/3DNow&quot; rel=&quot;nofollow&quot;&gt;3DNow!&lt;/a&gt; extension, mostly related to the &lt;a class=&quot;wiki_link&quot; href=&quot;/Float&quot;&gt;Float&lt;/a&gt; data type. MMX instructions are available through &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly&quot;&gt;Assembly&lt;/a&gt; language, &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#InlineAssembly&quot;&gt;inline assembly&lt;/a&gt; and C-Compiler intrinsics along with the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/08x3t697%28v=VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_m64&lt;/a&gt; intrinsic data type &lt;!-- ws:start:WikiTextRefRule:3:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/ccky3awe%28v=VS.100%29.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;MMX Technology Intrinsic Groups&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:3 --&gt; .&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Intel_P5_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Pentium MMX 166 MHz&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:5:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Intel_P5_%28microarchitecture%29&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Intel P5 (microarchitecture) from Wikipedia&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:5 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:40:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:40 --&gt;&lt;!-- ws:start:WikiTextTocRule:41: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Register File&quot;&gt;Register File&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:41 --&gt;&lt;!-- ws:start:WikiTextTocRule:42: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#MMX and 64-bit Windows&quot;&gt;MMX and 64-bit Windows&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:42 --&gt;&lt;!-- ws:start:WikiTextTocRule:43: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Applications&quot;&gt;Applications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:43 --&gt;&lt;!-- ws:start:WikiTextTocRule:44: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-East Fill&quot;&gt;East Fill&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:44 --&gt;&lt;!-- ws:start:WikiTextTocRule:45: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-MMX Popcount&quot;&gt;MMX Popcount&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:45 --&gt;&lt;!-- ws:start:WikiTextTocRule:46: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:46 --&gt;&lt;!-- ws:start:WikiTextTocRule:47: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Manuals&quot;&gt;Manuals&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:47 --&gt;&lt;!-- ws:start:WikiTextTocRule:48: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Manuals-Intel&quot;&gt;Intel&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:48 --&gt;&lt;!-- ws:start:WikiTextTocRule:49: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Manuals-AMD&quot;&gt;AMD&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:49 --&gt;&lt;!-- ws:start:WikiTextTocRule:50: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:50 --&gt;&lt;!-- ws:start:WikiTextTocRule:51: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:51 --&gt;&lt;!-- ws:start:WikiTextTocRule:52: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:52 --&gt;&lt;!-- ws:start:WikiTextTocRule:53: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:53 --&gt;&lt;!-- ws:start:WikiTextTocRule:54: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:54 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:14:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Register File&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:14 --&gt;Register File&lt;/h1&gt;
 MMX uses eight 64-bit registers &lt;strong&gt;MM0&lt;/strong&gt; through &lt;strong&gt;MM7&lt;/strong&gt;, treated each as vector of eight &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;bytes&lt;/a&gt;, four &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;words&lt;/a&gt;, two &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;double words&lt;/a&gt; or one &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;quad word&lt;/a&gt;. The eight registers were aliased for the existing &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/X87&quot; rel=&quot;nofollow&quot;&gt;x87&lt;/a&gt; FPU stack registers, and are therefor implicitly saved and restored during &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Context_switch&quot; rel=&quot;nofollow&quot;&gt;context switch&lt;/a&gt; in existing operating systems. The drawback is, it is somewhat difficult to work with x87 floating point and MMX data in the same application, since the original &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/590b9ks9%28v=VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;emms-instruction&lt;/a&gt; to switch the register file was relatively slow.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:16:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;MMX and 64-bit Windows&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:16 --&gt;MMX and 64-bit Windows&lt;/h1&gt;
 Since 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Windows&quot;&gt;Windows&lt;/a&gt; applications merely use SSE for floating point arithmetic, there was some early confusion whether MMX/x87 registers are safe to use due to context switching. Quote from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&#039;s&lt;/a&gt; Calling conventions manual: &lt;!-- ws:start:WikiTextRefRule:8:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.agner.org/optimize/calling_conventions.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Calling conventions for different C++ compilers and operating systems&amp;lt;/a&amp;gt; (pdf) by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.agner.org/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Agner Fog&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:8 --&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;tt&gt;6.1 Can floating point registers be used in 64-bit Windows?&lt;/tt&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;tt&gt;There has been widespread confusion about whether 64-bit Windows allows the use of the floating point registers ST(0)-ST(7) and the MM0 - MM7 registers that are aliased upon these. One early technical document found at Microsoft&#039;s website says x87/MMX registers are unavailable to Native Windows64 applications&amp;quot; (Rich Brunner: Technical Details Of Microsoft® Windows® For The AMD64 Platform, Dec. 2003). An AMD document says: &amp;quot;64-bit Microsoft Windows does not strongly support MMX and 3Dnow! instruction sets in the 64-bit native mode&amp;quot; (Porting and Optimizing Multimedia Codecs for AMD64 architecture on Microsoft® Windows®, July 21, 2004). A document in Microsoft&#039;s MSDN says: &amp;quot;A caller must also handle the following issues when calling a callee: [...] Legacy Floating-Point Support: The MMX and floating-point stack registers (MM0-MM7/ST0-ST7) are volatile. That is, these legacy floating-point stack registers do not have their state preserved across context switches&amp;quot; (MSDN: Kernel-Mode Driver Architecture: Windows DDK: Other Calling Convention Process Issues. Preliminary, June 14, 2004; February 18, 2005).&lt;/tt&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;tt&gt;This description is nonsense because it confuses saving registers across function calls and saving registers across context switches. Some versions of the Microsoft assembler ml64 (e.g. v. 8.00.40310) gives the following message when attempts are made to use floating point registers in 64 bit mode: &amp;quot;error A2222: x87 and MMX instructions disallowed; legacy  FP state not saved in Win64&amp;quot;. However, a public discussion forum quotes the following answers from Microsoft engineers regarding this issue: &amp;quot;From: Program Manager in Visual C++ Group, Sent: Thursday, May 26, 2005 10:38 AM. It does preserve the state. It&#039;s the DDK page that has stale information, which I&#039;ve requested it to be changed. Let them know that the OS does preserve state of x87 and MMX registers on context switches.&amp;quot; and &amp;quot;From: Software Engineer in Windows Kernel Group, Sent: Thursday, May 26, 2005 11:06 AM. For user threads the state of legacy floating point is preserved at context switch. But it is not true for kernel threads. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Kernel_mode#Supervisor_mode&quot; rel=&quot;nofollow&quot;&gt;Kernel mode&lt;/a&gt; drivers can not use legacy floating point instructions.&amp;quot;&lt;/tt&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;tt&gt;The issue has finally been resolved with the long overdue publication of a more detailed ABI for x64 Windows in the form of a document entitled &amp;quot;x64 Software Conventions&amp;quot;, well hidden in the bin directory (not the help directory) of some compiler packages. This document says: &amp;quot;The MMX and floating-point stack registers (MM0-MM7/ST0-ST7) are preserved across context switches. There is no explicit calling convention for these registers. The use of these registers is strictly prohibited in kernel mode code.&amp;quot; The same text has later appeared at the &lt;a class=&quot;wiki_link&quot; href=&quot;/Microsoft&quot;&gt;Microsoft&lt;/a&gt; website &lt;!-- ws:start:WikiTextRefRule:10:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/a32tsf7t%28v=VS.100%29.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Legacy Floating-Point Support (C++)&amp;lt;/a&amp;gt; from MSDN Library&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:10 --&gt;&lt;/tt&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:18:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Applications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:18 --&gt;Applications&lt;/h1&gt;
 Almost the same &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboard&lt;/a&gt; applications as mentioned in the &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt; application samples are possible with MMX, despite with scalar bitboards rather than vector of two.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:20:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Applications-East Fill&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:20 --&gt;East Fill&lt;/h2&gt;
 For instance &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2#EastAttacks&quot;&gt;East Attacks&lt;/a&gt; based on SIMD-wise &lt;a class=&quot;wiki_link&quot; href=&quot;/Fill%20by%20Subtraction&quot;&gt;Fill by Subtraction&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;__m64 eastAttacks (__m64 occ, __m64 rooks) {&amp;lt;br/&amp;gt;   __m64 tmp;&amp;lt;br/&amp;gt;   occ  = _mm_or_si64 (occ, rooks);  //  make rooks member of occupied&amp;lt;br/&amp;gt;   tmp  = _mm_xor_si64(occ, rooks);  // occ - rooks&amp;lt;br/&amp;gt;   tmp  = _mm_sub_pi8 (tmp, rooks);  // occ - 2*rooks&amp;lt;br/&amp;gt;   return _mm_xor_si64(occ, tmp);    // occ ^ (occ - 2*rooks)&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;__m64 eastAttacks &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m64 occ, __m64 rooks&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   __m64 tmp&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_or_si64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, rooks&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;//  make rooks member of occupied&lt;/span&gt;
   tmp  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_xor_si64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, rooks&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// occ - rooks&lt;/span&gt;
   tmp  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sub_pi8 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;tmp, rooks&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// occ - 2*rooks&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; _mm_xor_si64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, tmp&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;// occ ^ (occ - 2*rooks)&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:55:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@MMXPopcount&amp;quot; title=&amp;quot;Anchor: MMXPopcount&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;MMXPopcount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:55 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:22:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Applications-MMX Popcount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:22 --&gt;MMX Popcount&lt;/h2&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&#039;s&lt;/a&gt; proposed &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;Efficient 64-Bit Population Count&lt;/a&gt; using MMX, 3DNow! and &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#InlineAssembly&quot;&gt;inline assembly&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:12:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://support.amd.com/us/Processor_TechDocs/22007.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AMD Athlon Processor x86 Code Optimization Guide&amp;lt;/a&amp;gt; (pdf) Efficient 64-Bit Population Count Using MMX™ Instructions Page 184&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:12 --&gt; :&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;amp;quot;amd3d.h&amp;amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;__declspec (naked) unsigned int __stdcall popcount64 (unsigned __int64 v)&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   static const __int64 C55 = 0x5555555555555555;&amp;lt;br/&amp;gt;   static const __int64 C33 = 0x3333333333333333;&amp;lt;br/&amp;gt;   static const __int64 C0F = 0x0F0F0F0F0F0F0F0F;&amp;lt;br/&amp;gt;   __asm {&amp;lt;br/&amp;gt;      MOVD      MM0, [ESP+4] ;v_low&amp;lt;br/&amp;gt;      PUNPCKLDQ MM0, [ESP+8] ;v&amp;lt;br/&amp;gt;      MOVQ      MM1, MM0     ;v&amp;lt;br/&amp;gt;      PSRLD     MM0, 1       ;v &amp;amp;gt;&amp;amp;gt; 1&amp;lt;br/&amp;gt;      PAND      MM0, [C55]   ;(v &amp;amp;gt;&amp;amp;gt; 1) &amp;amp;amp; 0x55555555&amp;lt;br/&amp;gt;      PSUBD     MM1, MM0     ;w = v - ((v &amp;amp;gt;&amp;amp;gt; 1) &amp;amp;amp; 0x55555555)&amp;lt;br/&amp;gt;      MOVQ      MM0, MM1     ;w&amp;lt;br/&amp;gt;      PSRLD     MM1, 2       ;w &amp;amp;gt;&amp;amp;gt; 2&amp;lt;br/&amp;gt;      PAND      MM0, [C33]   ;w &amp;amp;amp; 0x33333333&amp;lt;br/&amp;gt;      PAND      MM1, [C33]   ;(w &amp;amp;gt;&amp;amp;gt; 2) &amp;amp;amp; 0x33333333&amp;lt;br/&amp;gt;      PADDD     MM0, MM1     ;x = (w &amp;amp;amp; 0x33333333) + ((w &amp;amp;gt;&amp;amp;gt; 2) &amp;amp;amp; 0x33333333)&amp;lt;br/&amp;gt;      MOVQ      MM1, MM0     ;x&amp;lt;br/&amp;gt;      PSRLD     MM0, 4       ;x &amp;amp;gt;&amp;amp;gt; 4&amp;lt;br/&amp;gt;      PADDD     MM0, MM1     ;x + (x &amp;amp;gt;&amp;amp;gt; 4)&amp;lt;br/&amp;gt;      PAND      MM0, [C0F]   ;y = (x + (x &amp;amp;gt;&amp;amp;gt; 4) &amp;amp;amp; 0x0F0F0F0F)&amp;lt;br/&amp;gt;      PXOR      MM1, MM1     ; 0&amp;lt;br/&amp;gt;      PSADBW    MM0, MM1     ;sum across all 8 bytes&amp;lt;br/&amp;gt;      MOVD      EAX, MM0     ;result in EAX per calling&amp;lt;br/&amp;gt;      ; convention&amp;lt;br/&amp;gt;      FEMMS ;clear MMX state&amp;lt;br/&amp;gt;      RET 8 ;pop 8-byte argument off&amp;lt;br/&amp;gt;   }&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#include &amp;quot;amd3d.h&amp;quot;&lt;/span&gt;
&amp;nbsp;
__declspec &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;naked&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; __stdcall popcount64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; __int64 v&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; __int64 C55 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x5555555555555555&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; __int64 C33 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x3333333333333333&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; __int64 C0F &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x0F0F0F0F0F0F0F0F&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   __asm &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      MOVD      MM0, &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;ESP&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;v_low
      PUNPCKLDQ MM0, &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;ESP&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;v
      MOVQ      MM1, MM0     &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;v
      PSRLD     MM0, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;       &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;v &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
      PAND      MM0, &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;C55&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;   &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x55555555&lt;/span&gt;
      PSUBD     MM1, MM0     &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;w &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; v &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x55555555&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      MOVQ      MM0, MM1     &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;w
      PSRLD     MM1, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;       &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;w &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
      PAND      MM0, &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;C33&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;   &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;w &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x33333333&lt;/span&gt;
      PAND      MM1, &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;C33&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;   &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;w &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x33333333&lt;/span&gt;
      PADDD     MM0, MM1     &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;w &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x33333333&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;w &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x33333333&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      MOVQ      MM1, MM0     &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;x
      PSRLD     MM0, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;       &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;
      PADDD     MM0, MM1     &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      PAND      MM0, &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;C0F&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;   &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;y &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x0F0F0F0F&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      PXOR      MM1, MM1     &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
      PSADBW    MM0, MM1     &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;sum across all &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; bytes
      MOVD      EAX, MM0     &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;result in EAX per calling
      &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; convention
      FEMMS &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;clear MMX state
      RET &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;pop &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;byte argument off
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:24:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:24 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AltiVec&quot;&gt;AltiVec&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:26:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Manuals&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:26 --&gt;Manuals&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:28:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Manuals-Intel&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:28 --&gt;Intel&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;ftp://download.intel.com/design/PentiumII/manuals/24319002.PDF&quot; rel=&quot;nofollow&quot;&gt;Intel Architecture Software Developer’s Manual, Volume 1: Basic Architecture&lt;/a&gt; (pdf)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:30:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Manuals-AMD&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:30 --&gt;AMD&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/22007.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD Athlon Processor x86 Code Optimization Guide&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/21928.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD 3DNow! Technology Manual TM&lt;/a&gt; (pdf)&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/26569_APM_v5.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD64 Architecture Volume 5: 64-Bit Media and x87 Floating-Point Instructions&lt;/a&gt; (pdf)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:32:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:32 --&gt;Forum Posts&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/312f0fd0558723c2&quot; rel=&quot;nofollow&quot;&gt;Using mmx instructions&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Frans%20Morsch&quot;&gt;Frans Morsch&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/topics&quot; rel=&quot;nofollow&quot;&gt;comp.lang.asm.x86&lt;/a&gt;, February 03, 2000&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/ab55c5d57a3a1fd1&quot; rel=&quot;nofollow&quot;&gt;Re: Atomic write of 64 bits&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Frans%20Morsch&quot;&gt;Frans Morsch&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/topics&quot; rel=&quot;nofollow&quot;&gt;comp.lang.asm.x86&lt;/a&gt;, September 25, 2000&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=281989&quot; rel=&quot;nofollow&quot;&gt;Re: Chezzz 1.0.1 - problem solved - for David Rasmussen&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/David%20Rasmussen&quot;&gt;David Rasmussen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 05, 2003 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;Population Count&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Chezzz&quot;&gt;Chezzz&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:34:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc10&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:34 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/MMX_%28instruction_set%29&quot; rel=&quot;nofollow&quot;&gt;MMX (instruction set) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ccky3awe%28v=VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;MMX Technology Intrinsic Groups&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://webster.cs.ucr.edu/AoA/Windows/HTML/TheMMXInstructionSet.html&quot; rel=&quot;nofollow&quot;&gt;Chapter Eleven - The MMX Instruction Set&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://homepage.mac.com/randyhyde/webster.cs.ucr.edu/index.html&quot; rel=&quot;nofollow&quot;&gt;The Art of Assembly Language Programming and HLA&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Randall_Hyde&quot; rel=&quot;nofollow&quot;&gt;Randall Hyde&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/#manuals&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&#039;s manuals&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/blog/&quot; rel=&quot;nofollow&quot;&gt;Agner`s CPU blog&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/landingpage/IntrinsicsGuide/&quot; rel=&quot;nofollow&quot;&gt;Intel Intrinsics Guide&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:36:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc11&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:36 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:226:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ccky3awe%28v=VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;MMX Technology Intrinsic Groups&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Intel_P5_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Intel P5 (microarchitecture) from Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/calling_conventions.pdf&quot; rel=&quot;nofollow&quot;&gt;Calling conventions for different C++ compilers and operating systems&lt;/a&gt; (pdf) by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/a32tsf7t%28v=VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;Legacy Floating-Point Support (C++)&lt;/a&gt; from MSDN Library&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/22007.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD Athlon Processor x86 Code Optimization Guide&lt;/a&gt; (pdf) Efficient 64-Bit Population Count Using MMX™ Instructions Page 184&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:226 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:38:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc12&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:38 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:02:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;MMX&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;MMX&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-MMX includeBody-MMX includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Aart+Bik&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Aart Bik&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AltiVec&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AltiVec&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AMD&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AMD&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Axon&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Axon&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 14, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Byte&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Byte&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chezzz&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chezzz&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/David+Rasmussen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;David Rasmussen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Float&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Float&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Frans+Morsch&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Frans Morsch&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Freccia&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Freccia&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gunnar+Andersson&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gunnar Andersson&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 23, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/HansDamf&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;HansDamf&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/i860&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;i860&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 21, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Intel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Intel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MMX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MMX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Othello&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Othello&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Papa&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Papa&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 11, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Population+Count&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Population Count&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rabbit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rabbit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 5, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Reverse+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Reverse Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Transposition+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Transposition Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Windows&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Windows&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 2, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:02 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Population Count</title>
      <link>https://chessprogramming.wikispaces.com/Population+Count</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Population+Count</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Population+Count</comments>
      <pubDate>Sun, 03 Sep 2017 19:37:48 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Board%20Representation&quot;&gt;Board Representation&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; * Population Count&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:608:&amp;lt;a href=&amp;quot;https://en.wikipedia.org/wiki/File:Hamming.jpg&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Hamming.jpg/403003318/Hamming.jpg&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/File:Hamming.jpg&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Hamming.jpg/403003318/Hamming.jpg&quot; alt=&quot;Hamming.jpg&quot; title=&quot;Hamming.jpg&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:608 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;Population count&lt;/strong&gt; determines the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Cardinality&quot; rel=&quot;nofollow&quot;&gt;cardinality&lt;/a&gt; of a bitboard, also called &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Hamming_weight&quot; rel=&quot;nofollow&quot;&gt;Hamming weight&lt;/a&gt; or sideways sum &lt;!-- ws:start:WikiTextRefRule:48:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Cryptography&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Cryptography&amp;lt;/a&amp;gt; is also a significant application of the /R function symbol, which counts the number of one bits in a word; Turing refers to this as the &amp;amp;quot;sideways adder&amp;amp;quot; in his quick-reference summary. from &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Alan%20Turing&amp;quot;&amp;gt;Alan Turing&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1949&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.computerhistory.org/chess/full_record.php?iid=doc-431614f45472f&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Alan Turing&#039;s Manual for the Ferranti Mk. I&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;. transcribed in 2000 by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.panix.com/~rst/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Robert Thau&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://archive.computerhistory.org/projects/chess/related_materials/text/2-1.Ferranti_Mark_1_manual.Turing-Alan/2-1.Ferranti_Mark_1_manual.Turing-Alan.1951.UNIVERSITY_OF_MANCHESTER.062303005.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;pdf&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/The%20Computer%20History%20Museum&amp;quot;&amp;gt;The Computer History Museum&amp;lt;/a&amp;gt;, 9.4 The position of the most significant digit  » &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Ferranti%20Mark%201&amp;quot;&amp;gt;Ferranti Mark 1&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:48 --&gt;. How many one bits exists in a 64-bit computer word? In computer chess, population count is used to &lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation&quot;&gt;evaluate&lt;/a&gt; the &lt;a class=&quot;wiki_link&quot; href=&quot;/Mobility&quot;&gt;mobility&lt;/a&gt; of pieces from their &lt;a class=&quot;wiki_link&quot; href=&quot;/Attacks&quot;&gt;attack sets&lt;/a&gt;, as &lt;a class=&quot;wiki_link&quot; href=&quot;/CDC%20Cyber#Mobility&quot;&gt;already applied&lt;/a&gt; in &lt;a class=&quot;wiki_link&quot; href=&quot;/Chess%20%28Program%29&quot;&gt;Chess 4.6&lt;/a&gt; on the &lt;a class=&quot;wiki_link&quot; href=&quot;/CDC%206600&quot;&gt;CDC 6600&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/CDC%20Cyber&quot;&gt;CDC Cyber&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Future or recent &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; processors (&lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AMD_K10&quot; rel=&quot;nofollow&quot;&gt;K10&lt;/a&gt; - &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4#SSE4a&quot;&gt;SSE4a&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Nehalem_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Nehalem&lt;/a&gt; - &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4#SSE4.2&quot;&gt;SSE4.2&lt;/a&gt;) provide a &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;64-bit popcount instruction&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:51:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/en-us/articles/extending-the-worlds-most-popular-processor-architecture&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Extending the World’s Most Popular Processor Architecture&amp;lt;/a&amp;gt; by R.M. Ramanathan, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Intel&amp;quot;&amp;gt;Intel&amp;lt;/a&amp;gt;, covers SSE4 and popcnt&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:51 --&gt;, available via &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; compiler intrinsic &lt;!-- ws:start:WikiTextRefRule:53:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/bb531475%28v=vs.100%29.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_mm_popcnt_u64&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:53 --&gt;&lt;!-- ws:start:WikiTextRefRule:55:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/bb385231%28v=vs.100%29.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;_popcnt16, _popcnt, _popcnt64&amp;lt;/a&amp;gt; C-Intrinsic MSDN Library&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:55 --&gt;&lt;!-- ws:start:WikiTextRefRule:57:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/lin/compiler_c/intref_cls/common/intref_allia_misc.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Miscellaneous Intrinsic&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:57 --&gt;&lt;!-- ws:start:WikiTextRefRule:60:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Other-Builtins.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;__builtin_popcountll&amp;lt;/a&amp;gt; &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Free%20Software%20Foundation#GCC&amp;quot;&amp;gt;GCC&amp;lt;/a&amp;gt; Intrinsic&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:60 --&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#InlineAssembly&quot;&gt;inline assembly&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:64:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=32227&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Stockfish POPCNT support with gcc&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Marco%20Costalba&amp;quot;&amp;gt;Marco Costalba&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, January 31, 2010&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:64 --&gt;. Despite different Intrinsic prototypes (_mm_popcnt_u64 vs. popcnt64), Intel and AMD popcnt instructions are binary compatible, have same encoding (F3 [REX] 0F B8 /r), and both require bit 23 set in RCX of the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/CPUID&quot; rel=&quot;nofollow&quot;&gt;CPUID&lt;/a&gt; function 0000_0001h.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Visualization of &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#HammingDistance&quot;&gt;Hamming distance&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:67:&amp;amp;lt;ref&amp;amp;gt;Color of each pixel is &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Hamming_distance&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Hamming distance&amp;lt;/a&amp;gt; between the binary representations of its x and y coordinates, modulo 16, in the 16-color system, by Josiedraus, June 8, 2007, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Richard_Hamming&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Richard Hamming from Wikipedia&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-8&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:67 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:start:WikiTextTocRule:275:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:275 --&gt;&lt;!-- ws:start:WikiTextTocRule:276: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Recurrence Relation&quot;&gt;Recurrence Relation&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:276 --&gt;&lt;!-- ws:start:WikiTextTocRule:277: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Empty or Single?&quot;&gt;Empty or Single?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:277 --&gt;&lt;!-- ws:start:WikiTextTocRule:278: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Empty or Single?-Empty Bitboards&quot;&gt;Empty Bitboards&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:278 --&gt;&lt;!-- ws:start:WikiTextTocRule:279: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Empty or Single?-Single Populated Bitboards&quot;&gt;Single Populated Bitboards&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:279 --&gt;&lt;!-- ws:start:WikiTextTocRule:280: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Loop-Approaches&quot;&gt;Loop-Approaches&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:280 --&gt;&lt;!-- ws:start:WikiTextTocRule:281: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Loop-Approaches-Too Slow&quot;&gt;Too Slow&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:281 --&gt;&lt;!-- ws:start:WikiTextTocRule:282: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Loop-Approaches-Brian Kernighan&#039;s way&quot;&gt;Brian Kernighan&#039;s way&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:282 --&gt;&lt;!-- ws:start:WikiTextTocRule:283: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Lookup&quot;&gt;Lookup&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:283 --&gt;&lt;!-- ws:start:WikiTextTocRule:284: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount&quot;&gt;SWAR-Popcount&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:284 --&gt;&lt;!-- ws:start:WikiTextTocRule:285: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-Counting Duo-Bits&quot;&gt;Counting Duo-Bits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:285 --&gt;&lt;!-- ws:start:WikiTextTocRule:286: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-Counting Nibble-Bits&quot;&gt;Counting Nibble-Bits&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:286 --&gt;&lt;!-- ws:start:WikiTextTocRule:287: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-Byte-Counts&quot;&gt;Byte-Counts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:287 --&gt;&lt;!-- ws:start:WikiTextTocRule:288: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-Adding the Byte-Counts&quot;&gt;Adding the Byte-Counts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:288 --&gt;&lt;!-- ws:start:WikiTextTocRule:289: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-Adding the Byte-Counts-Parallel Prefix Adds&quot;&gt;Parallel Prefix Adds&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:289 --&gt;&lt;!-- ws:start:WikiTextTocRule:290: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-Adding the Byte-Counts-Multiplication&quot;&gt;Multiplication&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:290 --&gt;&lt;!-- ws:start:WikiTextTocRule:291: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-Adding the Byte-Counts-Casting out&quot;&gt;Casting out&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:291 --&gt;&lt;!-- ws:start:WikiTextTocRule:292: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-The PopCount routine&quot;&gt;The PopCount routine&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:292 --&gt;&lt;!-- ws:start:WikiTextTocRule:293: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-The PopCount routine-The Constants&quot;&gt;The Constants&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:293 --&gt;&lt;!-- ws:start:WikiTextTocRule:294: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-The PopCount routine-popCount&quot;&gt;popCount&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:294 --&gt;&lt;!-- ws:start:WikiTextTocRule:295: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-The PopCount routine-slowmul_popCount&quot;&gt;slowmul_popCount&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:295 --&gt;&lt;!-- ws:start:WikiTextTocRule:296: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#SWAR-Popcount-HAKMEM 169&quot;&gt;HAKMEM 169&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:296 --&gt;&lt;!-- ws:start:WikiTextTocRule:297: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Miscellaneous&quot;&gt;Miscellaneous&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:297 --&gt;&lt;!-- ws:start:WikiTextTocRule:298: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Miscellaneous-Cardinality of Multiple Sets&quot;&gt;Cardinality of Multiple Sets&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:298 --&gt;&lt;!-- ws:start:WikiTextTocRule:299: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Miscellaneous-Cardinality of Multiple Sets-Odd and Major 7-15&quot;&gt;Odd and Major 7-15&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:299 --&gt;&lt;!-- ws:start:WikiTextTocRule:300: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Miscellaneous-Cardinality of Multiple Sets-Odd and Major Digit Counts&quot;&gt;Odd and Major Digit Counts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:300 --&gt;&lt;!-- ws:start:WikiTextTocRule:301: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Miscellaneous-Popcount as log2 of LS1B&quot;&gt;Popcount as log2 of LS1B&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:301 --&gt;&lt;!-- ws:start:WikiTextTocRule:302: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Miscellaneous-Hamming Distance&quot;&gt;Hamming Distance&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:302 --&gt;&lt;!-- ws:start:WikiTextTocRule:303: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Miscellaneous-Weighted PopCount&quot;&gt;Weighted PopCount&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:303 --&gt;&lt;!-- ws:start:WikiTextTocRule:304: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Miscellaneous-Pre-calculated Mobility&quot;&gt;Pre-calculated Mobility&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:304 --&gt;&lt;!-- ws:start:WikiTextTocRule:305: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Miscellaneous-Piece Attacks Count&quot;&gt;Piece Attacks Count&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:305 --&gt;&lt;!-- ws:start:WikiTextTocRule:306: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Popcount in Hardware&quot;&gt;Popcount in Hardware&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:306 --&gt;&lt;!-- ws:start:WikiTextTocRule:307: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:307 --&gt;&lt;!-- ws:start:WikiTextTocRule:308: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Publications&quot;&gt;Publications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:308 --&gt;&lt;!-- ws:start:WikiTextTocRule:309: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Publications-1949 ...&quot;&gt;1949 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:309 --&gt;&lt;!-- ws:start:WikiTextTocRule:310: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Publications-2000 ...&quot;&gt;2000 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:310 --&gt;&lt;!-- ws:start:WikiTextTocRule:311: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Publications-2010 ...&quot;&gt;2010 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:311 --&gt;&lt;!-- ws:start:WikiTextTocRule:312: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Postings&quot;&gt;Postings&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:312 --&gt;&lt;!-- ws:start:WikiTextTocRule:313: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Postings-1998 ...&quot;&gt;1998 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:313 --&gt;&lt;!-- ws:start:WikiTextTocRule:314: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Postings-2000 ...&quot;&gt;2000 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:314 --&gt;&lt;!-- ws:start:WikiTextTocRule:315: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Postings-2005 ...&quot;&gt;2005 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:315 --&gt;&lt;!-- ws:start:WikiTextTocRule:316: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Postings-2010 ...&quot;&gt;2010 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:316 --&gt;&lt;!-- ws:start:WikiTextTocRule:317: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Postings-2015 ...&quot;&gt;2015 ...&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:317 --&gt;&lt;!-- ws:start:WikiTextTocRule:318: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:318 --&gt;&lt;!-- ws:start:WikiTextTocRule:319: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:319 --&gt;&lt;!-- ws:start:WikiTextTocRule:320: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:320 --&gt;&lt;!-- ws:start:WikiTextTocRule:321: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:321 --&gt;&lt;em&gt;Code samples in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; / &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt;, see &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards#DefiningBitboards&quot;&gt;Defining Bitboards&lt;/a&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:185:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Recurrence Relation&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:185 --&gt;Recurrence Relation&lt;/h1&gt;
The &lt;a class=&quot;wiki_link&quot; href=&quot;/Recursion&quot;&gt;recursive&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Recurrence_relation&quot; rel=&quot;nofollow&quot;&gt;recurrence relation&lt;/a&gt; of population counts can be transformed to iteration as well, but lacks an arithmetical sum-formula:&lt;br /&gt;
&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:31:
[[math]]&amp;lt;br/&amp;gt;
 popcnt(0) = 0&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; popcnt(0) = 0&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:31 --&gt;&lt;/li&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:32:
[[math]]&amp;lt;br/&amp;gt;
 popcnt(n) = {popcnt({n} \div {2}) + ({n} \mod {2})}&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; popcnt(n) = {popcnt({n} \div {2}) + ({n} \mod {2})}&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:32 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
However, it is helpful to initialize a &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#Lookup&quot;&gt;lookup table&lt;/a&gt;, i.e. for bytes: &lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;unsigned char popCountOfByte256[];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;void initpopCountOfByte256()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   popCountOfByte256[0] = 0;&amp;lt;br/&amp;gt;   for (int i = 1; i &amp;amp;lt; 256; i++)&amp;lt;br/&amp;gt;      popCountOfByte256[i] = popCountOfByte256[i / 2] + (i &amp;amp;amp; 1);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; initpopCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i &lt;span class=&quot;sy2&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:187:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Empty or Single?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:187 --&gt;Empty or Single?&lt;/h1&gt;
 Often one has to deal with sparsely populated or even empty bitboards. To determine whether a bitboard is empty or a single populated power of two value, one may use simple boolean statements rather than a complete population count.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:322:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@EmptyBitboards&amp;quot; title=&amp;quot;Anchor: EmptyBitboards&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;EmptyBitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:322 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:189:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Empty or Single?-Empty Bitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:189 --&gt;Empty Bitboards&lt;/h2&gt;
 To test a bitboard is empty, one compares it with zero, or use the logical not operator:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;if ( x == 0 ) -&amp;amp;gt; bitboard is empty&amp;lt;br/&amp;gt;if ( !x )     -&amp;amp;gt; bitboard is empty&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;if ( x == 0 ) -&amp;gt; bitboard is empty
if ( !x )     -&amp;gt; bitboard is empty&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;The inverse condition (not empty) is of course&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;if ( x != 0 ) -&amp;amp;gt; bitboard is not empty&amp;lt;br/&amp;gt;if ( x )      -&amp;amp;gt; bitboard is not empty&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;if ( x != 0 ) -&amp;gt; bitboard is not empty
if ( x )      -&amp;gt; bitboard is not empty&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:323:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@SinglePopulatedBitboards&amp;quot; title=&amp;quot;Anchor: SinglePopulatedBitboards&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;SinglePopulatedBitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:323 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:191:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Empty or Single?-Single Populated Bitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:191 --&gt;Single Populated Bitboards&lt;/h2&gt;
 If the bitboard is not empty, we can &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BSeparation&quot;&gt;extract&lt;/a&gt; the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;LS1B&lt;/a&gt; to look whether it is equal with the bitboard. Alternatively and faster, we can &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BReset&quot;&gt;reset the LS1B&lt;/a&gt; to look whether the bitboard becomes empty.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;if ( x != 0 &amp;amp;amp;&amp;amp;amp; (x &amp;amp;amp; (x-1)) == 0 ) -&amp;amp;gt; population count is one, power of two value&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;if ( x != 0 &amp;amp;&amp;amp; (x &amp;amp; (x-1)) == 0 ) -&amp;gt; population count is one, power of two value&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;One can skip the leading x != 0 condition to test popcount &amp;lt;= 1:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;if ( (x &amp;amp;amp; (x-1)) == 0 ) -&amp;amp;gt; population count is less or equal than one&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;if ( (x &amp;amp; (x-1)) == 0 ) -&amp;gt; population count is less or equal than one&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;Again the inverse relation tests, whether a bitboard has more than one bit set:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;if ( x &amp;amp;amp; (x-1) ) -&amp;amp;gt; population count is greater than one&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;if ( x &amp;amp; (x-1) ) -&amp;gt; population count is greater than one&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;An alternative approach to determine single populated sets, aka power of two values is based on &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BSeparation&quot;&gt;Inclusive LS1B separation&lt;/a&gt; divided by two equals the ones&#039; decrement &lt;!-- ws:start:WikiTextRefRule:70:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.jjj.de/fxt/fxtbook.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Matters Computational - ideas, algorithms, source code&amp;lt;/a&amp;gt; (pdf) Ideas and Source Code by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#Arndt&amp;quot;&amp;gt;Jörg Arndt&amp;lt;/a&amp;gt;, 1.7 Functions related to the base-2 logarithm, function one_bit_q(), pp 18&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-9&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-9&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:70 --&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;if ( ((x ^ (x-1)) &amp;amp;gt;&amp;amp;gt; 1) == (x-1) ) -&amp;amp;gt; population count is one, power of two value&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;if ( ((x ^ (x-1)) &amp;gt;&amp;gt; 1) == (x-1) ) -&amp;gt; population count is one, power of two value&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:193:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Loop-Approaches&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:193 --&gt;Loop-Approaches&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextAnchorRule:324:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@TooSlow&amp;quot; title=&amp;quot;Anchor: TooSlow&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;TooSlow&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:324 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:195:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Loop-Approaches-Too Slow&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:195 --&gt;Too Slow&lt;/h2&gt;
 Brute force adding all 64-bits&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int popCount (U64 x) {&amp;lt;br/&amp;gt;   int count = 0;&amp;lt;br/&amp;gt;   for (int i = 0; i &amp;amp;lt; 64; i++, x &amp;amp;gt;&amp;amp;gt;= 1)&amp;lt;br/&amp;gt;      count += (int)x &amp;amp;amp; 1;&amp;lt;br/&amp;gt;   return count;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; popCount &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; count &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;, x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      count &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; count&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;Of course, this is a slow algorithm, which might be improved by testing x not empty rather than i &amp;lt; 64. But unrolled in &lt;a class=&quot;wiki_link&quot; href=&quot;/Parallel%20Prefix%20Algorithms&quot;&gt;parallel prefix&lt;/a&gt; manner it already reminds on &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#SWARPopcount&quot;&gt;this one&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:325:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BrianKernighansway&amp;quot; title=&amp;quot;Anchor: BrianKernighansway&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BrianKernighansway&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:325 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:197:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Loop-Approaches-Brian Kernighan&#039;s way&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:197 --&gt;Brian Kernighan&#039;s way&lt;/h2&gt;
 Consecutively &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BReset&quot;&gt;reset LS1B&lt;/a&gt; in a loop body and counting loop cycles until the bitset becomes empty. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Brian_Kernighan&quot; rel=&quot;nofollow&quot;&gt;Brian Kernighan&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:74:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www-graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Counting bits set, Brian Kernighan&#039;s way&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://graphics.stanford.edu/%7Eseander/bithacks.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Bit Twiddling Hacks&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://graphics.stanford.edu/%7Eseander/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Sean Eron Anderson&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-10&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-10&quot;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:74 --&gt; mentioned the trick in his and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Dennis_Ritchie&quot; rel=&quot;nofollow&quot;&gt;Ritchie&#039;s&lt;/a&gt; book &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/The_C_Programming_Language_%28book%29&quot; rel=&quot;nofollow&quot;&gt;The C Programming_Language&lt;/a&gt;, 2nd Edition 1988, exercise 2-9. However, the method was first published in 1960 by &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#PWegner&quot;&gt;Peter Wegner&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:82:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#PWegner&amp;quot;&amp;gt;Peter Wegner&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1960&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;A technique for counting ones in a binary computer&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/ACM#Communications&amp;quot;&amp;gt;Communications of the ACM&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.informatik.uni-trier.de/~ley/db/journals/cacm/cacm3.html#Wegner60&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Volume 3, 1960&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-11&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-11&quot;&gt;[11]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:82 --&gt;, discovered independently by &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#DHLehmer&quot;&gt;Derrick Henry Lehmer&lt;/a&gt;, published in 1964 &lt;!-- ws:start:WikiTextRefRule:90:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#EFBeckenbach&amp;quot;&amp;gt;Edwin Ford Beckenbach&amp;lt;/a&amp;gt; (editor) (&amp;lt;strong&amp;gt;1964&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://onlinelibrary.wiley.com/doi/10.1002/bimj.19660080310/abstract&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Applied combinatorial mathematics&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/John_Wiley_%26_Sons&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;John Wiley&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-12&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-12&quot;&gt;[12]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:90 --&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int popCount (U64 x) {&amp;lt;br/&amp;gt;   int count = 0;&amp;lt;br/&amp;gt;   while (x) {&amp;lt;br/&amp;gt;       count++;&amp;lt;br/&amp;gt;       x &amp;amp;amp;= x - 1; // reset LS1B&amp;lt;br/&amp;gt;   }&amp;lt;br/&amp;gt;   return count;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; popCount &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; count &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
       count&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
       x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// reset LS1B&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; count&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;Despite branches - this is still one of the fastest approaches for sparsely populated bitboards. Of course the more bits that are set, the longer it takes.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:326:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Lookup&amp;quot; title=&amp;quot;Anchor: Lookup&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Lookup&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:326 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:199:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Lookup&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:199 --&gt;Lookup&lt;/h1&gt;
 Of course we can not use the whole bitboard as index to a lookup table - since it&#039;s size would be 18,446,744,073,709,551,616 bytes! If it is about the population count of a byte, we can simply construct a table lookup with 256 elements. For a bitboard that takes eight byte lookups we can add together:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;unsigned char popCountOfByte256[];&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;void initpopCountOfByte256()&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   popCountOfByte256[0] = 0;&amp;lt;br/&amp;gt;   for (int i = 1; i &amp;amp;lt; 256; i++)&amp;lt;br/&amp;gt;      popCountOfByte256[i] = popCountOfByte256[i / 2] + (i &amp;amp;amp; 1);&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;int popCount (U64 x) {&amp;lt;br/&amp;gt;   return popCountOfByte256[ x        &amp;amp;amp; 0xff] +&amp;lt;br/&amp;gt;          popCountOfByte256[(x &amp;amp;gt;&amp;amp;gt;  8) &amp;amp;amp; 0xff] +&amp;lt;br/&amp;gt;          popCountOfByte256[(x &amp;amp;gt;&amp;amp;gt; 16) &amp;amp;amp; 0xff] +&amp;lt;br/&amp;gt;          popCountOfByte256[(x &amp;amp;gt;&amp;amp;gt; 24) &amp;amp;amp; 0xff] +&amp;lt;br/&amp;gt;          popCountOfByte256[(x &amp;amp;gt;&amp;amp;gt; 32) &amp;amp;amp; 0xff] +&amp;lt;br/&amp;gt;          popCountOfByte256[(x &amp;amp;gt;&amp;amp;gt; 40) &amp;amp;amp; 0xff] +&amp;lt;br/&amp;gt;          popCountOfByte256[(x &amp;amp;gt;&amp;amp;gt; 48) &amp;amp;amp; 0xff] +&amp;lt;br/&amp;gt;          popCountOfByte256[ x &amp;amp;gt;&amp;amp;gt; 56];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; initpopCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
      popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i &lt;span class=&quot;sy2&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; popCount &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; x        &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;48&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xff&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;Looks quite expensive - one may use four 16-bit word-lookups with a pre-calculated 64KByte table though, but that pollutes the memory caches quite a bit. One can also treat the bitboard as &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;array&lt;/a&gt; of bytes or words in memory, since endian issues don&#039;t care here - that safes all the shifts and &#039;ands&#039;, but has to read byte for byte from memory.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int popCount (U64 x) {&amp;lt;br/&amp;gt;   unsigned char * p = (unsigned char *) &amp;amp;amp;x;&amp;lt;br/&amp;gt;   return popCountOfByte256[p[0]] +&amp;lt;br/&amp;gt;          popCountOfByte256[p[1]] +&amp;lt;br/&amp;gt;          popCountOfByte256[p[2]] +&amp;lt;br/&amp;gt;          popCountOfByte256[p[3]] +&amp;lt;br/&amp;gt;          popCountOfByte256[p[4]] +&amp;lt;br/&amp;gt;          popCountOfByte256[p[5]] +&amp;lt;br/&amp;gt;          popCountOfByte256[p[6]] +&amp;lt;br/&amp;gt;          popCountOfByte256[p[7]];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; popCount &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; p &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;x&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;p&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;p&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;p&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;p&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;p&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;p&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;p&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;
          popCountOfByte256&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;p&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:327:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@SWARPopcount&amp;quot; title=&amp;quot;Anchor: SWARPopcount&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;SWARPopcount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:327 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:201:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;SWAR-Popcount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:201 --&gt;SWAR-Popcount&lt;/h1&gt;
 The &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Divide_and_conquer_algorithm&quot; rel=&quot;nofollow&quot;&gt;divide and conquer&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SWAR-approach&lt;/a&gt; deals with counting bits of duos, to aggregate the duo-counts to &lt;a class=&quot;wiki_link&quot; href=&quot;/Nibble&quot;&gt;nibbles&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;bytes&lt;/a&gt; inside one 64-bit register in parallel, to finally sum all bytes together. According to &lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Donald Knuth&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:98:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Donald%20Knuth&amp;quot;&amp;gt;Donald Knuth&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2009&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The Art of Computer Programming&amp;lt;/a&amp;gt;, Volume 4, Fascicle 1: Bitwise tricks &amp;amp;amp; techniques&amp;lt;/em&amp;gt;, as &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www-cs-faculty.stanford.edu/%7Eknuth/fasc1a.ps.gz&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Pre-Fascicle 1a postscript&amp;lt;/a&amp;gt;, Sideways addition, p 11&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-13&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-13&quot;&gt;[13]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:98 --&gt;, a parallel population count routine was already introduced in 1957 due to &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#DBGillies&quot;&gt;Donald B. Gillies&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/J._C._P._Miller&quot; rel=&quot;nofollow&quot;&gt;Jeffrey C. P. Miller&lt;/a&gt; in the first textbook on programming, second edition: &lt;em&gt;The Preparation of Programs for an Electronic Digital Computer&lt;/em&gt;, by &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#MVWilkes&quot;&gt;Maurice Wilkes&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#DJWheeler&quot;&gt;David Wheeler&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Stanley_Gill&quot; rel=&quot;nofollow&quot;&gt;Stanley Gill&lt;/a&gt;, pages 191–193 &lt;!-- ws:start:WikiTextRefRule:108:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#MVWilkes&amp;quot;&amp;gt;Maurice Wilkes&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#DJWheeler&amp;quot;&amp;gt;David Wheeler&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Stanley_Gill&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Stanley Gill&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1951&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;The Preparation of Programs for an Electronic Digital Computer&amp;lt;/em&amp;gt;. Addison-Wesley Press; 1st edition, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.amazon.com/preparation-programs-electronic-digital-computer/dp/B0007DWTT0&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;amazon.com&amp;lt;/a&amp;gt;; 2nd edition 1957, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.amazon.com/preparation-programs-electronic-Addison-Wesley-mathematics/dp/B0006AV1QQ&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;amazon.com&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-14&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-14&quot;&gt;[14]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:108 --&gt; &lt;!-- ws:start:WikiTextRefRule:110:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Electronic_Delay_Storage_Automatic_Calculator&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Electronic Delay Storage Automatic Calculator from Wikipedia&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-15&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-15&quot;&gt;[15]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:110 --&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:203:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc9&quot;&gt;&lt;a name=&quot;SWAR-Popcount-Counting Duo-Bits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:203 --&gt;Counting Duo-Bits&lt;/h2&gt;
 A bit-duo (two neighboring bits) can be interpreted with bit 0 = a, and bit 1 = b as&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:33:
[[math]]&amp;lt;br/&amp;gt;
duo := 2b + a&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;duo := 2b + a&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:33 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
The duo population is&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:34:
[[math]]&amp;lt;br/&amp;gt;
popcnt(duo) := b + a&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;popcnt(duo) := b + a&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:34 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
which can be archived by&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:35:
[[math]]&amp;lt;br/&amp;gt;
(2b + a) - {(2b + a)} \div {2}&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;(2b + a) - {(2b + a)} \div {2}&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:35 --&gt;&lt;/li&gt;&lt;/ul&gt;or&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:36:
[[math]]&amp;lt;br/&amp;gt;
(2b + a) - b&amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt;(2b + a) - b&lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:36 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
The bit-duo has up to four states with population count from zero to two as demonstrated in following table with binary digits:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;x&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;-&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;x div 2&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;→&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;popcnt(x)&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;00&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;-&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;00&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;→&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;00&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;01&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;-&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;00&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;→&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;01&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;10&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;-&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;01&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;→&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;01&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;11&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;-&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;01&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;→&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;10&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

Only the lower bit is needed from x div 2 - and one don&#039;t has to worry about borrows from neighboring duos. SWAR-wise, one needs to clear all &amp;quot;even&amp;quot; bits of the div 2 subtrahend to perform a 64-bit subtraction of all 32 duos:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;x = x - ((x &amp;amp;gt;&amp;amp;gt; 1) &amp;amp;amp; 0x5555555555555555);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;x = x - ((x &amp;gt;&amp;gt; 1) &amp;amp; 0x5555555555555555);&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;Note that the popcount-result of the bit-duos still takes two bits.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:205:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc10&quot;&gt;&lt;a name=&quot;SWAR-Popcount-Counting Nibble-Bits&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:205 --&gt;Counting Nibble-Bits&lt;/h2&gt;
 The next step is to add the duo-counts to populations of four neighboring bits, the 16 nibble-counts, which may range from zero to four. SWAR-wise it is done by masking odd and even duo-counts to add them together:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:12:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt; x = (x &amp;amp;amp; 0x3333333333333333) + ((x &amp;amp;gt;&amp;amp;gt; 2) &amp;amp;amp; 0x3333333333333333);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt; x = (x &amp;amp; 0x3333333333333333) + ((x &amp;gt;&amp;gt; 2) &amp;amp; 0x3333333333333333);&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:12 --&gt;Note that the popcount-result of the nibbles takes only three bits, since 100B is the maximum population (of the nibble 1111B).&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:207:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc11&quot;&gt;&lt;a name=&quot;SWAR-Popcount-Byte-Counts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:207 --&gt;Byte-Counts&lt;/h2&gt;
 You already got the idea? Now it is about to get the byte-populations from two nibble-populations. Maximum byte-population of 1000B only takes four bits, so it is safe to mask all those four bits of the sum, rather than to mask the summands:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:13:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;x = (x + (x &amp;amp;gt;&amp;amp;gt; 4)) &amp;amp;amp; 0x0f0f0f0f0f0f0f0f;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;x = (x + (x &amp;gt;&amp;gt; 4)) &amp;amp; 0x0f0f0f0f0f0f0f0f;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:13 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:209:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc12&quot;&gt;&lt;a name=&quot;SWAR-Popcount-Adding the Byte-Counts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:209 --&gt;Adding the Byte-Counts&lt;/h2&gt;
&lt;!-- ws:start:WikiTextHeadingRule:211:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc13&quot;&gt;&lt;a name=&quot;SWAR-Popcount-Adding the Byte-Counts-Parallel Prefix Adds&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:211 --&gt;Parallel Prefix Adds&lt;/h3&gt;
We may continue with mask-less &lt;a class=&quot;wiki_link&quot; href=&quot;/Parallel%20Prefix%20Algorithms&quot;&gt;parallel prefix&lt;/a&gt; SWAR-adds for byte-counts, word-counts and finally double-word-counts, to mask the least significant 8 (or 7) bits for final result in the 0..64 range:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:14:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;x += (x &amp;amp;gt;&amp;amp;gt;  8);&amp;lt;br/&amp;gt;x += (x &amp;amp;gt;&amp;amp;gt; 16);&amp;lt;br/&amp;gt;x += (x &amp;amp;gt;&amp;amp;gt; 32);&amp;lt;br/&amp;gt;return x &amp;amp;amp; 255;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;x += (x &amp;gt;&amp;gt;  8);
x += (x &amp;gt;&amp;gt; 16);
x += (x &amp;gt;&amp;gt; 32);
return x &amp;amp; 255;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:14 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:328:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Multiplication&amp;quot; title=&amp;quot;Anchor: Multiplication&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Multiplication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:328 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:213:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc14&quot;&gt;&lt;a name=&quot;SWAR-Popcount-Adding the Byte-Counts-Multiplication&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:213 --&gt;Multiplication&lt;/h3&gt;
With todays fast 64-bit multiplication one can multiply the vector of 8-byte-counts with 0x0101010101010101 to get the final result in the most significant byte, which is then shifted right:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:15:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;x = (x * 0x0101010101010101) &amp;amp;gt;&amp;amp;gt; 56;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;x = (x * 0x0101010101010101) &amp;gt;&amp;gt; 56;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:15 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:329:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Castingout&amp;quot; title=&amp;quot;Anchor: Castingout&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Castingout&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:329 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:215:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc15&quot;&gt;&lt;a name=&quot;SWAR-Popcount-Adding the Byte-Counts-Casting out&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:215 --&gt;Casting out&lt;/h3&gt;
Interestingly, there is another approach to add the bytes together. As demonstrated with decimal digits (base 10) and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Casting_out_nines&quot; rel=&quot;nofollow&quot;&gt;Casting out nines&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:113:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.billthelizard.com/2009/06/casting-out-nines.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Casting Out Nines&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.billthelizard.com/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Bill the Lizard&amp;lt;/a&amp;gt;, June 13, 2009&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-16&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-16&quot;&gt;[16]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:113 --&gt;, casting out by &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Modulo&quot;&gt;modulo&lt;/a&gt; base minus one is equivalent to taking the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Digit_sum&quot; rel=&quot;nofollow&quot;&gt;digit sum&lt;/a&gt;, which might be applied here with low range 0..8 &amp;quot;base 256&amp;quot; digits:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:16:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;x = x % 255;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;x = x % 255;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:16 --&gt;However, since division and modulo are usually slow instructions and  modulo by constant is likely replaced by reciprocal multiplication anyway by the compiler, the multiplication by 0x0101010101010101 aka the 2-&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/P-adic_number&quot; rel=&quot;nofollow&quot;&gt;adic&lt;/a&gt; fraction -1/255 is the preferred method.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:217:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc16&quot;&gt;&lt;a name=&quot;SWAR-Popcount-The PopCount routine&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:217 --&gt;The PopCount routine&lt;/h2&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:219:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc17&quot;&gt;&lt;a name=&quot;SWAR-Popcount-The PopCount routine-The Constants&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:219 --&gt;The Constants&lt;/h3&gt;
Putting all together, the various SWAR-Masks and factors as defined by &lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Donald Knuth&lt;/a&gt; as 2-&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/P-adic_number&quot; rel=&quot;nofollow&quot;&gt;adic&lt;/a&gt; fractions &lt;!-- ws:start:WikiTextRefRule:121:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Donald%20Knuth&amp;quot;&amp;gt;Donald Knuth&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2009&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;The Art of Computer Programming&amp;lt;/a&amp;gt;, Volume 4, Fascicle 1: Bitwise tricks &amp;amp;amp; techniques&amp;lt;/em&amp;gt;, as &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www-cs-faculty.stanford.edu/%7Eknuth/fasc1a.ps.gz&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Pre-Fascicle 1a postscript&amp;lt;/a&amp;gt;, p 9&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-17&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-17&quot;&gt;[17]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:121 --&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:17:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;const U64 k1 = C64(0x5555555555555555); /*  -1/3   */&amp;lt;br/&amp;gt;const U64 k2 = C64(0x3333333333333333); /*  -1/5   */&amp;lt;br/&amp;gt;const U64 k4 = C64(0x0f0f0f0f0f0f0f0f); /*  -1/17  */&amp;lt;br/&amp;gt;const U64 kf = C64(0x0101010101010101); /*  -1/255 */&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 k1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x5555555555555555&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/*  -1/3   */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 k2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x3333333333333333&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/*  -1/5   */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 k4 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0f0f0f0f0f0f0f0f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/*  -1/17  */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 kf &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0101010101010101&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/*  -1/255 */&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:17 --&gt;represented as bitboards:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:18:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;k1  -1/3            k2  -1/5            k4  -1/17           kf  -1/255              &amp;lt;br/&amp;gt;0x5555555555555555  0x3333333333333333  0x0f0f0f0f0f0f0f0f  0x0101010101010101&amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   &amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   &amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   &amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   &amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   &amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   &amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   &amp;lt;br/&amp;gt;1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   &amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;k1  -1/3            k2  -1/5            k4  -1/17           kf  -1/255              
0x5555555555555555  0x3333333333333333  0x0f0f0f0f0f0f0f0f  0x0101010101010101
1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   
1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   
1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   
1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   
1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   
1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   
1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   
1 . 1 . 1 . 1 .     1 1 . . 1 1 . .     1 1 1 1 . . . .     1 . . . . . . .   &lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:18 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:221:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc18&quot;&gt;&lt;a name=&quot;SWAR-Popcount-The PopCount routine-popCount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:221 --&gt;popCount&lt;/h3&gt;
This is how the complete routine looks in &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:19:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int popCount (U64 x) {&amp;lt;br/&amp;gt;    x =  x       - ((x &amp;amp;gt;&amp;amp;gt; 1)  &amp;amp;amp; k1); /* put count of each 2 bits into those 2 bits */&amp;lt;br/&amp;gt;    x = (x &amp;amp;amp; k2) + ((x &amp;amp;gt;&amp;amp;gt; 2)  &amp;amp;amp; k2); /* put count of each 4 bits into those 4 bits */&amp;lt;br/&amp;gt;    x = (x       +  (x &amp;amp;gt;&amp;amp;gt; 4)) &amp;amp;amp; k4 ; /* put count of each 8 bits into those 8 bits */&amp;lt;br/&amp;gt;    x = (x * kf) &amp;amp;gt;&amp;amp;gt; 56; /* returns 8 most significant bits of x + (x&amp;amp;lt;&amp;amp;lt;8) + (x&amp;amp;lt;&amp;amp;lt;16) + (x&amp;amp;lt;&amp;amp;lt;24) + ...  */&amp;lt;br/&amp;gt;    return (int) x;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; popCount &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  x       &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* put count of each 2 bits into those 2 bits */&lt;/span&gt;
    x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* put count of each 4 bits into those 4 bits */&lt;/span&gt;
    x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x       &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k4 &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* put count of each 8 bits into those 8 bits */&lt;/span&gt;
    x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; kf&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* returns 8 most significant bits of x + (x&amp;lt;&amp;lt;8) + (x&amp;lt;&amp;lt;16) + (x&amp;lt;&amp;lt;24) + ...  */&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; x&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:19 --&gt;&lt;br /&gt;
&lt;strong&gt;Advantage&lt;/strong&gt;: no branches, no memory lookups, constant runtime - independent from population&lt;br /&gt;
&lt;strong&gt;Drawback&lt;/strong&gt;: dependency chain, not much parallel speedup&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:223:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc19&quot;&gt;&lt;a name=&quot;SWAR-Popcount-The PopCount routine-slowmul_popCount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:223 --&gt;slowmul_popCount&lt;/h3&gt;
And as stated before, for computers with relatively slower multiplication, the addition can be done manually:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:20:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int slowmul_popCount (U64 x) {&amp;lt;br/&amp;gt;    x =  x       - ((x &amp;amp;gt;&amp;amp;gt; 1)  &amp;amp;amp; k1); /* put count of each 2 bits into those 2 bits */&amp;lt;br/&amp;gt;    x = (x &amp;amp;amp; k2) + ((x &amp;amp;gt;&amp;amp;gt; 2)  &amp;amp;amp; k2); /* put count of each 4 bits into those 4 bits */&amp;lt;br/&amp;gt;    x = (x       +  (x &amp;amp;gt;&amp;amp;gt; 4)) &amp;amp;amp; k4 ; /* put count of each 8 bits into those 8 bits */&amp;lt;br/&amp;gt;    x += x &amp;amp;gt;&amp;amp;gt;  8;  /* put count of each 16 bits into their lowest 8 bits */&amp;lt;br/&amp;gt;    x += x &amp;amp;gt;&amp;amp;gt; 16;  /* put count of each 32 bits into their lowest 8 bits */&amp;lt;br/&amp;gt;    x += x &amp;amp;gt;&amp;amp;gt; 32;  /* put count of the final 64 bits into the lowest 8 bits */&amp;lt;br/&amp;gt;    return (int) x &amp;amp;amp; 255;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; slowmul_popCount &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  x       &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* put count of each 2 bits into those 2 bits */&lt;/span&gt;
    x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* put count of each 4 bits into those 4 bits */&lt;/span&gt;
    x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x       &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k4 &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* put count of each 8 bits into those 8 bits */&lt;/span&gt;
    x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;coMULTI&quot;&gt;/* put count of each 16 bits into their lowest 8 bits */&lt;/span&gt;
    x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;coMULTI&quot;&gt;/* put count of each 32 bits into their lowest 8 bits */&lt;/span&gt;
    x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;coMULTI&quot;&gt;/* put count of the final 64 bits into the lowest 8 bits */&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:20 --&gt;&lt;br /&gt;
&lt;em&gt;For likely sparsely populated bitboards, the loop-wise &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#BrianKernighansway&quot;&gt;Brian Kernighan&#039;s way&lt;/a&gt; might be the faster one.&lt;/em&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:330:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@HAKMEM169&amp;quot; title=&amp;quot;Anchor: HAKMEM169&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;HAKMEM169&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:330 --&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:225:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc20&quot;&gt;&lt;a name=&quot;SWAR-Popcount-HAKMEM 169&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:225 --&gt;HAKMEM 169&lt;/h2&gt;
A similar technique was proposed by &lt;a class=&quot;wiki_link&quot; href=&quot;/Bill%20Gosper&quot;&gt;Bill Gosper&lt;/a&gt; et al. from &lt;a class=&quot;wiki_link&quot; href=&quot;/Massachusetts%20Institute%20of%20Technology&quot;&gt;Massachusetts Institute of Technology&lt;/a&gt;, as published 1972 in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/HAKMEM&quot; rel=&quot;nofollow&quot;&gt;Memo 239 (HAKMEM)&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:124:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://home.pipeline.com/~hbaker1/hakmem/hacks.html#item169&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;HAKMEM - ITEM 169 To count the ones in a PDP-6/10 word&amp;lt;/a&amp;gt; (in order of one-ups-manship: &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Bill%20Gosper&amp;quot;&amp;gt;Gosper&amp;lt;/a&amp;gt;, Mann, Lenard, [Root and Mann])&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-18&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-18&quot;&gt;[18]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:124 --&gt; &lt;!-- ws:start:WikiTextRefRule:127:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.cl.cam.ac.uk/~am21/hakmemc.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;HAKMEMC &amp;amp;#45;- HAKMEM Programming hacks in C&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.cl.cam.ac.uk/~am21/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Alan Mycroft&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-19&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-19&quot;&gt;[19]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:127 --&gt;, to add bit-trio- rather than duo populations consecutively, and the 32 bit version relies on casting out 63. Note that the constants in the code below have &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Octal&quot; rel=&quot;nofollow&quot;&gt;octal&lt;/a&gt; (base-8) digits, originally written in &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#HAKMEM169&quot;&gt;Assembly&lt;/a&gt; for the &lt;a class=&quot;wiki_link&quot; href=&quot;/PDP-6&quot;&gt;PDP-6&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:131:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Bill%20Gosper#HAKMEM169&amp;quot;&amp;gt;HAKMEM 169&amp;lt;/a&amp;gt; for &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/PDP-6&amp;quot;&amp;gt;PDP-6&amp;lt;/a&amp;gt;/&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/PDP-10&amp;quot;&amp;gt;PDP-10&amp;lt;/a&amp;gt; 36-bit words&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-20&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-20&quot;&gt;[20]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:131 --&gt;. An expanded 64-bit version, casting out 511 or 4095, is slightly less efficient than the binary SWAR version above.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:21:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int hakmem169_32(unsigned int x) {&amp;lt;br/&amp;gt;   x = x  - ((x &amp;amp;gt;&amp;amp;gt; 1)  &amp;amp;amp; 033333333333)&amp;lt;br/&amp;gt;          - ((x &amp;amp;gt;&amp;amp;gt; 2)  &amp;amp;amp; 011111111111);&amp;lt;br/&amp;gt;   x = (x +  (x &amp;amp;gt;&amp;amp;gt; 3)) &amp;amp;amp; 030707070707 ;&amp;lt;br/&amp;gt;   return x % 63; /* casting out 63 */&amp;lt;br/&amp;gt;} &amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; hakmem169_32&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; x  &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu8&quot;&gt;033333333333&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
          &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu8&quot;&gt;011111111111&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu8&quot;&gt;030707070707&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; x &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;63&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* casting out 63 */&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:21 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:227:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc21&quot;&gt;&lt;a name=&quot;Miscellaneous&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:227 --&gt;Miscellaneous&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextAnchorRule:331:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@CardinalityofMultipleSets&amp;quot; title=&amp;quot;Anchor: CardinalityofMultipleSets&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;CardinalityofMultipleSets&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:331 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:229:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc22&quot;&gt;&lt;a name=&quot;Miscellaneous-Cardinality of Multiple Sets&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:229 --&gt;Cardinality of Multiple Sets&lt;/h2&gt;
 If we like to count &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;arrays&lt;/a&gt; of sets, we can reduce 2^N-1 popcounts to N popcounts, by applying the odd-major-trick. For three sets to count we safe one, with five additional cheap instructions.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:22:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;  odd   =  (x ^ y)  ^ z;&amp;lt;br/&amp;gt;  major = ((x ^ y ) &amp;amp;amp; z) | (x &amp;amp;amp; y);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;  popCount(x) + popCount(y) + popCount(z) == 2*popCount(major) + popCount(odd)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;  odd   =  (x ^ y)  ^ z;
  major = ((x ^ y ) &amp;amp; z) | (x &amp;amp; y);
&amp;nbsp;
  popCount(x) + popCount(y) + popCount(z) == 2*popCount(major) + popCount(odd)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:22 --&gt;The combined popCount3 likely gains more parallel speedup, since there are two independent chains to calculate. Possible Application is to pass the union of both bishops (since usually bishops cover disjoint sets due to different square colors) plus the up to two knight move-target sets.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:23:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;// return popCount(x) + popCount(y) + popCount(z)&amp;lt;br/&amp;gt;int popCount3 (U64 x, U64 y, U64 z) {&amp;lt;br/&amp;gt;    U64 maj = ((x ^ y ) &amp;amp;amp; z) | (x &amp;amp;amp; y);&amp;lt;br/&amp;gt;    U64 odd = ((x ^ y ) ^ z);&amp;lt;br/&amp;gt;    maj =  maj - ((maj &amp;amp;gt;&amp;amp;gt; 1) &amp;amp;amp; k1 );&amp;lt;br/&amp;gt;    odd =  odd - ((odd &amp;amp;gt;&amp;amp;gt; 1) &amp;amp;amp; k1 );&amp;lt;br/&amp;gt;    maj = (maj &amp;amp;amp; k2) + ((maj &amp;amp;gt;&amp;amp;gt; 2) &amp;amp;amp; k2);&amp;lt;br/&amp;gt;    odd = (odd &amp;amp;amp; k2) + ((odd &amp;amp;gt;&amp;amp;gt; 2) &amp;amp;amp; k2);&amp;lt;br/&amp;gt;    maj = (maj + (maj &amp;amp;gt;&amp;amp;gt; 4)) &amp;amp;amp; k4;&amp;lt;br/&amp;gt;    odd = (odd + (odd &amp;amp;gt;&amp;amp;gt; 4)) &amp;amp;amp; k4;&amp;lt;br/&amp;gt;    odd = ((maj + maj + odd) * kf ) &amp;amp;gt;&amp;amp;gt; 56;&amp;lt;br/&amp;gt;    return (int) odd;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// return popCount(x) + popCount(y) + popCount(z)&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; popCount3 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x, U64 y, U64 z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    U64 maj &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; y &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    U64 odd &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; y &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    maj &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  maj &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;maj &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k1 &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    odd &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;  odd &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;odd &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k1 &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    maj &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;maj &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;maj &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    odd &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;odd &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;odd &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    maj &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;maj &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;maj &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k4&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    odd &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;odd &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;odd &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; k4&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    odd &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;maj &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; maj &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; odd&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; kf &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; odd&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:23 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:231:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc23&quot;&gt;&lt;a name=&quot;Miscellaneous-Cardinality of Multiple Sets-Odd and Major 7-15&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:231 --&gt;Odd and Major 7-15&lt;/h3&gt;
 Of course - reducing seven popcount to three, or even 15 popcounts to four sounds even more promising.&lt;br /&gt;
For N = 2^n - 1 it takes N - n odd-major pairs. Thus one add-major pair - five instructions - per saved popCount.&lt;br /&gt;
&lt;br /&gt;
That is 7 - 3 = 4 pairs:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:24:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;one1,two1 := oddMaj(x1,x2,x3)&amp;lt;br/&amp;gt;one2,two2 := oddMaj(x4,x5,x6)&amp;lt;br/&amp;gt;ones,two3 := oddMaj(x7,one1,one2)&amp;lt;br/&amp;gt;twos,four := oddMaj(two1,two2,two3)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;one1,two1 := oddMaj(x1,x2,x3)
one2,two2 := oddMaj(x4,x5,x6)
ones,two3 := oddMaj(x7,one1,one2)
twos,four := oddMaj(two1,two2,two3)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:24 --&gt;Or 15 - 4 = 11 pairs:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:25:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;one1,two1  := oddMaj(x1,x2,x3)&amp;lt;br/&amp;gt;one2,two2  := oddMaj(x4,x5,x6)&amp;lt;br/&amp;gt;one3,two3  := oddMaj(x7,x8,x9)&amp;lt;br/&amp;gt;one4,two4  := oddMaj(x10,x11,x12)&amp;lt;br/&amp;gt;one5,two5  := oddMaj(x13,x14,x15)&amp;lt;br/&amp;gt;one6,two6  := oddMaj(one1,one2,one3)&amp;lt;br/&amp;gt;ones,two7  := oddMaj(one4,one5,one6)&amp;lt;br/&amp;gt;two8,four1 := oddMaj(two1,two2,two3)&amp;lt;br/&amp;gt;two9,four2 := oddMaj(two4,two5,two6)&amp;lt;br/&amp;gt;twos,four3 := oddMaj(two7,two8,two9)&amp;lt;br/&amp;gt;four,eight := oddMaj(four1,four2,four3)&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;one1,two1  := oddMaj(x1,x2,x3)
one2,two2  := oddMaj(x4,x5,x6)
one3,two3  := oddMaj(x7,x8,x9)
one4,two4  := oddMaj(x10,x11,x12)
one5,two5  := oddMaj(x13,x14,x15)
one6,two6  := oddMaj(one1,one2,one3)
ones,two7  := oddMaj(one4,one5,one6)
two8,four1 := oddMaj(two1,two2,two3)
two9,four2 := oddMaj(two4,two5,two6)
twos,four3 := oddMaj(two7,two8,two9)
four,eight := oddMaj(four1,four2,four3)&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:25 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:332:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@OddMajorDigitCounts&amp;quot; title=&amp;quot;Anchor: OddMajorDigitCounts&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;OddMajorDigitCounts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:332 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:233:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc24&quot;&gt;&lt;a name=&quot;Miscellaneous-Cardinality of Multiple Sets-Odd and Major Digit Counts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:233 --&gt;Odd and Major Digit Counts&lt;/h3&gt;
 Odd-Major is probably also useful to determine digit count sets of attacks or other stuff:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:26:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;U64 odd(U64 x, U64 y, U64 z) {return x^y^z;}&amp;lt;br/&amp;gt;U64 maj(U64 x, U64 y, U64 z) {return ((x^y)&amp;amp;amp;z)|(x&amp;amp;amp;y);}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;void attackCounts(U64 t[3], const U64 s[7]) {&amp;lt;br/&amp;gt;   one1 = odd(s[0], s[1], s[2]);&amp;lt;br/&amp;gt;   two1 = maj(s[0], s[1], s[2]);&amp;lt;br/&amp;gt;   one2 = odd(s[3], s[4], s[5]);&amp;lt;br/&amp;gt;   two2 = maj(s[3], s[4], s[5]);&amp;lt;br/&amp;gt;   t[0] = odd(s[6], one1, one2);&amp;lt;br/&amp;gt;   two3 = maj(s[6], one1, one2);&amp;lt;br/&amp;gt;   t[1] = odd(two1, two2, two3);&amp;lt;br/&amp;gt;   t[2] = maj(two1, two2, two3);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;U64 odd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x, U64 y, U64 z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; x&lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;y&lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;z&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
U64 maj&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 x, U64 y, U64 z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;y&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; attackCounts&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 t&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   one1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; odd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   two1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; maj&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   one2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; odd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   two2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; maj&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   t&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; odd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, one1, one2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   two3 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; maj&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, one1, one2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   t&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; odd&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;two1, two2, two3&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   t&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; maj&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;two1, two2, two3&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:26 --&gt;with following semantics:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:27:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;exactly7attacks :=   t[2] &amp;amp;amp;  t[1] &amp;amp;amp;  t[0]&amp;lt;br/&amp;gt;exactly6attacks :=   t[2] &amp;amp;amp;  t[1] &amp;amp;amp; ~t[0]&amp;lt;br/&amp;gt;exactly5attacks :=   t[2] &amp;amp;amp; ~t[1] &amp;amp;amp;  t[0]&amp;lt;br/&amp;gt;exactly4attacks :=   t[2] &amp;amp;amp; ~t[1] &amp;amp;amp; ~t[0]&amp;lt;br/&amp;gt;exactly3attacks :=  ~t[2] &amp;amp;amp;  t[1] &amp;amp;amp;  t[0]&amp;lt;br/&amp;gt;exactly2attacks :=  ~t[2] &amp;amp;amp;  t[1] &amp;amp;amp; ~t[0]&amp;lt;br/&amp;gt;exactly1attack  :=  ~t[2] &amp;amp;amp; ~t[1] &amp;amp;amp;  t[0]&amp;lt;br/&amp;gt;noAttack        :=  ~t[2] &amp;amp;amp; ~t[1] &amp;amp;amp; ~t[0]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;atLeast4attacks :=                   t[2]&amp;lt;br/&amp;gt;atLeast2attacks := atLeast4attacks | t[1]&amp;lt;br/&amp;gt;atLeast1attack  := atLeast2attacks | t[0]&amp;lt;br/&amp;gt;noAttack        := ~atLeast1attack&amp;lt;br/&amp;gt;exactly1attack  :=  atLeast1attack  ^ atLeast2attacks&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;exactly7attacks :=   t[2] &amp;amp;  t[1] &amp;amp;  t[0]
exactly6attacks :=   t[2] &amp;amp;  t[1] &amp;amp; ~t[0]
exactly5attacks :=   t[2] &amp;amp; ~t[1] &amp;amp;  t[0]
exactly4attacks :=   t[2] &amp;amp; ~t[1] &amp;amp; ~t[0]
exactly3attacks :=  ~t[2] &amp;amp;  t[1] &amp;amp;  t[0]
exactly2attacks :=  ~t[2] &amp;amp;  t[1] &amp;amp; ~t[0]
exactly1attack  :=  ~t[2] &amp;amp; ~t[1] &amp;amp;  t[0]
noAttack        :=  ~t[2] &amp;amp; ~t[1] &amp;amp; ~t[0]
&amp;nbsp;
atLeast4attacks :=                   t[2]
atLeast2attacks := atLeast4attacks | t[1]
atLeast1attack  := atLeast2attacks | t[0]
noAttack        := ~atLeast1attack
exactly1attack  :=  atLeast1attack  ^ atLeast2attacks&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:27 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:235:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc25&quot;&gt;&lt;a name=&quot;Miscellaneous-Popcount as log2 of LS1B&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:235 --&gt;Popcount as log2 of LS1B&lt;/h2&gt;
 Assuming an architecture has a fast popcount-instruction (but no bitscan). One can isolate the LS1B, decrement it and count the remaining trailing &amp;quot;ones&amp;quot; to perform the logarithm dualis:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:28:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;log2(LS1B) = popCount( LS1B - 1 );&amp;lt;br/&amp;gt;bitIndexOfLS1B(x) = popCount( (x &amp;amp;amp; -x) - 1 );&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;log2(LS1B) = popCount( LS1B - 1 );
bitIndexOfLS1B(x) = popCount( (x &amp;amp; -x) - 1 );&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:28 --&gt;&lt;br /&gt;
For instance, LS1B is 2^44, decrementing leaves a below LSB1 mask with exactly 44 bits set:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:29:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;0x0000100000000000   0x00000FFFFFFFFFFF&amp;lt;br/&amp;gt;. . . . . . . .      . . . . . . . .&amp;lt;br/&amp;gt;. . . . . . . .      . . . . . . . .&amp;lt;br/&amp;gt;. . . . 1 . . .      1 1 1 1 . . . .&amp;lt;br/&amp;gt;. . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;. . . . . . . .      1 1 1 1 1 1 1 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;0x0000100000000000   0x00000FFFFFFFFFFF
. . . . . . . .      . . . . . . . .
. . . . . . . .      . . . . . . . .
. . . . 1 . . .      1 1 1 1 . . . .
. . . . . . . .      1 1 1 1 1 1 1 1
. . . . . . . .      1 1 1 1 1 1 1 1
. . . . . . . .      1 1 1 1 1 1 1 1
. . . . . . . .      1 1 1 1 1 1 1 1
. . . . . . . .      1 1 1 1 1 1 1 1&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:29 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:333:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@HammingDistance&amp;quot; title=&amp;quot;Anchor: HammingDistance&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;HammingDistance&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:333 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:237:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc26&quot;&gt;&lt;a name=&quot;Miscellaneous-Hamming Distance&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:237 --&gt;Hamming Distance&lt;/h2&gt;
 The &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Hamming_distance&quot; rel=&quot;nofollow&quot;&gt;hamming distance&lt;/a&gt; of two words is defined as the number of corresponding &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ExclusiveOr&quot;&gt;different bits&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:30:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;int hammingDistance (U64 a, U64 b) {return popcnt( a ^ b);}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;int hammingDistance (U64 a, U64 b) {return popcnt( a ^ b);}&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:30 --&gt;Hamming distance greater than one or two is an important property of codes to detect or even correct one-bit errors.&lt;br /&gt;
&lt;br /&gt;
The minimum and average hamming distance over all &lt;a class=&quot;wiki_link&quot; href=&quot;/Zobrist%20Hashing&quot;&gt;Zobrist keys&lt;/a&gt; was considered as &amp;quot;quality&amp;quot;-measure of the keys. However, as long the minimum hamming distance is greater zero, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Linear_independence&quot; rel=&quot;nofollow&quot;&gt;linear independence&lt;/a&gt; (that is a small subset of all keys doesn&#039;t xor to zero), is much more important than hamming distance &lt;!-- ws:start:WikiTextRefRule:135:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=200622&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Re: About random numbers and hashing&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Sven%20Reichard&amp;quot;&amp;gt;Sven Reichard&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, December 05, 2001&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-21&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-21&quot;&gt;[21]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:135 --&gt;. Maximizing the minimal hamming distance leads to very poor Zobrist keys &lt;!-- ws:start:WikiTextRefRule:139:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=26152&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Zobrist key random numbers&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Robert%20Hyatt&amp;quot;&amp;gt;Robert Hyatt&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, January 21, 2009&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-22&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-22&quot;&gt;[22]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:139 --&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:239:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc27&quot;&gt;&lt;a name=&quot;Miscellaneous-Weighted PopCount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:239 --&gt;Weighted PopCount&lt;/h2&gt;
 For a &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD-wise&lt;/a&gt; kind of weighted population count, see the &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2#SSE2dotproduct&quot;&gt;SSE2 dot-product&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:241:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc28&quot;&gt;&lt;a name=&quot;Miscellaneous-Pre-calculated Mobility&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:241 --&gt;Pre-calculated Mobility&lt;/h2&gt;
 Similar to &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks#AttacksbyOccupancyLookup&quot;&gt;Attacks by Occupancy Lookup&lt;/a&gt; to determine attack sets of sliding pieces, we may use pre-calculated population count or even center-weighted population count as a rough estimate on piece &lt;a class=&quot;wiki_link&quot; href=&quot;/Mobility&quot;&gt;mobility&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:143:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;amp;t=6823&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Magic and precomputation&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Onno%20Garms&amp;quot;&amp;gt;Onno Garms&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Winboard Programming Forum&amp;lt;/a&amp;gt;, September 23, 2007&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-23&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-23&quot;&gt;[23]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:143 --&gt;. It may not consider subsets of let say safe target squares.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:243:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc29&quot;&gt;&lt;a name=&quot;Miscellaneous-Piece Attacks Count&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:243 --&gt;Piece Attacks Count&lt;/h2&gt;
 As pointed out by &lt;a class=&quot;wiki_link&quot; href=&quot;/Marco%20Costalba&quot;&gt;Marco Costalba&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:147:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=27820&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;fast mobility count through hashing&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Marco%20Costalba&amp;quot;&amp;gt;Marco Costalba&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, May 09, 2009&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-24&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-24&quot;&gt;[24]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:147 --&gt; &lt;!-- ws:start:WikiTextRefRule:151:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?t=27965&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Piece attacks count&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Marco%20Costalba&amp;quot;&amp;gt;Marco Costalba&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/CCC&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, May 18, 2009&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-25&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-25&quot;&gt;[25]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:151 --&gt;, specialized routines to count the population (&lt;a class=&quot;wiki_link&quot; href=&quot;/Mobility&quot;&gt;Mobility&lt;/a&gt;) of attack sets of &lt;a class=&quot;wiki_link&quot; href=&quot;/King&quot;&gt;king&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Knight&quot;&gt;knight&lt;/a&gt; and line-wise sub-sets of sliding pieces can be done more efficiently than the general &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#SWARPopcount&quot;&gt;SWAR-Popcount&lt;/a&gt;. This is similar to &lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating&quot;&gt;Flipping Mirroring and Rotating&lt;/a&gt; the whole bitboard versus &lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating#RankFileAndDiagonal&quot;&gt;Rank, File and Diagonal&lt;/a&gt;, and is based on mapping the up to eight scattered occupied bits to one byte, to perform a single &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#Lookup&quot;&gt;byte lookup&lt;/a&gt;. For various mapping techniques, see:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboard%20Serialization#HashingMultipleBits&quot;&gt;Hashing Multiple Bits&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboard%20Serialization&quot;&gt;Bitboard Serialization&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating#RankFileAndDiagonal&quot;&gt;Rank, File and Diagonal&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating&quot;&gt;Flipping Mirroring and Rotating&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy%20of%20any%20Line&quot;&gt;Occupancy of any Line&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:245:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc30&quot;&gt;&lt;a name=&quot;Popcount in Hardware&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:245 --&gt;Popcount in Hardware&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Ferranti%20Mark%201#Instructions&quot;&gt;Ferranti Mark 1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/CDC%206600#PopulationCount&quot;&gt;CDC 6600&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/CDC%20Cyber#PopulationCount&quot;&gt;CDC Cyber&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4#SSE4.2&quot;&gt;SSE4.2&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4#SSE4a&quot;&gt;SSE4a&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; x86, x86-64&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:247:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc31&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:247 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#HAKMEM169&quot;&gt;Assembly Popcounts&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling&quot;&gt;Bit-Twiddling&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#GreaterOne&quot;&gt;Greater One Sets&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations&quot;&gt;General Setwise Operations&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Kim%20Walisch#PopCount&quot;&gt;libpopcnt&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Kim%20Walisch&quot;&gt;Kim Walisch&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/MMX#MMXPopcount&quot;&gt;MMX Popcount&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/CDC%20Cyber#Mobility&quot;&gt;Mobility&lt;/a&gt; in &lt;a class=&quot;wiki_link&quot; href=&quot;/Chess%20%28Program%29&quot;&gt;Chess 4.6&lt;/a&gt; on the &lt;a class=&quot;wiki_link&quot; href=&quot;/CDC%20Cyber&quot;&gt;CDC Cyber&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2#SSE2popcount&quot;&gt;SSE2 Population Count&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#PopCount&quot;&gt;SSSE3 Population Count&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:249:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc32&quot;&gt;&lt;a name=&quot;Publications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:249 --&gt;Publications&lt;/h1&gt;
&lt;!-- ws:start:WikiTextHeadingRule:251:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc33&quot;&gt;&lt;a name=&quot;Publications-1949 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:251 --&gt;1949 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Alan%20Turing&quot;&gt;Alan Turing&lt;/a&gt; (&lt;strong&gt;1949&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.computerhistory.org/chess/full_record.php?iid=doc-431614f45472f&quot; rel=&quot;nofollow&quot;&gt;Alan Turing&#039;s Manual for the Ferranti Mk. I&lt;/a&gt;&lt;/em&gt;. transcribed in 2000 by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.panix.com/~rst/&quot; rel=&quot;nofollow&quot;&gt;Robert Thau&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://archive.computerhistory.org/projects/chess/related_materials/text/2-1.Ferranti_Mark_1_manual.Turing-Alan/2-1.Ferranti_Mark_1_manual.Turing-Alan.1951.UNIVERSITY_OF_MANCHESTER.062303005.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/The%20Computer%20History%20Museum&quot;&gt;The Computer History Museum&lt;/a&gt;, 9.4 The position of the most significant digit » &lt;a class=&quot;wiki_link&quot; href=&quot;/Ferranti%20Mark%201&quot;&gt;Ferranti Mark 1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#MVWilkes&quot;&gt;Maurice Wilkes&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#DJWheeler&quot;&gt;David Wheeler&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Stanley_Gill&quot; rel=&quot;nofollow&quot;&gt;Stanley Gill&lt;/a&gt; (&lt;strong&gt;1957&lt;/strong&gt;). &lt;em&gt;The Preparation of Programs for an Electronic Digital Computer&lt;/em&gt;. Addison-Wesley Press; 2nd edition, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.amazon.com/preparation-programs-electronic-Addison-Wesley-mathematics/dp/B0006AV1QQ&quot; rel=&quot;nofollow&quot;&gt;amazon.com&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#DBGillies&quot;&gt;Donald B. Gillies&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/J._C._P._Miller&quot; rel=&quot;nofollow&quot;&gt;Jeffrey C. P. Miller&lt;/a&gt; on &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#SWARPopcount&quot;&gt;SWAR-Popcount&lt;/a&gt;, pages 191–193&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#PWegner&quot;&gt;Peter Wegner&lt;/a&gt; (&lt;strong&gt;1960&lt;/strong&gt;). &lt;em&gt;A technique for counting ones in a binary computer&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/ACM#Communications&quot;&gt;Communications of the ACM&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informatik.uni-trier.de/~ley/db/journals/cacm/cacm3.html#Wegner60&quot; rel=&quot;nofollow&quot;&gt;Volume 3, 1960&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#DAWagner&quot;&gt;David A. Wagner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Steven%20M.%20Bellovin&quot;&gt;Steven M. Bellovin&lt;/a&gt; (&lt;strong&gt;1994&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://academiccommons.columbia.edu/catalog/ac:127097&quot; rel=&quot;nofollow&quot;&gt;A Programmable Plaintext Recognizer&lt;/a&gt;&lt;/em&gt;. &lt;!-- ws:start:WikiTextRefRule:156:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://cryptome.org/jya/sadd.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Sideways Add / Population Count&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.couperus.org/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Jitze Couperus&amp;lt;/a&amp;gt; and &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Steven%20M.%20Bellovin&amp;quot;&amp;gt;Steve Bellovin&amp;lt;/a&amp;gt; et al., &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/C2Net&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;cryptography@c2.net&amp;lt;/a&amp;gt;, January 28, 1999&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-26&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-26&quot;&gt;[26]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:156 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:253:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc34&quot;&gt;&lt;a name=&quot;Publications-2000 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:253 --&gt;2000 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.cs.gwu.edu/people/faculty/82&quot; rel=&quot;nofollow&quot;&gt;Simon Y. Berkovich&lt;/a&gt;, Gennadi M. Lapir, Marilyn Mack (&lt;strong&gt;2000&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://portal.acm.org/citation.cfm?id=362453&quot; rel=&quot;nofollow&quot;&gt;A Bit-Counting Algorithm Using the Frequency Division Principle&lt;/a&gt;&lt;/em&gt;. Software, Practice and Experience Vol. 30, No. 14, 2000, pp. 1531-1540&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informatik.uni-trier.de/~ley/pers/hd/e/El=Qawasmeh:Eyas.html&quot; rel=&quot;nofollow&quot;&gt;Eyas El-Qawasmeh&lt;/a&gt; (&lt;strong&gt;2001&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://130.203.133.150/viewdoc/summary;jsessionid=A8ADC0228B8051C3ED8DF344DF5573CD?doi=10.1.1.127.8246&quot; rel=&quot;nofollow&quot;&gt;Beating the Popcount&lt;/a&gt;.&lt;/em&gt; International Journal of Information Technology, Singapore, Vol. 9. No. 1&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Henry%20S.%20Warren%2C%20Jr.&quot;&gt;Henry S. Warren, Jr.&lt;/a&gt;  (&lt;strong&gt;2002&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://hackersdelight.org/&quot; rel=&quot;nofollow&quot;&gt;Hacker&#039;s Delight&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Addison%E2%80%93Wesley&quot; rel=&quot;nofollow&quot;&gt;Addison-Wesley Professional&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informatik.uni-trier.de/~ley/pers/hd/e/El=Qawasmeh:Eyas.html&quot; rel=&quot;nofollow&quot;&gt;Eyas El-Qawasmeh&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.yu.edu.jo/fmd/detailsEN.aspx?myID=18327&quot; rel=&quot;nofollow&quot;&gt;Wafa&#039;a Al-Qarqaz&lt;/a&gt; (&lt;strong&gt;2006&lt;/strong&gt;). &lt;em&gt;Reducing Lookup Table Size used for Bit-Counting Algorithm&lt;/em&gt;. Computer Science Dept. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Jordan_University_of_Science_and_Technology&quot; rel=&quot;nofollow&quot;&gt;Jordan University of Science and Technology&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.uop.edu.jo/csit2006/vol3%20pdf/pg524.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Henry%20S.%20Warren%2C%20Jr.&quot;&gt;Henry S. Warren, Jr.&lt;/a&gt;  (&lt;strong&gt;2007&lt;/strong&gt;). &lt;em&gt;The Quest for an Accelerared Population Count&lt;/em&gt;. in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.oreillynet.com/pub/au/36&quot; rel=&quot;nofollow&quot;&gt;Andy Oram&lt;/a&gt; &amp;amp; &lt;a class=&quot;wiki_link&quot; href=&quot;/Greg%20Wilson&quot;&gt;Greg Wilson&lt;/a&gt; (eds.) (&lt;strong&gt;2007&lt;/strong&gt;). &lt;em&gt; Beautiful code: Leading Programmers Explain How They Think&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/O%27Reilly_Media&quot; rel=&quot;nofollow&quot;&gt;O&#039;Reilly&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.amazon.com/Beautiful-Code-Leading-Programmers-Practice/dp/0596510047&quot; rel=&quot;nofollow&quot;&gt;amazon.com&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Donald Knuth&lt;/a&gt; (&lt;strong&gt;2009&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html&quot; rel=&quot;nofollow&quot;&gt;The Art of Computer Programming&lt;/a&gt;, Volume 4, Fascicle 1: Bitwise tricks &amp;amp; techniques&lt;/em&gt;, as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/fasc1a.ps.gz&quot; rel=&quot;nofollow&quot;&gt;Pre-Fascicle 1a postscript&lt;/a&gt;, Sideways addition, pp 11&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:255:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc35&quot;&gt;&lt;a name=&quot;Publications-2010 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:255 --&gt;2010 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Henry%20S.%20Warren%2C%20Jr.&quot;&gt;Henry S. Warren, Jr.&lt;/a&gt;  (&lt;strong&gt;2012&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informit.com/store/hackers-delight-9780321842688&quot; rel=&quot;nofollow&quot;&gt;Hacker&#039;s Delight, 2nd Edition&lt;/a&gt;&lt;/em&gt;.  &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Addison%E2%80%93Wesley&quot; rel=&quot;nofollow&quot;&gt;Addison-Wesley Professional&lt;/a&gt;, More coverage of population count and counting leading zeros, Array population count&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://de.linkedin.com/pub/andreas-stiller/a/381/aa9&quot; rel=&quot;nofollow&quot;&gt;Andreas Stiller&lt;/a&gt; (&lt;strong&gt;2013&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.heise.de/artikel-archiv/ct/2013/05/180_Spezialkommando&quot; rel=&quot;nofollow&quot;&gt;Spezialkommando - Intrinsic __popcnt() zählt die Einsen&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.heise.de/ct/&quot; rel=&quot;nofollow&quot;&gt;c&#039;t Magazin für Computertechnik&lt;/a&gt; 5/2013, p. 180 (German)&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://dblp.uni-trier.de/pers/hd/k/Kurz:Nathan&quot; rel=&quot;nofollow&quot;&gt;Nathan Kurz&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://github.com/lemire&quot; rel=&quot;nofollow&quot;&gt;Daniel Lemire&lt;/a&gt; (&lt;strong&gt;2016&lt;/strong&gt;). &lt;em&gt;Faster Population Counts Using AVX2 Instructions&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://arxiv.org/abs/1611.07612&quot; rel=&quot;nofollow&quot;&gt;arXiv:1611.07612&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:158:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://github.com/WojciechMula/sse-popcount/blob/master/popcnt-avx512-harley-seal.cpp&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;sse-popcount/popcnt-avx512-harley-seal.cpp at master · WojciechMula/sse-popcount · GitHub&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-27&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-27&quot;&gt;[27]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:158 --&gt; » &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:257:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc36&quot;&gt;&lt;a name=&quot;Postings&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:257 --&gt;Postings&lt;/h1&gt;
&lt;!-- ws:start:WikiTextHeadingRule:259:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc37&quot;&gt;&lt;a name=&quot;Postings-1998 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:259 --&gt;1998 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=25091&quot; rel=&quot;nofollow&quot;&gt;Bean counters Part1&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Peter%20Fendrich&quot;&gt;Peter Fendrich&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 19, 1998&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=25095&quot; rel=&quot;nofollow&quot;&gt;Bean counters Part2&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Peter%20Fendrich&quot;&gt;Peter Fendrich&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 19, 1998&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=38188&quot; rel=&quot;nofollow&quot;&gt;Countbits() Function&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Roberto%20Waldteufel&quot;&gt;Roberto Waldteufel&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 03, 1999&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://cryptome.org/jya/sadd.htm&quot; rel=&quot;nofollow&quot;&gt;Sideways Add / Population Count&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.couperus.org/&quot; rel=&quot;nofollow&quot;&gt;Jitze Couperus&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Steven%20M.%20Bellovin&quot;&gt;Steve Bellovin&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://de.linkedin.com/in/horns&quot; rel=&quot;nofollow&quot;&gt;Axel H. Horns&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/C2Net&quot; rel=&quot;nofollow&quot;&gt;cryptography@c2.net&lt;/a&gt;, January 28, 1999 » &lt;a class=&quot;wiki_link&quot; href=&quot;/CDC%206600&quot;&gt;CDC 6600&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:166:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Mathematician#DAWagner&amp;quot;&amp;gt;David A. Wagner&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Steven%20M.%20Bellovin&amp;quot;&amp;gt;Steven M. Bellovin&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1994&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://academiccommons.columbia.edu/catalog/ac:127097&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;A Programmable Plaintext Recognizer&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;.&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-28&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-28&quot;&gt;[28]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:166 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:261:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc38&quot;&gt;&lt;a name=&quot;Postings-2000 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:261 --&gt;2000 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=106644&quot; rel=&quot;nofollow&quot;&gt;fast bit counting&lt;/a&gt; by Flemming Rodler, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 19, 2000&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=106791&quot; rel=&quot;nofollow&quot;&gt;Bit counting revisited&lt;/a&gt; by Flemming Rodler, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 19, 2000&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=106960&quot; rel=&quot;nofollow&quot;&gt;PowerPC BitCounting Functions Speed&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/William%20Bryant&quot;&gt;William Bryant&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 20, 2000 » &lt;a class=&quot;wiki_link&quot; href=&quot;/PowerPC&quot;&gt;PowerPC&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/comp.lang.c/browse_frm/thread/56af26ce0b48cbcd&quot; rel=&quot;nofollow&quot;&gt;Counting the number of bits in a 32-bit word&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#GMarsaglia&quot;&gt;George Marsaglia&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://groups.google.com/group/comp.lang.c/topics&quot; rel=&quot;nofollow&quot;&gt;comp.lang.c&lt;/a&gt;, December 7, 2000&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=281989&quot; rel=&quot;nofollow&quot;&gt;Re: Chezzz 1.0.1 - problem solved - for David Rasmussen&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/David%20Rasmussen&quot;&gt;David Rasmussen&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 05, 2003 &lt;!-- ws:start:WikiTextRefRule:168:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22007.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AMD Athlon Processor x86 Code Optimization Guide&amp;lt;/a&amp;gt; (pdf) Efficient 64-Bit Population Count Using MMX™ Instructions Page 184&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-29&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-29&quot;&gt;[29]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:168 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=293853&quot; rel=&quot;nofollow&quot;&gt;Counting bits&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Andreas%20Herrmann&quot;&gt;Andreas Herrmann&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, April 17, 2003&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=313807&quot; rel=&quot;nofollow&quot;&gt;Hamming distance and lower hash table indexing&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Tom%20Likens&quot;&gt;Tom Likens&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 02, 2003&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=353997&quot; rel=&quot;nofollow&quot;&gt;PopCount optimization&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Anastasios%20Milikas&quot;&gt;milix&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, March 11, 2004&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:263:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc39&quot;&gt;&lt;a name=&quot;Postings-2005 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:263 --&gt;2005 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/958e93d748e48121&quot; rel=&quot;nofollow&quot;&gt;Population count in SSE2, again&lt;/a&gt; by James Van Buskirk, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/topics&quot; rel=&quot;nofollow&quot;&gt;comp.lang.asm.x86&lt;/a&gt;, April 12, 2008&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=26542&quot; rel=&quot;nofollow&quot;&gt;core2 popcnt&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Frank%20Phillips&quot;&gt;Frank Phillips&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 13, 2009&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=267994&amp;amp;t=27965&quot; rel=&quot;nofollow&quot;&gt;Piece attacks count&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Marco%20Costalba&quot;&gt;Marco Costalba&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 18, 2009 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Attack%20and%20Defend%20Maps&quot;&gt;Attack and Defend Maps&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://talkchess.com/forum/viewtopic.php?t=29269&quot; rel=&quot;nofollow&quot;&gt;Bit twiddlement question: greater of two popcounts&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Zach%20Wegner&quot;&gt;Zach Wegner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 06, 2009&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:265:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc40&quot;&gt;&lt;a name=&quot;Postings-2010 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:265 --&gt;2010 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=32227&quot; rel=&quot;nofollow&quot;&gt;Stockfish POPCNT support with gcc&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Marco%20Costalba&quot;&gt;Marco Costalba&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 31, 2010&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/6c8b3f09d890af1b&quot; rel=&quot;nofollow&quot;&gt;Yet another handmade POPCNT&lt;/a&gt; by hopcode, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/topics&quot; rel=&quot;nofollow&quot;&gt;comp.lang.asm.x86&lt;/a&gt;, January 05, 2011&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=38521&quot; rel=&quot;nofollow&quot;&gt;A brief history of the popcnt instruction&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Steven%20Edwards&quot;&gt;Steven Edwards&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, March 22, 2011&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=39268&quot; rel=&quot;nofollow&quot;&gt;Introduction and (hopefully) contribution - bitboard methods&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Alcides%20Schulz&quot;&gt;Alcides Schulz&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, June 03, 2011 » &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;BitScan&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=43771&quot; rel=&quot;nofollow&quot;&gt;using Popcount and Prefetch with SSE4 hardware support&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Engin%20%C3%9Cst%C3%BCn&quot;&gt;Engin Üstün&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 19, 2012 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Memory&quot;&gt;Memory&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4&quot;&gt;SSE4&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://macechess.blogspot.de/2013/04/64-bits-for-64-squares.html&quot; rel=&quot;nofollow&quot;&gt;64 bits for 64 squares ?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Thomas%20Petzke&quot;&gt;Thomas Petzke&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://macechess.blogspot.de/&quot; rel=&quot;nofollow&quot;&gt;mACE Chess&lt;/a&gt;, April 28, 2013&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=54798&quot; rel=&quot;nofollow&quot;&gt;Stockfish 32-bit and hardware instructions on MSVC++&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Syed%20Fahad&quot;&gt;Syed Fahad&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 30, 2014  » &lt;a class=&quot;wiki_link&quot; href=&quot;/Stockfish&quot;&gt;Stockfish&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;BitScan&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;Population Count&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:267:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc41&quot;&gt;&lt;a name=&quot;Postings-2015 ...&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:267 --&gt;2015 ...&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=58230&amp;amp;start=3&quot; rel=&quot;nofollow&quot;&gt;Re: Linux Version of Maverick 1.5&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Michael%20Dvorkin&quot;&gt;Michael Dvorkin&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, November 12, 2015 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Mac%20OS&quot;&gt;OS X&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Maverick&quot;&gt;Maverick&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=61559&quot; rel=&quot;nofollow&quot;&gt;syzygy users (and Ronald)&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Hyatt&quot;&gt;Robert Hyatt&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, September 29, 2016 » &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;BitScan&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:269:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc42&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:269 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Hamming_weight&quot; rel=&quot;nofollow&quot;&gt;Hamming weight from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://semipublic.comp-arch.net/wiki/Population_count_%28POPCNT%29&quot; rel=&quot;nofollow&quot;&gt;Population count (POPCNT) - CompArch&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.crazyontap.com/topic.php?TopicId=43382&quot; rel=&quot;nofollow&quot;&gt;Crazy On Tap - Secret Opcodes&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:170:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/National_Security_Agency&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;National Security Agency from Wikipedia&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-30&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-30&quot;&gt;[30]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:170 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://kent-vandervelden.blogspot.com/2009/10/counting-bits-population-count-and.html&quot; rel=&quot;nofollow&quot;&gt;Blender: POPCNT for counting bits&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://home.pipeline.com/~hbaker1/hakmem/hacks.html#item169&quot; rel=&quot;nofollow&quot;&gt;HAKMEM - ITEM 169 To count the ones in a PDP-6/10 word&lt;/a&gt; (in order of one-ups-manship: &lt;a class=&quot;wiki_link&quot; href=&quot;/Bill%20Gosper&quot;&gt;Gosper&lt;/a&gt;, Mann, Lenard, [Root and Mann]) &lt;!-- ws:start:WikiTextRefRule:180:&amp;amp;lt;ref&amp;amp;gt;Michael Beeler, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Bill%20Gosper&amp;quot;&amp;gt;Bill Gosper&amp;lt;/a&amp;gt; and &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Richard_Schroeppel&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Rich Schroeppel&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;1972&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://home.pipeline.com/~hbaker1/hakmem/hakmem.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;HAKMEM&amp;lt;/a&amp;gt;&amp;lt;/em&amp;gt;, Memo 239, Artificial Intelligence Laboratory, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Massachusetts%20Institute%20of%20Technology&amp;quot;&amp;gt;Massachusetts Institute of Technology&amp;lt;/a&amp;gt;, made Web-available by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://home.pipeline.com/~hbaker1/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Henry Baker&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-31&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-31&quot;&gt;[31]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:180 --&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.cl.cam.ac.uk/~am21/hakmemc.html&quot; rel=&quot;nofollow&quot;&gt;HAKMEMC -- HAKMEM Programming hacks in C&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.cl.cam.ac.uk/~am21/&quot; rel=&quot;nofollow&quot;&gt;Alan Mycroft&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.hackersdelight.org/hdcodetxt/pop.c.txt&quot; rel=&quot;nofollow&quot;&gt;popcount&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; samples from &lt;a class=&quot;wiki_link&quot; href=&quot;/Henry%20S.%20Warren%2C%20Jr.&quot;&gt;Henry S. Warren, Jr.&lt;/a&gt; (&lt;strong&gt;2002, 2012&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Henry%20S.%20Warren%2C%20Jr.#HackersDeligh&quot;&gt;Hacker&#039;s Delight&lt;/a&gt;&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Addison%E2%80%93Wesley&quot; rel=&quot;nofollow&quot;&gt;Addison-Wesley&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://aggregate.org/MAGIC/#Population%20Count%20%28Ones%20Count&quot; rel=&quot;nofollow&quot;&gt;The Aggregate Magic Algorithms -Population Count (Ones Count)&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Hank%20Dietz&quot;&gt;Hank Dietz&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-graphics.stanford.edu/~seander/bithacks.html#CountBitsSetNaive&quot; rel=&quot;nofollow&quot;&gt;Counting bits set&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://graphics.stanford.edu/%7Eseander/bithacks.html&quot; rel=&quot;nofollow&quot;&gt;Bit Twiddling Hacks&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://graphics.stanford.edu/%7Eseander/&quot; rel=&quot;nofollow&quot;&gt;Sean Eron Anderson&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.necessaryandsufficient.net/2009/04/optimising-bit-counting-using-iterative-data-driven-development/&quot; rel=&quot;nofollow&quot;&gt;Optimising Bit Counting using Iterative, Data-Driven Development&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.necessaryandsufficient.net/&quot; rel=&quot;nofollow&quot;&gt;Necessary and Sufficient&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.necessaryandsufficient.net/author/admin/page/2/&quot; rel=&quot;nofollow&quot;&gt;Damien Wintour&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://bits.stephan-brumme.com/countBits.html&quot; rel=&quot;nofollow&quot;&gt;Count bits set in parallel a.k.a. Population Count&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://bits.stephan-brumme.com/&quot; rel=&quot;nofollow&quot;&gt;the bit twiddler&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stephan-brumme.com/&quot; rel=&quot;nofollow&quot;&gt;Stephan Brumme&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.strchr.com/crc32_popcnt&quot; rel=&quot;nofollow&quot;&gt;Benchmarking CRC32 and PopCnt instructions - strchr.com&lt;/a&gt; by Peter Kankowski&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://0x80.pl/articles/sse-popcount.html&quot; rel=&quot;nofollow&quot;&gt;SSSE3: fast popcount&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&lt;/a&gt;, May 24, 2008 » &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3&quot;&gt;SSSE3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://0x80.pl/articles/faster-popcount-for-large-data.html&quot; rel=&quot;nofollow&quot;&gt;Speeding up bit-parallel population count&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&lt;/a&gt;, April 13, 2015&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://0x80.pl/articles/xop-popcnt.html&quot; rel=&quot;nofollow&quot;&gt;Population count using XOP instructions&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&lt;/a&gt;, December 16, 2016 » &lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://github.com/WojciechMula/sse-popcount&quot; rel=&quot;nofollow&quot;&gt;GitHub - WojciechMula/sse-popcount: SIMD (SSE) population count&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://github.com/kimwalisch/libpopcnt&quot; rel=&quot;nofollow&quot;&gt;GitHub - kimwalisch/libpopcnt: Fast C/C++ bit population count library&lt;/a&gt; » &lt;a class=&quot;wiki_link&quot; href=&quot;/Kim%20Walisch#PopCount&quot;&gt;libpopcnt&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Kim%20Walisch&quot;&gt;Kim Walisch&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Census&quot; rel=&quot;nofollow&quot;&gt;Census from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#JohnAbercrombie&quot;&gt;John Abercrombie&lt;/a&gt; 4tet - One, one, one + Spring song, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://de.wikipedia.org/wiki/Subway_(Musikclub)&quot; rel=&quot;nofollow&quot;&gt;Subway&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Cologne&quot; rel=&quot;nofollow&quot;&gt;Cologne&lt;/a&gt;, April 12, 1999, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/3sat&quot; rel=&quot;nofollow&quot;&gt;3sat&lt;/a&gt; broadcast &lt;!-- ws:start:WikiTextRefRule:182:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://de.wikipedia.org/wiki/Ali_Haurand&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Ali Haurand from Wikipedia.de&amp;lt;/a&amp;gt; (German)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-32&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-32&quot;&gt;[32]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:182 --&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#JohnAbercrombie&quot;&gt;John Abercrombie&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Bobo_Stenson&quot; rel=&quot;nofollow&quot;&gt;Bobo Stenson&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#LarsDanielsson&quot;&gt;Lars Danielsson&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#JonChristensen&quot;&gt;Jon Christensen&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:183:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/youtube/pv5e6ZsFIBw?h=315&amp;amp;w=560&amp;quot; class=&amp;quot;WikiMedia WikiMediaYoutube&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;youtube&amp;amp;quot; key=&amp;amp;quot;pv5e6ZsFIBw&amp;amp;quot; width=&amp;amp;quot;560&amp;amp;quot;&amp;quot; title=&amp;quot;YouTube Video&amp;quot;height=&amp;quot;315&amp;quot; width=&amp;quot;560&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/pv5e6ZsFIBw&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:183 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:271:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc43&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:271 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:1117:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Cryptography&quot; rel=&quot;nofollow&quot;&gt;Cryptography&lt;/a&gt; is also a significant application of the /R function symbol, which counts the number of one bits in a word; Turing refers to this as the &amp;quot;sideways adder&amp;quot; in his quick-reference summary. from &lt;a class=&quot;wiki_link&quot; href=&quot;/Alan%20Turing&quot;&gt;Alan Turing&lt;/a&gt; (&lt;strong&gt;1949&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.computerhistory.org/chess/full_record.php?iid=doc-431614f45472f&quot; rel=&quot;nofollow&quot;&gt;Alan Turing&#039;s Manual for the Ferranti Mk. I&lt;/a&gt;&lt;/em&gt;. transcribed in 2000 by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.panix.com/~rst/&quot; rel=&quot;nofollow&quot;&gt;Robert Thau&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://archive.computerhistory.org/projects/chess/related_materials/text/2-1.Ferranti_Mark_1_manual.Turing-Alan/2-1.Ferranti_Mark_1_manual.Turing-Alan.1951.UNIVERSITY_OF_MANCHESTER.062303005.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/The%20Computer%20History%20Museum&quot;&gt;The Computer History Museum&lt;/a&gt;, 9.4 The position of the most significant digit  » &lt;a class=&quot;wiki_link&quot; href=&quot;/Ferranti%20Mark%201&quot;&gt;Ferranti Mark 1&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/en-us/articles/extending-the-worlds-most-popular-processor-architecture&quot; rel=&quot;nofollow&quot;&gt;Extending the World’s Most Popular Processor Architecture&lt;/a&gt; by R.M. Ramanathan, &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt;, covers SSE4 and popcnt&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb531475%28v=vs.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_popcnt_u64&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb385231%28v=vs.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_popcnt16, _popcnt, _popcnt64&lt;/a&gt; C-Intrinsic MSDN Library&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/lin/compiler_c/intref_cls/common/intref_allia_misc.htm&quot; rel=&quot;nofollow&quot;&gt;Miscellaneous Intrinsic&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Other-Builtins.html&quot; rel=&quot;nofollow&quot;&gt;__builtin_popcountll&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Free%20Software%20Foundation#GCC&quot;&gt;GCC&lt;/a&gt; Intrinsic&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=32227&quot; rel=&quot;nofollow&quot;&gt;Stockfish POPCNT support with gcc&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Marco%20Costalba&quot;&gt;Marco Costalba&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 31, 2010&lt;/li&gt;
&lt;li id=&quot;cite_note-8&quot;&gt;&lt;a href=&quot;#cite_ref-8&quot;&gt;^&lt;/a&gt; Color of each pixel is &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Hamming_distance&quot; rel=&quot;nofollow&quot;&gt;Hamming distance&lt;/a&gt; between the binary representations of its x and y coordinates, modulo 16, in the 16-color system, by Josiedraus, June 8, 2007, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Richard_Hamming&quot; rel=&quot;nofollow&quot;&gt;Richard Hamming from Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-9&quot;&gt;&lt;a href=&quot;#cite_ref-9&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.jjj.de/fxt/fxtbook.pdf&quot; rel=&quot;nofollow&quot;&gt;Matters Computational - ideas, algorithms, source code&lt;/a&gt; (pdf) Ideas and Source Code by &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#Arndt&quot;&gt;Jörg Arndt&lt;/a&gt;, 1.7 Functions related to the base-2 logarithm, function one_bit_q(), pp 18&lt;/li&gt;
&lt;li id=&quot;cite_note-10&quot;&gt;&lt;a href=&quot;#cite_ref-10&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan&quot; rel=&quot;nofollow&quot;&gt;Counting bits set, Brian Kernighan&#039;s way&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://graphics.stanford.edu/%7Eseander/bithacks.html&quot; rel=&quot;nofollow&quot;&gt;Bit Twiddling Hacks&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://graphics.stanford.edu/%7Eseander/&quot; rel=&quot;nofollow&quot;&gt;Sean Eron Anderson&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-11&quot;&gt;&lt;a href=&quot;#cite_ref-11&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#PWegner&quot;&gt;Peter Wegner&lt;/a&gt; (&lt;strong&gt;1960&lt;/strong&gt;). &lt;em&gt;A technique for counting ones in a binary computer&lt;/em&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/ACM#Communications&quot;&gt;Communications of the ACM&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.informatik.uni-trier.de/~ley/db/journals/cacm/cacm3.html#Wegner60&quot; rel=&quot;nofollow&quot;&gt;Volume 3, 1960&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-12&quot;&gt;&lt;a href=&quot;#cite_ref-12&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#EFBeckenbach&quot;&gt;Edwin Ford Beckenbach&lt;/a&gt; (editor) (&lt;strong&gt;1964&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/bimj.19660080310/abstract&quot; rel=&quot;nofollow&quot;&gt;Applied combinatorial mathematics&lt;/a&gt;&lt;/em&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/John_Wiley_%26_Sons&quot; rel=&quot;nofollow&quot;&gt;John Wiley&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-13&quot;&gt;&lt;a href=&quot;#cite_ref-13&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Donald Knuth&lt;/a&gt; (&lt;strong&gt;2009&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html&quot; rel=&quot;nofollow&quot;&gt;The Art of Computer Programming&lt;/a&gt;, Volume 4, Fascicle 1: Bitwise tricks &amp;amp; techniques&lt;/em&gt;, as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/fasc1a.ps.gz&quot; rel=&quot;nofollow&quot;&gt;Pre-Fascicle 1a postscript&lt;/a&gt;, Sideways addition, p 11&lt;/li&gt;
&lt;li id=&quot;cite_note-14&quot;&gt;&lt;a href=&quot;#cite_ref-14&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#MVWilkes&quot;&gt;Maurice Wilkes&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#DJWheeler&quot;&gt;David Wheeler&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Stanley_Gill&quot; rel=&quot;nofollow&quot;&gt;Stanley Gill&lt;/a&gt; (&lt;strong&gt;1951&lt;/strong&gt;). &lt;em&gt;The Preparation of Programs for an Electronic Digital Computer&lt;/em&gt;. Addison-Wesley Press; 1st edition, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.amazon.com/preparation-programs-electronic-digital-computer/dp/B0007DWTT0&quot; rel=&quot;nofollow&quot;&gt;amazon.com&lt;/a&gt;; 2nd edition 1957, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.amazon.com/preparation-programs-electronic-Addison-Wesley-mathematics/dp/B0006AV1QQ&quot; rel=&quot;nofollow&quot;&gt;amazon.com&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-15&quot;&gt;&lt;a href=&quot;#cite_ref-15&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Electronic_Delay_Storage_Automatic_Calculator&quot; rel=&quot;nofollow&quot;&gt;Electronic Delay Storage Automatic Calculator from Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-16&quot;&gt;&lt;a href=&quot;#cite_ref-16&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.billthelizard.com/2009/06/casting-out-nines.html&quot; rel=&quot;nofollow&quot;&gt;Casting Out Nines&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.billthelizard.com/&quot; rel=&quot;nofollow&quot;&gt;Bill the Lizard&lt;/a&gt;, June 13, 2009&lt;/li&gt;
&lt;li id=&quot;cite_note-17&quot;&gt;&lt;a href=&quot;#cite_ref-17&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Donald%20Knuth&quot;&gt;Donald Knuth&lt;/a&gt; (&lt;strong&gt;2009&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/taocp.html&quot; rel=&quot;nofollow&quot;&gt;The Art of Computer Programming&lt;/a&gt;, Volume 4, Fascicle 1: Bitwise tricks &amp;amp; techniques&lt;/em&gt;, as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www-cs-faculty.stanford.edu/%7Eknuth/fasc1a.ps.gz&quot; rel=&quot;nofollow&quot;&gt;Pre-Fascicle 1a postscript&lt;/a&gt;, p 9&lt;/li&gt;
&lt;li id=&quot;cite_note-18&quot;&gt;&lt;a href=&quot;#cite_ref-18&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://home.pipeline.com/~hbaker1/hakmem/hacks.html#item169&quot; rel=&quot;nofollow&quot;&gt;HAKMEM - ITEM 169 To count the ones in a PDP-6/10 word&lt;/a&gt; (in order of one-ups-manship: &lt;a class=&quot;wiki_link&quot; href=&quot;/Bill%20Gosper&quot;&gt;Gosper&lt;/a&gt;, Mann, Lenard, [Root and Mann])&lt;/li&gt;
&lt;li id=&quot;cite_note-19&quot;&gt;&lt;a href=&quot;#cite_ref-19&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.cl.cam.ac.uk/~am21/hakmemc.html&quot; rel=&quot;nofollow&quot;&gt;HAKMEMC -- HAKMEM Programming hacks in C&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.cl.cam.ac.uk/~am21/&quot; rel=&quot;nofollow&quot;&gt;Alan Mycroft&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-20&quot;&gt;&lt;a href=&quot;#cite_ref-20&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Bill%20Gosper#HAKMEM169&quot;&gt;HAKMEM 169&lt;/a&gt; for &lt;a class=&quot;wiki_link&quot; href=&quot;/PDP-6&quot;&gt;PDP-6&lt;/a&gt;/&lt;a class=&quot;wiki_link&quot; href=&quot;/PDP-10&quot;&gt;PDP-10&lt;/a&gt; 36-bit words&lt;/li&gt;
&lt;li id=&quot;cite_note-21&quot;&gt;&lt;a href=&quot;#cite_ref-21&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=200622&quot; rel=&quot;nofollow&quot;&gt;Re: About random numbers and hashing&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Sven%20Reichard&quot;&gt;Sven Reichard&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 05, 2001&lt;/li&gt;
&lt;li id=&quot;cite_note-22&quot;&gt;&lt;a href=&quot;#cite_ref-22&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=26152&quot; rel=&quot;nofollow&quot;&gt;Zobrist key random numbers&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Hyatt&quot;&gt;Robert Hyatt&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 21, 2009&lt;/li&gt;
&lt;li id=&quot;cite_note-23&quot;&gt;&lt;a href=&quot;#cite_ref-23&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.open-aurec.com/wbforum/viewtopic.php?f=4&amp;amp;t=6823&quot; rel=&quot;nofollow&quot;&gt;Magic and precomputation&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Onno%20Garms&quot;&gt;Onno Garms&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Winboard Programming Forum&lt;/a&gt;, September 23, 2007&lt;/li&gt;
&lt;li id=&quot;cite_note-24&quot;&gt;&lt;a href=&quot;#cite_ref-24&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=27820&quot; rel=&quot;nofollow&quot;&gt;fast mobility count through hashing&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Marco%20Costalba&quot;&gt;Marco Costalba&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 09, 2009&lt;/li&gt;
&lt;li id=&quot;cite_note-25&quot;&gt;&lt;a href=&quot;#cite_ref-25&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=27965&quot; rel=&quot;nofollow&quot;&gt;Piece attacks count&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Marco%20Costalba&quot;&gt;Marco Costalba&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, May 18, 2009&lt;/li&gt;
&lt;li id=&quot;cite_note-26&quot;&gt;&lt;a href=&quot;#cite_ref-26&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://cryptome.org/jya/sadd.htm&quot; rel=&quot;nofollow&quot;&gt;Sideways Add / Population Count&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.couperus.org/&quot; rel=&quot;nofollow&quot;&gt;Jitze Couperus&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Steven%20M.%20Bellovin&quot;&gt;Steve Bellovin&lt;/a&gt; et al., &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/C2Net&quot; rel=&quot;nofollow&quot;&gt;cryptography@c2.net&lt;/a&gt;, January 28, 1999&lt;/li&gt;
&lt;li id=&quot;cite_note-27&quot;&gt;&lt;a href=&quot;#cite_ref-27&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://github.com/WojciechMula/sse-popcount/blob/master/popcnt-avx512-harley-seal.cpp&quot; rel=&quot;nofollow&quot;&gt;sse-popcount/popcnt-avx512-harley-seal.cpp at master · WojciechMula/sse-popcount · GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-28&quot;&gt;&lt;a href=&quot;#cite_ref-28&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Mathematician#DAWagner&quot;&gt;David A. Wagner&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Steven%20M.%20Bellovin&quot;&gt;Steven M. Bellovin&lt;/a&gt; (&lt;strong&gt;1994&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://academiccommons.columbia.edu/catalog/ac:127097&quot; rel=&quot;nofollow&quot;&gt;A Programmable Plaintext Recognizer&lt;/a&gt;&lt;/em&gt;.&lt;/li&gt;
&lt;li id=&quot;cite_note-29&quot;&gt;&lt;a href=&quot;#cite_ref-29&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22007.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD Athlon Processor x86 Code Optimization Guide&lt;/a&gt; (pdf) Efficient 64-Bit Population Count Using MMX™ Instructions Page 184&lt;/li&gt;
&lt;li id=&quot;cite_note-30&quot;&gt;&lt;a href=&quot;#cite_ref-30&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/National_Security_Agency&quot; rel=&quot;nofollow&quot;&gt;National Security Agency from Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-31&quot;&gt;&lt;a href=&quot;#cite_ref-31&quot;&gt;^&lt;/a&gt; Michael Beeler, &lt;a class=&quot;wiki_link&quot; href=&quot;/Bill%20Gosper&quot;&gt;Bill Gosper&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Richard_Schroeppel&quot; rel=&quot;nofollow&quot;&gt;Rich Schroeppel&lt;/a&gt; (&lt;strong&gt;1972&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://home.pipeline.com/~hbaker1/hakmem/hakmem.html&quot; rel=&quot;nofollow&quot;&gt;HAKMEM&lt;/a&gt;&lt;/em&gt;, Memo 239, Artificial Intelligence Laboratory, &lt;a class=&quot;wiki_link&quot; href=&quot;/Massachusetts%20Institute%20of%20Technology&quot;&gt;Massachusetts Institute of Technology&lt;/a&gt;, made Web-available by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://home.pipeline.com/~hbaker1/&quot; rel=&quot;nofollow&quot;&gt;Henry Baker&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-32&quot;&gt;&lt;a href=&quot;#cite_ref-32&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://de.wikipedia.org/wiki/Ali_Haurand&quot; rel=&quot;nofollow&quot;&gt;Ali Haurand from Wikipedia.de&lt;/a&gt; (German)&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:1117 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:273:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc44&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:273 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:031:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Population Count&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;160&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Population Count&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;160&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Population_Count includeBody-Population%20Count includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Alcides+Schulz&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Alcides Schulz&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 29, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Algorithms&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Algorithms&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Amundsen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Amundsen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Anastasios+Milikas&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Anastasios Milikas&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Andreas+Herrmann&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Andreas Herrmann&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 7, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Assembly&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Assembly&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Asterisk&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Asterisk&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 24, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Attack+and+Defend+Maps&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Attack and Defend Maps&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX-512&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX-512&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Beaches&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Beaches&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Best+Magics+so+far&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Best Magics so far&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bill+Gosper&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bill Gosper&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 20, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bison&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bison&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 29, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit-Twiddling&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit-Twiddling&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Serialization&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Serialization&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BitScan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BitScan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BlackMamba&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BlackMamba&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Blockage+Detection&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Blockage Detection&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bobcat&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bobcat&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bouquet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bouquet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Brainless&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Brainless&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cassandre&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cassandre&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CDC+6600&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CDC 6600&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 8, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CDC+Cyber&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CDC Cyber&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 22, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cheng&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cheng&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chess+0.5&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chess 0.5&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 20, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chezzz&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chezzz&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Congruent+Modulo+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Congruent Modulo Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CookieCat&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CookieCat&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 15, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cray-1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cray-1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/David+Rasmussen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;David Rasmussen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DEC+Alpha&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DEC Alpha&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 15, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DirGolem&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DirGolem&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dispersion+and+Distortion&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dispersion and Distortion&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Djinn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Djinn&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double+and+Triple+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double and Triple (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 12, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Engin+%C3%9Cst%C3%BCn&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Engin Üstün&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 21, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ferranti+Mark+1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ferranti Mark 1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 2, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fizbo&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fizbo&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 22, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Frank+Phillips&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Frank Phillips&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Georg+von+Zimmermann&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Georg von Zimmermann&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gk&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gk&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hakkapeliitta&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hakkapeliitta&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/HeavyChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;HeavyChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 14, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Henry+S.+Warren%2C+Jr.&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Henry S. Warren, Jr.&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 14, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ifrit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ifrit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Itanium&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Itanium&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Joker+IT&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Joker IT&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kim+Walisch&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kim Walisch&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Leila&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Leila&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Little+Wing&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Little Wing&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mac+OS&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mac OS&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Marco+Costalba&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Marco Costalba&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Material+Tables&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Material Tables&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mathematician&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mathematician&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Michael+Dvorkin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Michael Dvorkin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mikhail+R.+Shura-Bura&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mikhail R. Shura-Bura&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 30, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MMX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MMX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mobility&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mobility&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 17, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nebula&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nebula&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 7, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nibble&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nibble&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Paladin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Paladin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Parallel+Prefix+Algorithms&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Parallel Prefix Algorithms&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 22, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pawn+Islands+%28Bitboards%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pawn Islands (Bitboards)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/PDP-10&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;PDP-10&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 20, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/PDP-6&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;PDP-6&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Peter+Fendrich&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Peter Fendrich&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Population+Count&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Population Count&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/PowerPC&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;PowerPC&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Prophet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Prophet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Recursion&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Recursion&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 18, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/RedQueen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;RedQueen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 13, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robert+Hyatt&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robert Hyatt&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robocide&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robocide&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Senpai&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Senpai&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Simona+Tancig&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Simona Tancig&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 7, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Space-Time+Tradeoff&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Space-Time Tradeoff&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 17, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Spector&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Spector&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Steven+Edwards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Steven Edwards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Steven+M.+Bellovin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Steven M. Bellovin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Stockfish&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Stockfish&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 7, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sungorus&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sungorus&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 11, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Syed+Fahad&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Syed Fahad&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Texel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Texel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tornado&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tornado&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Transposition+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Transposition Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tucano&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tucano&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vadim+Demichev&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vadim Demichev&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 26, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vice&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vice&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Warrior&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Warrior&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 23, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Wasp&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Wasp&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Wojciech+Mu%C5%82a&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Wojciech Muła&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64+Instructions+to+Include&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64 Instructions to Include&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 12, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Zobrist+Hashing&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Zobrist Hashing&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 22, 2018&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:031 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Quad Word</title>
      <link>https://chessprogramming.wikispaces.com/Quad+Word</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Quad+Word</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Quad+Word</comments>
      <pubDate>Sun, 25 Jan 2015 22:19:50 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:23:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#long long or long&quot;&gt;long long or long&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Bitboards&quot;&gt;Bitboards&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Ranges&quot;&gt;Ranges&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Alignment&quot;&gt;Alignment&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Endianness&quot;&gt;Endianness&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Endianness-Litte-endian layout&quot;&gt;Litte-endian layout&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Endianness-Big-endian layout&quot;&gt;Big-endian layout&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;!-- ws:start:WikiTextTocRule:32: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:32 --&gt;&lt;!-- ws:start:WikiTextTocRule:33: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:33 --&gt;&lt;!-- ws:start:WikiTextTocRule:34: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:34 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Programming&quot;&gt;Programming&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Data&quot;&gt;Data&lt;/a&gt; * Quad Word&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
According to &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&#039;s&lt;/a&gt; definition of a &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; 16-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;Word&lt;/a&gt;, a &lt;strong&gt;Quad Word&lt;/strong&gt; refers a 64-bit word.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:3:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;long long or long&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:3 --&gt;long long or long&lt;/h1&gt;
 Microsoft 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;-compiler long is still 32-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;Double Word&lt;/a&gt;, while 64-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Free%20Software%20Foundation#GCC&quot;&gt;GCC&lt;/a&gt; uses 64-bit Quad Words as longs. Other compiler require &amp;quot;long long&amp;quot; for 64-bit types.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;typedef unsigned long QWORD;&amp;lt;br/&amp;gt;typedef unsigned long long QWORD;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; QWORD&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; QWORD&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Bitboards&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;Bitboards&lt;/h1&gt;
 Quad words are used as &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboard&lt;/a&gt; datatype:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;typedef QWORD U64;&amp;lt;br/&amp;gt;typedef QWORD Bitboard;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; QWORD U64&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; QWORD Bitboard&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Ranges&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;Ranges&lt;/h1&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;type&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;language&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;min&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;max&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;unsigned long long&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;18,446,744,073,709,551,615&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;hexadecimal&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x0000000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xFFFFFFFFFFFFFFFF&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;long long&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;-9,223,372,036,854,775,808&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;9,223,372,036,854,775,807&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;hexadecimal&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x8000000000000000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x7FFFFFFFFFFFFFFF&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Alignment&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Alignment&lt;/h1&gt;
 Quad Words stored in memory should be stored at byte addresses divisible by eight. Otherwise at runtime it will cause a miss-alignment exception on some processors, or a huge penalty on others.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Endianness&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;Endianness&lt;/h1&gt;
 &lt;em&gt;Main article: &lt;a class=&quot;wiki_link&quot; href=&quot;/Endianness&quot;&gt;Endianness&lt;/a&gt;.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Endianness-Litte-endian layout&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;Litte-endian layout&lt;/h2&gt;
 The &lt;a class=&quot;wiki_link&quot; href=&quot;/Little-endian&quot;&gt;little-endian&lt;/a&gt; memory layout, as typical for &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; cpus.&lt;br /&gt;
For instance the quad word integer 0x0102030405060708&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;Address&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Byte&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Significance&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x08&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;LS Byte&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x07&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0002&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x06&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0003&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x05&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0004&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x04&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0005&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x03&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0006&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x02&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0008&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x01&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;MS Byte&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Endianness-Big-endian layout&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;Big-endian layout&lt;/h2&gt;
 The &lt;a class=&quot;wiki_link&quot; href=&quot;/Big-endian&quot;&gt;big-endian&lt;/a&gt; memory layout, as typical for &lt;a class=&quot;wiki_link&quot; href=&quot;/Motorola&quot;&gt;Motorola&lt;/a&gt; cpus.&lt;br /&gt;
For instance the quad word integer 0x0102030405060708&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;Address&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Byte&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Significance&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0000&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x01&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;MS Byte&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0001&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x02&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0002&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x03&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0003&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x04&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0004&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x05&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0005&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x06&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0006&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x07&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;0x0007&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;0x08&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: center;&quot;&gt;LS Byte&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;Byte&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;Word&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;Double Word&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Word_%28computer_science%29#Dword.2C_Qword.2C_and_Oword&quot; rel=&quot;nofollow&quot;&gt;Dword, Qword, and Oword from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Byte&quot; rel=&quot;nofollow&quot;&gt;Byte from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Endianness&quot; rel=&quot;nofollow&quot;&gt;Endianness from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://betterexplained.com/articles/understanding-big-and-little-endian-byte-order/&quot; rel=&quot;nofollow&quot;&gt;Understanding Big and Little Endian Byte Order&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.ietf.org/rfc/ien/ien137.txt&quot; rel=&quot;nofollow&quot;&gt;IEN 137 - DAV&#039;s Endian FAQ - On Holy Wars and a Plea for Peace&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.myri.com/staff/cohen/&quot; rel=&quot;nofollow&quot;&gt;Danny Cohen&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://ai.isi.edu/&quot; rel=&quot;nofollow&quot;&gt;U S C/I S I&lt;/a&gt;, April 1, 1980&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc9&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;What links here?&lt;/h1&gt;
&lt;!-- ws:start:WikiTextIncludeRule:02:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Quad Word&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Quad Word&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Quad_Word includeBody-Quad%20Word includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX-512&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX-512&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Big-endian&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Big-endian&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 29, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Serialization&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Serialization&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Byte&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Byte&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Data&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Data&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DEC+Alpha&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DEC Alpha&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 15, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dictionary&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dictionary&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 30, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double+Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/King+Pattern&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;King Pattern&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 15, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Little-endian&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Little-endian&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MMX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MMX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Quad+Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Quad Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shared+Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shared Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 11, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Transposition+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Transposition Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 19, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Tucano&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Tucano&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/XOP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;XOP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:02 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Data&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>SSE2</title>
      <link>https://chessprogramming.wikispaces.com/SSE2</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/SSE2</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/SSE2</comments>
      <pubDate>Tue, 27 Feb 2018 10:33:25 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:67:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:67 --&gt;&lt;!-- ws:start:WikiTextTocRule:68: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Integer Instructions&quot;&gt;Integer Instructions&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:68 --&gt;&lt;!-- ws:start:WikiTextTocRule:69: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Applications&quot;&gt;Applications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:69 --&gt;&lt;!-- ws:start:WikiTextTocRule:70: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-One Step Only&quot;&gt;One Step Only&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:70 --&gt;&lt;!-- ws:start:WikiTextTocRule:71: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-East Attacks&quot;&gt;East Attacks&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:71 --&gt;&lt;!-- ws:start:WikiTextTocRule:72: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-SSE2 dot product&quot;&gt;SSE2 dot product&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:72 --&gt;&lt;!-- ws:start:WikiTextTocRule:73: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-Rotated Dot Product&quot;&gt;Rotated Dot Product&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:73 --&gt;&lt;!-- ws:start:WikiTextTocRule:74: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-SSE2 Population Count&quot;&gt;SSE2 Population Count&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:74 --&gt;&lt;!-- ws:start:WikiTextTocRule:75: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#SSE2-Wrapper in C++&quot;&gt;SSE2-Wrapper in C++&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:75 --&gt;&lt;!-- ws:start:WikiTextTocRule:76: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:76 --&gt;&lt;!-- ws:start:WikiTextTocRule:77: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Manuals&quot;&gt;Manuals&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:77 --&gt;&lt;!-- ws:start:WikiTextTocRule:78: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:78 --&gt;&lt;!-- ws:start:WikiTextTocRule:79: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:79 --&gt;&lt;!-- ws:start:WikiTextTocRule:80: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:80 --&gt;&lt;!-- ws:start:WikiTextTocRule:81: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:81 --&gt;&lt;!-- ws:start:WikiTextTocRule:82: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:82 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; * SSE2&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SSE2&lt;/strong&gt; (Streaming SIMD Extensions 2) and further &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt;- or &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; streaming &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD&lt;/a&gt; extensions, like &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE3&quot;&gt;SSE3&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3&quot;&gt;SSSE3&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4&quot;&gt;SSE4&lt;/a&gt; and AMD&#039;s announced &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE5&quot;&gt;SSE5&lt;/a&gt;, as major enhancement to &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE&quot;&gt;SSE&lt;/a&gt;, provide an instruction set on 128-bit registers, namely on &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;vectors&lt;/a&gt; of four &lt;a class=&quot;wiki_link&quot; href=&quot;/Float&quot;&gt;floats&lt;/a&gt; or two &lt;a class=&quot;wiki_link&quot; href=&quot;/Double&quot;&gt;doubles&lt;/a&gt;, as well since SSE2 as vectors of 16 &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;bytes&lt;/a&gt;, eight &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;words&lt;/a&gt;, four &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;double words&lt;/a&gt; or two &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;quad words&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:14:&amp;amp;lt;ref&amp;amp;gt; &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://support.amd.com/TechDocs/26568.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AMD64 Architecture, Programmer’s Manual, Volume 4 128-Bit Media Instructions&amp;lt;/a&amp;gt; (pdf), has detailed explanations on all SSE2 128-Bit Media Instructions.&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:14 --&gt; . In 64-bit mode there are 16 xmm registers available, xmm0..xmm15, in 32-bit mode only eight, xmm0..xmm7. SSE is explicitly available through &lt;a class=&quot;wiki_link&quot; href=&quot;/C-Compiler&quot;&gt;C-Compiler&lt;/a&gt; intrinsics &lt;!-- ws:start:WikiTextRefRule:16:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/84t4h8ys%28v=VS.100%29.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Integer Intrinsics Using Streaming SIMD Extensions 2&amp;lt;/a&amp;gt; Visual C++ Developer Center - Run-Time Library Reference&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:16 --&gt; or (inline) &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly&quot;&gt;assembly&lt;/a&gt;. Some compiler implicitly use SSE-float and double instructions for floating point data types, others even provide automatic SSE2 vectorization, while processing &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;arrays&lt;/a&gt; of various integer types. SSE- and SSE2-intrinsic functions are available in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Visual_C%2B%2B&quot; rel=&quot;nofollow&quot;&gt;Visual C&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:18:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/x8zs5twb%28v=VS.100%29.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Instruction Reference&amp;lt;/a&amp;gt; Visual C++ Developer Center - Run-Time Library Reference&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:18 --&gt; or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_C%2B%2B_Compiler&quot; rel=&quot;nofollow&quot;&gt;Intel-C&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:21:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/index.htm&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Intel(R) C++ Compiler User and Reference Guides&amp;lt;/a&amp;gt; covers Intrinsics&amp;lt;br /&amp;gt;
&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:21 --&gt; &lt;!-- ws:start:WikiTextRefRule:23:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://softwarecommunity.intel.com/isn/downloads/softwareproducts/pdfs/347603.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Intel C++ Compiler for Linux Intrinsics Reference&amp;lt;/a&amp;gt; (pdf)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:23 --&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:39:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Integer Instructions&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:39 --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2%20Instructions%20to%20Include&quot;&gt;Integer Instructions&lt;/a&gt;&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:012:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/page?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;SSE2 Instructions to Include&amp;amp;quot;&amp;quot; title=&amp;quot;Include page: page=&amp;amp;quot;SSE2 Instructions to Include&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; - &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt; C-integer intrinsic reference from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/default.aspx&quot; rel=&quot;nofollow&quot;&gt;MSDN Library&lt;/a&gt;, the intrinsic data type &lt;strong&gt;_m128i&lt;/strong&gt; refers a xmm-register or memory location:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;Mnemonic&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Description&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;C-Intrinsic&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th colspan=&quot;2&quot;&gt;bitwise logical&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;return&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;parameter&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pand&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed and, r := a &amp;amp; b&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/6d1txsa8%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_and_si128&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pandn&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed and not, r := ~a &amp;amp; b&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/1beaceh8%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_andnot_si128&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;por&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed or, r := a | b&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/ew8ty0db%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_or_si128&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pxor&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed xor, r:= a ^ b&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn2.microsoft.com/en-us/library/fzt08www%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_xor_si128&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th colspan=&quot;2&quot;&gt;quad word shifts&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;psrlq&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed shift right logical quad&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/yf6cf9k8%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_srl_epi64&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i cnt)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;immediate&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/btdyeyt1%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_srli_epi64&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, int cnt)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;psllq&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed shift left logical quad&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/6ta9dffd%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_sll_epi64&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i cnt)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;immediate&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/da6131h7%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_slli_epi64&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, int cnt)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th colspan=&quot;2&quot;&gt;arithmetical&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;paddb&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed add bytes&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/yc7tcyzs%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_add_epi8&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;psubb&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed subtract bytes&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/tb4wh6zw%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_sub_epi8&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;psadbw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed sum of absolute differences&lt;br /&gt;
of bytes into a word&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/b0yshs6s%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_sad_epu8&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pmaxsw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed maximum signed words&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/3x060h7c%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_max_epi16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pmaxub&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed maximum unsigned bytes&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/st6634za%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_max_epu8&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pminsw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed minimum signed words&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/6te997ew%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_min_epi16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pminub&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed minimum unsigned bytes&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/17k8cf58%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_min_epu8&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pcmpeqb&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed compare equal bytes&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bz5xk21a%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_cmpeq_epi8&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pmullw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed multiply mow signed (unsigned) word&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/9ks1472s%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_mullo_epi16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pmulhw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed multiply high signed word&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/59hddw1d%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_mulhi_epi16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pmulhuw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed multiply high unsigned word&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ha2xy7tx%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_mulhi_epu16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pmaddwd&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed multiply words and add doublewords&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;_m128&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/yht36sa6%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_madd_epi16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, _m128i b)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th colspan=&quot;2&quot;&gt;unpack, shuffle&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;punpcklbw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;unpack and interleave low bytes&lt;br /&gt;
&lt;tt&gt;gGhHfFeE:dDcCbBaA :=&lt;/tt&gt;&lt;br /&gt;
&lt;tt&gt;xxxxxxxx:GHFEDCBA #&lt;/tt&gt;&lt;br /&gt;
&lt;tt&gt;xxxxxxxx:ghfedcba&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/xf7k860c%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_unpacklo_epi8&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i A, _m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;punpckhbw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;unpack and interleave high bytes&lt;br /&gt;
&lt;tt&gt;gGhHfFeE:dDcCbBaA :=&lt;/tt&gt;&lt;br /&gt;
&lt;tt&gt;GHFEDCBA:xxxxxxxx #&lt;/tt&gt;&lt;br /&gt;
&lt;tt&gt;ghfedcba:xxxxxxxx&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/t5h7783k%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_unpackhi_epi8&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i A, _m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;punpcklwd&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;unpack and interleave low words&lt;br /&gt;
&lt;tt&gt;dDcC:bBaA := xxxx:DCBA#xxxx:dcba&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/btxb17bw%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_unpacklo_epi16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i A, _m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;punpckhwd&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;unpack and interleave high words&lt;br /&gt;
&lt;tt&gt;dDcC:bBaA := DCBA:xxxx#dcba:xxxx&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/03196cz7%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_unpackhi_epi16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i A, _m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;punpckldq&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;unpack and interleave low doublewords&lt;br /&gt;
&lt;tt&gt;bB:aA := xx:BA # xx:ba&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/x8atst9d%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_unpacklo_epi32&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i A, _m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;punpckhdq&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;unpack and interleave high doublewords&lt;br /&gt;
&lt;tt&gt;bB:aA := BA:xx # ba:xx&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/65sa7cbs%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_unpackhi_epi32&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i A, _m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;punpcklqdq&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;unpack and interleave low quadwords&lt;br /&gt;
&lt;tt&gt;a:A := x:A # x:a&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ac53z079%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_unpacklo_epi64&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i A, _m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;punpckhqdq&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;unpack and interleave high quadwords&lt;br /&gt;
&lt;tt&gt;a:A := A:x # a:x&lt;/tt&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/1ba18ey1%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_unpackhi_epi64&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i A, _m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pshuflw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed shuffle low words&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/y41dkk37%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_shufflelo_epi16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, int imm)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pshufhw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed shuffle high words&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/13ywktbs%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_shufflehi_epi16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, int imm)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pshufd&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed shuffle doublewords&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/56f67xbk%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_shuffle_epi32&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, int imm)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th colspan=&quot;2&quot;&gt;load, store, moves&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;movdqa&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;move aligned double quadword&lt;br /&gt;
xmm := *p&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/atzzad1h%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_load_si128&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i *p)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;movdqu&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;move unaligned double quadword&lt;br /&gt;
xmm := *p&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/f4k12ae8%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_loadu_si128&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i *p)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;movdqa&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;move aligned double quadword&lt;br /&gt;
*p := xmm&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;void&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/edk11s13%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_store_si128&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i *p, _m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;movdqu&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;move unaligned double quadword&lt;br /&gt;
*p := xmm&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;void&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/w1k1k29t.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_storeu_si128&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i *p, _m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;movq&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;move quadword, xmm := gp64&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb514072%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_cvtsi64_si128&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_int64 a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;movq&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;move quadword, gp64 := xmm&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_int64&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb531384%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_cvtsi128_si64&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;movd&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;move double word or quadword&lt;br /&gt;
xmm := gp64&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/6xsd2b20%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_cvtsi64x_si128&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_int64 value)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;movd&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;move doubleword, xmm := gp32&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/ct3539ha%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_cvtsi32_si128&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(int a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;movd&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;move doubleword, gp32 := xmm&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;int&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/5z7a9642%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_cvtsi128_si32&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pextrw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;extract packed word, gp16 := xmm[i]&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;int&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/6dceta0c%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_extract_epi16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, int imm)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pinsrw&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed insert word, xmm[i] := gp16&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;_m128i&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/kaze8hz1%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_insert_epi16&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a, int b, int imm)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;pmovmskb&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;packed move mask byte,&lt;br /&gt;
gp32 := 16 sign-bits(xmm)&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;int&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/0dkktcf5%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_movemask_epi&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(_m128i a)&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;th colspan=&quot;2&quot;&gt;cache support&lt;br /&gt;
&lt;/th&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;strong&gt;prefetch&lt;/strong&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;void&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/84szxsww%28VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_prefetch&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;(char * p , int i )&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:end:WikiTextIncludeRule:012 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:41:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Applications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:41 --&gt;Applications&lt;/h1&gt;
 Some vc2005 tested, sample SSE2 &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboard&lt;/a&gt; routines:&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:83:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@OneStepOnlySSE2&amp;quot; title=&amp;quot;Anchor: OneStepOnlySSE2&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;OneStepOnlySSE2&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:83 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:43:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Applications-One Step Only&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:43 --&gt;One Step Only&lt;/h2&gt;
 Since 128-bit xmm registers may treated as vector of 16 bytes, shifting techniques such as &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#OneStepOnly&quot;&gt; one step&lt;/a&gt; in all eight directions can be done more efficiently with respect to wraps from a- to the h-file or vice versa. It is recommend to write a own SSE2-wrapper class with overloaded operators in C++ to encapsulate a vector of two bitboards.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;  northwest    north   northeast&amp;lt;br/&amp;gt;  noWe         nort         noEa&amp;lt;br/&amp;gt;          +7    +8    +9&amp;lt;br/&amp;gt;              \  |  /&amp;lt;br/&amp;gt;  west    -1 &amp;amp;lt;-  0 -&amp;amp;gt; +1    east&amp;lt;br/&amp;gt;              /  |  \&amp;lt;br/&amp;gt;          -9    -8    -7&amp;lt;br/&amp;gt;  soWe         sout         soEa&amp;lt;br/&amp;gt;  southwest    south   southeast&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;  northwest    north   northeast
  noWe         nort         noEa
          +7    +8    +9
              \  |  /
  west    -1 &amp;lt;-  0 -&amp;gt; +1    east
              /  |  \
          -9    -8    -7
  soWe         sout         soEa
  southwest    south   southeast&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;Veritcal steps as usual with 64-byte shift a rank each:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;__m128i nortOne(__m128i b) {&amp;lt;br/&amp;gt;   b = _mm_slli_epi64 (b, 8);&amp;lt;br/&amp;gt;   return b;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;__m128i soutOne(__m128i b) {&amp;lt;br/&amp;gt;   b = _mm_srli_epi64 (b, 8);&amp;lt;br/&amp;gt;   return b;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;__m128i nortOne&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_slli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
__m128i soutOne&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_srli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;Unfortunately there is no byte-wise shift in the SSE2-instruction set (as well as MMX), but using byte-wise parallel add avoids using the wrap masks, which need otherwise load from memory or computed. Applying the wraps mask takes two instructions.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;__m128i butNotA(__m128i b) {&amp;lt;br/&amp;gt;   b = _mm_srli_epi64 (b, 1);&amp;lt;br/&amp;gt;   b = _mm_add_epi8   (b, b);&amp;lt;br/&amp;gt;   return b;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;__m128i butNotH(__m128i b) {&amp;lt;br/&amp;gt;   b = _mm_add_epi8   (b, b);&amp;lt;br/&amp;gt;   b = _mm_srli_epi64 (b, 1);&amp;lt;br/&amp;gt;   return b;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;__m128i butNotA&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_srli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
__m128i butNotH&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_srli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;This is how the east direction are computed based on parallel byte-wise add. Either one or two SSE2-instructions:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;__m128i eastOne(__m128i b) {&amp;lt;br/&amp;gt;   b = _mm_add_epi8   (b, b);&amp;lt;br/&amp;gt;   return b;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;__m128i noEaOne (__m128i b) {&amp;lt;br/&amp;gt;   b = _mm_add_epi8   (b, b);&amp;lt;br/&amp;gt;   b = _mm_slli_epi64 (b, 8);&amp;lt;br/&amp;gt;   return b;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;__m128i soEaOne (__m128i b) {&amp;lt;br/&amp;gt;   b = _mm_add_epi8   (b, b);&amp;lt;br/&amp;gt;   b = _mm_srli_epi64 (b, 8);&amp;lt;br/&amp;gt;   return b;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;__m128i eastOne&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
__m128i noEaOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_slli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
__m128i soEaOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_srli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;West directions need a leading not A-file and take three instructions each:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;__m128i westOne(__m128i b) {&amp;lt;br/&amp;gt;   b = _mm_srli_epi64 (b, 1);&amp;lt;br/&amp;gt;   b = _mm_add_epi8   (b, b);&amp;lt;br/&amp;gt;   b = _mm_srli_epi64 (b, 1);&amp;lt;br/&amp;gt;   return b;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;__m128i soWeOne (__m128i b) {&amp;lt;br/&amp;gt;   b = _mm_srli_epi64 (b, 1);&amp;lt;br/&amp;gt;   b = _mm_add_epi8   (b, b);&amp;lt;br/&amp;gt;   b = _mm_srli_epi64 (b, 9);&amp;lt;br/&amp;gt;   return b;&amp;lt;br/&amp;gt;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;__m128i noWeOne (__m128i b) {&amp;lt;br/&amp;gt;   b = _mm_srli_epi64 (b, 1);&amp;lt;br/&amp;gt;   b = _mm_add_epi8   (b, b);&amp;lt;br/&amp;gt;   b = _mm_slli_epi64 (b, 7);&amp;lt;br/&amp;gt;   return b;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;__m128i westOne&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_srli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_srli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
__m128i soWeOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_srli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_srli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
__m128i noWeOne &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_srli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_slli_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; b&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:84:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@EastAttacks&amp;quot; title=&amp;quot;Anchor: EastAttacks&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;EastAttacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:84 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:45:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Applications-East Attacks&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:45 --&gt;East Attacks&lt;/h2&gt;
 SIMD-wise &lt;a class=&quot;wiki_link&quot; href=&quot;/Fill%20by%20Subtraction&quot;&gt;Fill by Subtraction&lt;/a&gt; with byte- or rank-wise arithmetic takes only a few instructions with SSE2:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;__m128i eastAttacks (__m128i occ, __m128i rooks) {&amp;lt;br/&amp;gt;   __m128i tmp;&amp;lt;br/&amp;gt;   occ  = _mm_or_si128 (occ, rooks);  //  make rooks member of occupied&amp;lt;br/&amp;gt;   tmp  = _mm_xor_si128(occ, rooks);  // occ - rooks&amp;lt;br/&amp;gt;   tmp  = _mm_sub_epi8 (tmp, rooks);  // occ - 2*rooks&amp;lt;br/&amp;gt;   return _mm_xor_si128(occ, tmp);    // occ ^ (occ - 2*rooks)&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;__m128i eastAttacks &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i occ, __m128i rooks&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   __m128i tmp&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   occ  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_or_si128 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, rooks&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;//  make rooks member of occupied&lt;/span&gt;
   tmp  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_xor_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, rooks&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// occ - rooks&lt;/span&gt;
   tmp  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sub_epi8 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;tmp, rooks&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;co1&quot;&gt;// occ - 2*rooks&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; _mm_xor_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, tmp&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;// occ ^ (occ - 2*rooks)&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:85:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@SSE2dotproduct&amp;quot; title=&amp;quot;Anchor: SSE2dotproduct&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;SSE2dotproduct&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:85 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:47:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Applications-SSE2 dot product&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:47 --&gt;SSE2 dot product&lt;/h2&gt;
 The &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Dot_product&quot; rel=&quot;nofollow&quot;&gt;dot product&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:25:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://mathworld.wolfram.com/DotProduct.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Dot Product - from Wolfram MathWorld&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:25 --&gt; of a vector of &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit&quot;&gt;bits&lt;/a&gt; by a weight vector of &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;bytes&lt;/a&gt; might be used in determining &lt;a class=&quot;wiki_link&quot; href=&quot;/Mobility&quot;&gt;mobility&lt;/a&gt; for &lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation&quot;&gt;evaluation&lt;/a&gt; purposes. The vector of bits is a bitboard of all squares attacked by one (or multiple) piece(s), while the the weight vector considers the &amp;quot;importance&amp;quot; of &lt;a class=&quot;wiki_link&quot; href=&quot;/Squares&quot;&gt;squares&lt;/a&gt;, like center control, or even &lt;a class=&quot;wiki_link&quot; href=&quot;/King%20Safety#SquareControl&quot;&gt;square controls&lt;/a&gt; near the opponent &lt;a class=&quot;wiki_link&quot; href=&quot;/King&quot;&gt;king&lt;/a&gt;, e.g. by providing 64 weight vectors for each king square.&lt;br /&gt;
&lt;br /&gt;
&lt;ul class=&quot;quotelist&quot;&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextMathRule:12:
[[math]]&amp;lt;br/&amp;gt;
 \mathbf{bb}\cdot \mathbf{weights} = \sum_{i=1}^{64} bb_iweights_i = bb_1weights_1 + \cdots + bb_{64}weights_{64} &amp;lt;br/&amp;gt;[[math]]
 --&gt;&lt;script type=&quot;math/tex&quot;&gt; \mathbf{bb}\cdot \mathbf{weights} = \sum_{i=1}^{64} bb_iweights_i = bb_1weights_1 + \cdots + bb_{64}weights_{64} &lt;/script&gt;&lt;!-- ws:end:WikiTextMathRule:12 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
The 64-bit times 64-byte dot product implements a kind of weighted &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;population count&lt;/a&gt; similar than following loop approach, but completely unrolled and &lt;a class=&quot;wiki_link&quot; href=&quot;/Avoiding%20Branches&quot;&gt;branchless&lt;/a&gt;:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int dotProduct(U64 bb, BYTE weights[])&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   U64 bit  = 1;&amp;lt;br/&amp;gt;   int accu = 0;&amp;lt;br/&amp;gt;   for (int sq=0; sq &amp;amp;lt; 64; sq++, bit += bit) {&amp;lt;br/&amp;gt;      if ( bb &amp;amp;amp; bit) accu += weights[sq];&amp;lt;br/&amp;gt;      // accu += weights[sq] &amp;amp;amp; -((  bb &amp;amp;amp; bit) == bit); // branchless 1&amp;lt;br/&amp;gt;      // accu += weights[sq] &amp;amp;amp; -(( ~bb &amp;amp;amp; bit) == 0);   // branchless 2&amp;lt;br/&amp;gt;   }&amp;lt;br/&amp;gt;   return accu;&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; dotProduct&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb, BYTE weights&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   U64 bit  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; accu &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sq&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; sq&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;, bit &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; bit&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; bb &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; bit&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; accu &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; weights&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;co1&quot;&gt;// accu += weights[sq] &amp;amp; -((  bb &amp;amp; bit) == bit); // branchless 1&lt;/span&gt;
      &lt;span class=&quot;co1&quot;&gt;// accu += weights[sq] &amp;amp; -(( ~bb &amp;amp; bit) == 0);   // branchless 2&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; accu&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;The SSE2 routine expands a bitboard as a vector of 64 bits into 64-bytes inside four 128-bit xmm registers, and performs the multiplication with the byte-vector by bitwise &#039;and&#039;, before it finally adds all bytes together. The bitboard is therefor manifolded eight times with a sequence of seven unpack and interleave instructions to remain the same expanded byte-order of the bits from the bitboards, before to mask and compare them with a vector of bytes with one appropriate bit set each.&lt;br /&gt;
&lt;br /&gt;
The dot product is designed for unsigned weights in the 0..63 range, so that vertical bytewise adds of the four weights can not overflow. Nevertheless, three &lt;em&gt;PADDUSB - packed add unsigned byte with saturation&lt;/em&gt; instructions (&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/9hahyddy%28VS.80%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_adds_epu8&lt;/a&gt;) are used to limit the maximum four byte sum to 255 to make the routine more &amp;quot;robust&amp;quot; for cases with average weights greater than 63. The horizontal add of both &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;quad words&lt;/a&gt; of the 128-bit xmmregister is performed by the &lt;em&gt;PSADBW - packed sum of absolute differences of bytes into a word&lt;/em&gt; instruction (&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/b0yshs6s.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_sad_epu8&lt;/a&gt;) with zero, while the final add of the two resulting &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;word&lt;/a&gt; sums in the high and low quad word of the xmm register is done with general purpose registers.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;#include &amp;amp;lt;emmintrin.h&amp;amp;gt;&amp;lt;br/&amp;gt;#define XMM_ALIGN __declspec(align(16))&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;/* for average weights &amp;amp;lt; 64 */&amp;lt;br/&amp;gt;int dotProduct64(U64 bb, BYTE weights[] /* XMM_ALIGN */)&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   static const U64 XMM_ALIGN sbitmask[2] = {&amp;lt;br/&amp;gt;     C64(0x8040201008040201),&amp;lt;br/&amp;gt;     C64(0x8040201008040201)&amp;lt;br/&amp;gt;   };&amp;lt;br/&amp;gt;   __m128i x0, x1, x2, x3, bm;&amp;lt;br/&amp;gt;   __m128i* pW = (__m128i*) weights;&amp;lt;br/&amp;gt;   bm = _mm_load_si128 ( (__m128i*) sbitmask);&amp;lt;br/&amp;gt;   x0 = _mm_cvtsi64x_si128(bb);        // 0000000000000000:8040201008040201&amp;lt;br/&amp;gt;   // extend bits to bytes&amp;lt;br/&amp;gt;   x0 = _mm_unpacklo_epi8  (x0, x0);   // 8080404020201010:0808040402020101&amp;lt;br/&amp;gt;   x2 = _mm_unpackhi_epi16 (x0, x0);   // 8080808040404040:2020202010101010&amp;lt;br/&amp;gt;   x0 = _mm_unpacklo_epi16 (x0, x0);   // 0808080804040404:0202020201010101&amp;lt;br/&amp;gt;   x1 = _mm_unpackhi_epi32 (x0, x0);   // 0808080808080808:0404040404040404&amp;lt;br/&amp;gt;   x0 = _mm_unpacklo_epi32 (x0, x0);   // 0202020202020202:0101010101010101&amp;lt;br/&amp;gt;   x3 = _mm_unpackhi_epi32 (x2, x2);   // 8080808080808080:4040404040404040&amp;lt;br/&amp;gt;   x2 = _mm_unpacklo_epi32 (x2, x2);   // 2020202020202020:1010101010101010&amp;lt;br/&amp;gt;   x0 = _mm_and_si128      (x0, bm);&amp;lt;br/&amp;gt;   x1 = _mm_and_si128      (x1, bm);&amp;lt;br/&amp;gt;   x2 = _mm_and_si128      (x2, bm);&amp;lt;br/&amp;gt;   x3 = _mm_and_si128      (x3, bm);&amp;lt;br/&amp;gt;   x0 = _mm_cmpeq_epi8     (x0, bm);&amp;lt;br/&amp;gt;   x1 = _mm_cmpeq_epi8     (x1, bm);&amp;lt;br/&amp;gt;   x2 = _mm_cmpeq_epi8     (x2, bm);&amp;lt;br/&amp;gt;   x3 = _mm_cmpeq_epi8     (x3, bm);&amp;lt;br/&amp;gt;   // multiply by &amp;amp;quot;and&amp;amp;quot; with -1 or 0&amp;lt;br/&amp;gt;   x0 = _mm_and_si128      (x0, pW[0]);&amp;lt;br/&amp;gt;   x1 = _mm_and_si128      (x1, pW[1]);&amp;lt;br/&amp;gt;   x2 = _mm_and_si128      (x2, pW[2]);&amp;lt;br/&amp;gt;   x3 = _mm_and_si128      (x3, pW[3]);&amp;lt;br/&amp;gt;   // add all bytes (with saturation)&amp;lt;br/&amp;gt;   x0 = _mm_adds_epu8      (x0, x1);&amp;lt;br/&amp;gt;   x0 = _mm_adds_epu8      (x0, x2);&amp;lt;br/&amp;gt;   x0 = _mm_adds_epu8      (x0, x3);&amp;lt;br/&amp;gt;   x0 = _mm_sad_epu8       (x0, _mm_setzero_si128 ());&amp;lt;br/&amp;gt;   return _mm_cvtsi128_si32(x0)&amp;lt;br/&amp;gt;        + _mm_extract_epi16(x0, 4);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#include &amp;lt;emmintrin.h&amp;gt;&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#define XMM_ALIGN __declspec(align(16))&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;coMULTI&quot;&gt;/* for average weights &amp;lt; 64 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; dotProduct64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb, BYTE weights&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* XMM_ALIGN */&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 XMM_ALIGN sbitmask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
     C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x8040201008040201&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;,
     C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x8040201008040201&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   __m128i x0, x1, x2, x3, bm&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   __m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; pW &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; weights&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   bm &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_load_si128 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; sbitmask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cvtsi64x_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;        &lt;span class=&quot;co1&quot;&gt;// 0000000000000000:8040201008040201&lt;/span&gt;
   &lt;span class=&quot;co1&quot;&gt;// extend bits to bytes&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_unpacklo_epi8  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, x0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// 8080404020201010:0808040402020101&lt;/span&gt;
   x2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_unpackhi_epi16 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, x0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// 8080808040404040:2020202010101010&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_unpacklo_epi16 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, x0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// 0808080804040404:0202020201010101&lt;/span&gt;
   x1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_unpackhi_epi32 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, x0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// 0808080808080808:0404040404040404&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_unpacklo_epi32 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, x0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// 0202020202020202:0101010101010101&lt;/span&gt;
   x3 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_unpackhi_epi32 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x2, x2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// 8080808080808080:4040404040404040&lt;/span&gt;
   x2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_unpacklo_epi32 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x2, x2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;co1&quot;&gt;// 2020202020202020:1010101010101010&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, bm&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x1, bm&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x2, bm&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x3 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x3, bm&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cmpeq_epi8     &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, bm&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cmpeq_epi8     &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x1, bm&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cmpeq_epi8     &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x2, bm&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x3 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cmpeq_epi8     &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x3, bm&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;co1&quot;&gt;// multiply by &amp;quot;and&amp;quot; with -1 or 0&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, pW&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x1, pW&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x2, pW&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x3 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x3, pW&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;co1&quot;&gt;// add all bytes (with saturation)&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_adds_epu8      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, x1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_adds_epu8      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, x2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_adds_epu8      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, x3&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sad_epu8       &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, _mm_setzero_si128 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; _mm_cvtsi128_si32&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; _mm_extract_epi16&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;!-- ws:start:WikiTextHeadingRule:49:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Applications-Rotated Dot Product&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:49 --&gt;Rotated Dot Product&lt;/h2&gt;
 A little bit cheaper is to expand the bitboard to a vector or 90 degree rotated {0,255} bytes, which requires a rotated weight vector as well &lt;!-- ws:start:WikiTextRefRule:29:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.stmintz.com/ccc/index.php?id=377546&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;SSE2 bit[64] * byte[64] dot product&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Gerd%20Isenberg&amp;quot;&amp;gt;Gerd Isenberg&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;Computer Chess Forums&amp;lt;/a&amp;gt;, July 17, 2004&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-7&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-7&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:29 --&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/* for average weights &amp;amp;lt; 64 */&amp;lt;br/&amp;gt;int dotProduct64(U64 bb, BYTE weightsRot90[] /* XMM_ALIGN */)&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   static const U64 CACHE_ALIGN masks[8] = {&amp;lt;br/&amp;gt;      C64(0x0101010101010101), C64(0x0202020202020202),&amp;lt;br/&amp;gt;      C64(0x0404040404040404), C64(0x0808080808080808),&amp;lt;br/&amp;gt;      C64(0x1010101010101010), C64(0x2020202020202020),&amp;lt;br/&amp;gt;      C64(0x4040404040404040), C64(0x8080808080808080),&amp;lt;br/&amp;gt;   };&amp;lt;br/&amp;gt;   __m128i x0, x1, x2, x3, zr; U32 cnt;&amp;lt;br/&amp;gt;   __m128i * pM = (__m128i*) masks;&amp;lt;br/&amp;gt;   __m128i * pW = (__m128i*) weightsRot90;&amp;lt;br/&amp;gt;   x0 = _mm_cvtsi64x_si128 (bb);&amp;lt;br/&amp;gt;   x0 = _mm_unpacklo_epi64 (x0, x0);&amp;lt;br/&amp;gt;   zr = _mm_setzero_si128  ();&amp;lt;br/&amp;gt;   x3 = _mm_andnot_si128   (x0, pM[3]);&amp;lt;br/&amp;gt;   x2 = _mm_andnot_si128   (x0, pM[2]);&amp;lt;br/&amp;gt;   x1 = _mm_andnot_si128   (x0, pM[1]);&amp;lt;br/&amp;gt;   x0 = _mm_andnot_si128   (x0, pM[0]);&amp;lt;br/&amp;gt;   x3 = _mm_cmpeq_epi8     (x3, zr);&amp;lt;br/&amp;gt;   x2 = _mm_cmpeq_epi8     (x2, zr);&amp;lt;br/&amp;gt;   x1 = _mm_cmpeq_epi8     (x1, zr);&amp;lt;br/&amp;gt;   x0 = _mm_cmpeq_epi8     (x0, zr);&amp;lt;br/&amp;gt;   // multiply by &amp;amp;quot;and&amp;amp;quot; with -1 or 0&amp;lt;br/&amp;gt;   x3 = _mm_and_si128      (x3, pW[3]);&amp;lt;br/&amp;gt;   x2 = _mm_and_si128      (x2, pW[2]);&amp;lt;br/&amp;gt;   x1 = _mm_and_si128      (x1, pW[1]);&amp;lt;br/&amp;gt;   x0 = _mm_and_si128      (x0, pW[0]);&amp;lt;br/&amp;gt;   // add all bytes (with saturation)&amp;lt;br/&amp;gt;   x3 = _mm_adds_epu8      (x3, x2);&amp;lt;br/&amp;gt;   x0 = _mm_adds_epu8      (x0, x1);&amp;lt;br/&amp;gt;   x0 = _mm_adds_epu8      (x0, x3);&amp;lt;br/&amp;gt;   x0 = _mm_sad_epu8       (x0, zr);&amp;lt;br/&amp;gt;   return _mm_cvtsi128_si32(x0)&amp;lt;br/&amp;gt;        + _mm_extract_epi16(x0, 4);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/* for average weights &amp;lt; 64 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; dotProduct64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 bb, BYTE weightsRot90&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* XMM_ALIGN */&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 CACHE_ALIGN masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0101010101010101&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0202020202020202&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;,
      C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0404040404040404&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0808080808080808&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;,
      C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x1010101010101010&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x2020202020202020&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;,
      C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x4040404040404040&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x8080808080808080&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;,
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   __m128i x0, x1, x2, x3, zr&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; U32 cnt&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   __m128i &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; pM &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; masks&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   __m128i &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; pW &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; weightsRot90&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cvtsi64x_si128 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;bb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_unpacklo_epi64 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, x0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   zr &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_setzero_si128  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x3 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_andnot_si128   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_andnot_si128   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_andnot_si128   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_andnot_si128   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x3 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cmpeq_epi8     &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x3, zr&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cmpeq_epi8     &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x2, zr&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cmpeq_epi8     &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x1, zr&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cmpeq_epi8     &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, zr&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;co1&quot;&gt;// multiply by &amp;quot;and&amp;quot; with -1 or 0&lt;/span&gt;
   x3 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x3, pW&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x2, pW&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x1, pW&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, pW&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;co1&quot;&gt;// add all bytes (with saturation)&lt;/span&gt;
   x3 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_adds_epu8      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x3, x2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_adds_epu8      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, x1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_adds_epu8      &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, x3&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sad_epu8       &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, zr&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; _mm_cvtsi128_si32&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; _mm_extract_epi16&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x0, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:86:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@SSE2popcount&amp;quot; title=&amp;quot;Anchor: SSE2popcount&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;SSE2popcount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:86 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:51:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Applications-SSE2 Population Count&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:51 --&gt;SSE2 Population Count&lt;/h2&gt;
 Following proposal of a &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count#SWARPopcount&quot;&gt;SWAR-Popcount&lt;/a&gt; combined with a dot product might be quite competitive on recent &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; processors with a throughput of up to three simd-instructions per cycle &lt;!-- ws:start:WikiTextRefRule:31:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.intel.com/design/processor/manuals/248966.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Intel 64 and IA32 Architectures Optimization Reference Manual&amp;lt;/a&amp;gt; (pdf) Appendix C Instruction Latencies&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-8&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-8&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:31 --&gt; &lt;!-- ws:start:WikiTextRefRule:33:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://support.amd.com/us/Processor_TechDocs/40546.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Software Optimization Guide for AMD Family 10h and 12h Processors&amp;lt;/a&amp;gt; (pdf) Appendix C Instruction Latencies&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-9&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-9&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:33 --&gt; . It determines the cardinalities of eight bitboards, multiplies them with a corresponding weight, a signed 16-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;word&lt;/a&gt;, to finally add all together as integer. However, &lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#PopCount&quot;&gt;SSSE3 PopCnt&lt;/a&gt; would save some more cycles, even more with doubled or fourfold register widths using &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt; * popCountWeight8&amp;lt;br/&amp;gt; * @author Gerd Isenberg&amp;lt;br/&amp;gt; * @param bb vector of eight bitboards&amp;lt;br/&amp;gt; *        weight vector of eight short weights&amp;lt;br/&amp;gt; * @return sum(0,7) popcnt(bb[i]) * weight[i]&amp;lt;br/&amp;gt; */&amp;lt;br/&amp;gt;int popCountWeight8(const U64 bb[8], const short weight[8]) {&amp;lt;br/&amp;gt;   static const U64 XMM_ALIGN masks[6] = {&amp;lt;br/&amp;gt;      C64(0x5555555555555555), C64(0x5555555555555555),&amp;lt;br/&amp;gt;      C64(0x3333333333333333), C64(0x3333333333333333),&amp;lt;br/&amp;gt;      C64(0x0f0f0f0f0f0f0f0f), C64(0x0f0f0f0f0f0f0f0f)&amp;lt;br/&amp;gt;   };&amp;lt;br/&amp;gt;   const __m128i* pM = (const __m128i*) masks;&amp;lt;br/&amp;gt;   const __m128i* pb = (const __m128i*) bb;&amp;lt;br/&amp;gt;   __m128i v = pb[0], w = pb[1], x = pb[2], y = pb[3];&amp;lt;br/&amp;gt;   v = _mm_sub_epi8(v, _mm_and_si128(_mm_srli_epi64(v, 1), pM[0]));&amp;lt;br/&amp;gt;   w = _mm_sub_epi8(w, _mm_and_si128(_mm_srli_epi64(w, 1), pM[0]));&amp;lt;br/&amp;gt;   x = _mm_sub_epi8(x, _mm_and_si128(_mm_srli_epi64(x, 1), pM[0]));&amp;lt;br/&amp;gt;   y = _mm_sub_epi8(y, _mm_and_si128(_mm_srli_epi64(y, 1), pM[0]));&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;   v = _mm_add_epi8(_mm_and_si128(v, pM[1]), _mm_and_si128(_mm_srli_epi64(v, 2), pM[1]));&amp;lt;br/&amp;gt;   w = _mm_add_epi8(_mm_and_si128(w, pM[1]), _mm_and_si128(_mm_srli_epi64(w, 2), pM[1]));&amp;lt;br/&amp;gt;   x = _mm_add_epi8(_mm_and_si128(x, pM[1]), _mm_and_si128(_mm_srli_epi64(x, 2), pM[1]));&amp;lt;br/&amp;gt;   y = _mm_add_epi8(_mm_and_si128(y, pM[1]), _mm_and_si128(_mm_srli_epi64(y, 2), pM[1]));&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;   v = _mm_and_si128(_mm_add_epi8 (v, _mm_srli_epi64(v, 4)), pM[2]);&amp;lt;br/&amp;gt;   w = _mm_and_si128(_mm_add_epi8 (w, _mm_srli_epi64(w, 4)), pM[2]);&amp;lt;br/&amp;gt;   x = _mm_and_si128(_mm_add_epi8 (x, _mm_srli_epi64(x, 4)), pM[2]);&amp;lt;br/&amp;gt;   y = _mm_and_si128(_mm_add_epi8 (y, _mm_srli_epi64(y, 4)), pM[2]);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;   __m128i z = _mm_setzero_si128();&amp;lt;br/&amp;gt;   v = _mm_packs_epi16(_mm_sad_epu8(v, z), _mm_sad_epu8(w, z));&amp;lt;br/&amp;gt;   x = _mm_packs_epi16(_mm_sad_epu8(x, z), _mm_sad_epu8(y, z));&amp;lt;br/&amp;gt;   const __m128i* pW = (const __m128i*) weight;&amp;lt;br/&amp;gt;   v = _mm_madd_epi16 (_mm_packs_epi16(v, x), pW[0]);&amp;lt;br/&amp;gt;   v = _mm_add_epi32  (v, _mm_srli_si128(v, 4));&amp;lt;br/&amp;gt;   v = _mm_add_epi32  (v, _mm_srli_si128(v, 8));&amp;lt;br/&amp;gt;   return _mm_cvtsi128_si32(v);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * popCountWeight8
 * @author Gerd Isenberg
 * @param bb vector of eight bitboards
 *        weight vector of eight short weights
 * @return sum(0,7) popcnt(bb[i]) * weight[i]
 */&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; popCountWeight8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 bb&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; weight&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64 XMM_ALIGN masks&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x5555555555555555&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x5555555555555555&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;,
      C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x3333333333333333&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x3333333333333333&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;,
      C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0f0f0f0f0f0f0f0f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, C64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0f0f0f0f0f0f0f0f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; __m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; pM &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; __m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; masks&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; __m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; pb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; __m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; bb&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   __m128i v &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pb&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, w &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pb&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pb&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, y &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; pb&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   v &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sub_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   w &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sub_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;w, _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;w, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sub_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   y &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sub_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y, _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y, &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   v &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   w &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;w, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;w, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   y &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   v &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_add_epi8 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, _mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   w &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_add_epi8 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;w, _mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;w, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_add_epi8 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, _mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   y &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_add_epi8 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y, _mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
   __m128i z &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_setzero_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   v &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_packs_epi16&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_sad_epu8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, _mm_sad_epu8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;w, z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_packs_epi16&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_sad_epu8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, _mm_sad_epu8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;y, z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; __m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; pW &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; __m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; weight&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   v &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_madd_epi16 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_packs_epi16&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, pW&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   v &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi32  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, _mm_srli_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   v &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi32  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, _mm_srli_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; _mm_cvtsi128_si32&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:87:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@SSE2WrapperinCpp&amp;quot; title=&amp;quot;Anchor: SSE2WrapperinCpp&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;SSE2WrapperinCpp&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:87 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:53:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;SSE2-Wrapper in C++&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:53 --&gt;SSE2-Wrapper in C++&lt;/h1&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; quite efficiently allows to wrap all the intrinsics and to write classes with appropriate operators overloaded - the proposal here overloads + and - operators for byte- or rank-wise arithmetic, shifts work on 64-bit entities as often used in mentioned SSE2-routines or &lt;a class=&quot;wiki_link&quot; href=&quot;/Kogge-Stone%20Algorithm&quot;&gt;Kogge-Stone&lt;/a&gt; fill-stuff. A base class for the memory layout and two derivations provide to implement routines with SSE2 or general purpose instructions - or any other available SIMD-architecture like &lt;a class=&quot;wiki_link&quot; href=&quot;/AltiVec&quot;&gt;AltiVec&lt;/a&gt;. For instance a &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad-Bitboards&quot;&gt;quad-bitboard&lt;/a&gt; attack-getter:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:10:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;// T is either XMM or GPR&amp;lt;br/&amp;gt;template &amp;amp;lt;class T&amp;amp;gt; inline&amp;lt;br/&amp;gt;void eastAttacks(QBB&amp;amp;amp; t, const QBB&amp;amp;amp; s, U64 occ) {&amp;lt;br/&amp;gt;   T* pt = (T*)&amp;amp;amp;t;&amp;lt;br/&amp;gt;   T r0(s.bb[0]);&amp;lt;br/&amp;gt;   T r1(s.bb[2]);&amp;lt;br/&amp;gt;   T o0(occ, occ);&amp;lt;br/&amp;gt;   T o1  = o0 | r1;&amp;lt;br/&amp;gt;   o0    = o0 | r0;&amp;lt;br/&amp;gt;   pt[0] = o0 ^ ((o0 ^ r0) - r0);&amp;lt;br/&amp;gt;   pt[1] = o1 ^ ((o1 ^ r1) - r1);&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// T is either XMM or GPR&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; T&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;inline&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; eastAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;QBB&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; t, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; QBB&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; s, U64 occ&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   T&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; pt &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;T&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;t&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   T r0&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s.&lt;span class=&quot;me1&quot;&gt;bb&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   T r1&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s.&lt;span class=&quot;me1&quot;&gt;bb&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   T o0&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ, occ&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   T o1  &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; o0 &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; r1&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   o0    &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; o0 &lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; r0&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   pt&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; o0 &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o0 &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; r0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; r0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   pt&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; o1 &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o1 &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; r1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; r1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:10 --&gt;A proposal for a class skeleton:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:11:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;class DBB&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   friend class XMM;&amp;lt;br/&amp;gt;   friend class GPR;&amp;lt;br/&amp;gt;public:&amp;lt;br/&amp;gt;   DBB(){}&amp;lt;br/&amp;gt;   ... more constructors&amp;lt;br/&amp;gt;public:&amp;lt;br/&amp;gt;   union&amp;lt;br/&amp;gt;   {&amp;lt;br/&amp;gt;      __m128i x; // this intrinsice type is wrapped here&amp;lt;br/&amp;gt;      u64 b[2];&amp;lt;br/&amp;gt;   };&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;// intrinsic sse2 xmm wrapper&amp;lt;br/&amp;gt;class XMM : public DBB&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;public:&amp;lt;br/&amp;gt;   XMM(){}&amp;lt;br/&amp;gt;   XMM(U64 b) {x = _mm_cvtsi64x_si128(b);}&amp;lt;br/&amp;gt;   XMM(__m128i a){x = a;}&amp;lt;br/&amp;gt;   XMM(U64 high, U64 low) ...&amp;lt;br/&amp;gt;   ... more constructors&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;   XMM&amp;amp;amp; operator&amp;amp;gt;&amp;amp;gt;=(int sh) {x = _mm_srli_epi64(x, sh); return *this;}&amp;lt;br/&amp;gt;   XMM&amp;amp;amp; operator&amp;amp;lt;&amp;amp;lt;=(int sh) {x = _mm_slli_epi64(x, sh); return *this;}&amp;lt;br/&amp;gt;   XMM&amp;amp;amp; operator&amp;amp;amp;=(const XMM &amp;amp;amp;a) {x = _mm_and_si128(x, a.x); return *this;}&amp;lt;br/&amp;gt;   XMM&amp;amp;amp; operator|=(const XMM &amp;amp;amp;a) {x = _mm_or_si128 (x, a.x); return *this;}&amp;lt;br/&amp;gt;   XMM&amp;amp;amp; operator^=(const XMM &amp;amp;amp;a) {x = _mm_xor_si128(x, a.x); return *this;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;   // byte- or rankwise arithmetic&amp;lt;br/&amp;gt;   XMM&amp;amp;amp; operator+=(const XMM &amp;amp;amp;a) {x = _mm_add_epi8(x, a.x); return *this;}&amp;lt;br/&amp;gt;   XMM&amp;amp;amp; operator-=(const XMM &amp;amp;amp;a) {x = _mm_sub_epi8(x, a.x); return *this;}&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;   friend XMM operator&amp;amp;gt;&amp;amp;gt;(const XMM &amp;amp;amp;a, int sh) {return XMM(_mm_srli_epi64(a.x, sh));}&amp;lt;br/&amp;gt;   friend XMM operator&amp;amp;lt;&amp;amp;lt;(const XMM &amp;amp;amp;a, int sh) {return XMM(_mm_slli_epi64(a.x, sh));}&amp;lt;br/&amp;gt;   friend XMM operator&amp;amp;amp; (const XMM &amp;amp;amp;a, const XMM &amp;amp;amp;b) {return XMM(_mm_and_si128(a.x, b.x));}&amp;lt;br/&amp;gt;   friend XMM operator| (const XMM &amp;amp;amp;a, const XMM &amp;amp;amp;b) {return XMM(_mm_or_si128(a.x, b.x));}&amp;lt;br/&amp;gt;   friend XMM operator^ (const XMM &amp;amp;amp;a, const XMM &amp;amp;amp;b) {return XMM(_mm_xor_si128(a.x, b.x));}&amp;lt;br/&amp;gt;   friend XMM operator+ (const XMM &amp;amp;amp;a, const XMM &amp;amp;amp;b) {return XMM(_mm_add_epi8(a.x, b.x));}&amp;lt;br/&amp;gt;   friend XMM operator- (const XMM &amp;amp;amp;a, const XMM &amp;amp;amp;b) {return XMM(_mm_sub_epi8(a.x, b.x));}&amp;lt;br/&amp;gt;   ...&amp;lt;br/&amp;gt;};&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;// pure C wrapper&amp;lt;br/&amp;gt;class GPR : public DBB&amp;lt;br/&amp;gt;{&amp;lt;br/&amp;gt;   ...&amp;lt;br/&amp;gt;};&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; DBB
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   &lt;span class=&quot;kw2&quot;&gt;friend&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; XMM&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw2&quot;&gt;friend&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; GPR&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
   DBB&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   ... &lt;span class=&quot;me1&quot;&gt;more&lt;/span&gt; constructors
&lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;union&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      __m128i x&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// this intrinsice type is wrapped here&lt;/span&gt;
      u64 b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;// intrinsic sse2 xmm wrapper&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; XMM &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; DBB
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
   XMM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   XMM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cvtsi64x_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   XMM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; a&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   XMM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 high, U64 low&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; ...
   ... &lt;span class=&quot;me1&quot;&gt;more&lt;/span&gt; constructors
&amp;nbsp;
   XMM&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; operator&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sh&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, sh&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   XMM&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; operator&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sh&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_slli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, sh&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   XMM&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; operator&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   XMM&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; operator&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_or_si128 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   XMM&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; operator&lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_xor_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;co1&quot;&gt;// byte- or rankwise arithmetic&lt;/span&gt;
   XMM&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; operator&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   XMM&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; operator&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;x &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sub_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x, a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
   &lt;span class=&quot;kw2&quot;&gt;friend&lt;/span&gt; XMM operator&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sh&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; XMM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_srli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;, sh&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw2&quot;&gt;friend&lt;/span&gt; XMM operator&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a, &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; sh&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; XMM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_slli_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;, sh&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw2&quot;&gt;friend&lt;/span&gt; XMM operator&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; XMM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;, b.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw2&quot;&gt;friend&lt;/span&gt; XMM operator&lt;span class=&quot;sy3&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; XMM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_or_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;, b.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw2&quot;&gt;friend&lt;/span&gt; XMM operator&lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; XMM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_xor_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;, b.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw2&quot;&gt;friend&lt;/span&gt; XMM operator&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; XMM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_add_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;, b.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   &lt;span class=&quot;kw2&quot;&gt;friend&lt;/span&gt; XMM operator&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;a, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; XMM &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; XMM&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_sub_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;, b.&lt;span class=&quot;me1&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
   ...
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;// pure C wrapper&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; GPR &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; DBB
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   ...
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:11 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:55:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:55 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AltiVec&quot;&gt;AltiVec&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/DirGolem&quot;&gt;DirGolem&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/MMX&quot;&gt;MMX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20techniques&quot;&gt;SIMD techniques&lt;/a&gt; for &lt;a class=&quot;wiki_link&quot; href=&quot;/Sliding%20Piece%20Attacks&quot;&gt;Sliding Piece Attacks&lt;/a&gt; with &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Quad-Bitboards#SSE2Conversions&quot;&gt;SSE2 Conversions&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad-Bitboards&quot;&gt;Quad-Bitboards&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE&quot;&gt;SSE&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE3&quot;&gt;SSE3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3&quot;&gt;SSSE3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4&quot;&gt;SSE4&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE5&quot;&gt;SSE5&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:57:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Manuals&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:57 --&gt;Manuals&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://support.amd.com/TechDocs/26568.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD64 Architecture, Programmer’s Manual, Volume 4 128-Bit Media Instructions&lt;/a&gt; (pdf)&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.intel.com/Assets/PDF/manual/253666.pdf&quot; rel=&quot;nofollow&quot;&gt;Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 2A: Instruction Set Reference, A-M&lt;/a&gt; (pdf)&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.intel.com/Assets/PDF/manual/253667.pdf&quot; rel=&quot;nofollow&quot;&gt;Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 2B: Instruction Set Reference, N-Z&lt;/a&gt; (pdf)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:59:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc10&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:59 --&gt;Forum Posts&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.stmintz.com/ccc/index.php?id=343790&quot; rel=&quot;nofollow&quot;&gt;A SIMD idea, eg. Piece/Gain of a capture target&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 21, 2004 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Move%20Ordering&quot;&gt;Move Ordering&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.stmintz.com/ccc/index.php?id=377546&quot; rel=&quot;nofollow&quot;&gt;SSE2 bit[64] * byte[64] dot product&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, July 17, 2004&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/11095ec26e3ed536&quot; rel=&quot;nofollow&quot;&gt;SSE2-Sort within a register&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/topics&quot; rel=&quot;nofollow&quot;&gt;comp.lang.asm.x86&lt;/a&gt;,  January 08, 2005&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.stmintz.com/ccc/index.php?id=405396&quot; rel=&quot;nofollow&quot;&gt;planning a SSE-optimized chess engine&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Aart%20Bik&quot;&gt;Aart Bik&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 12, 2005&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.stmintz.com/ccc/index.php?id=418648&quot; rel=&quot;nofollow&quot;&gt;On SSE2-Intrinsics&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, March 28, 2005&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=30471&quot; rel=&quot;nofollow&quot;&gt;Problem with functions not inlining&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gregory%20Strong&quot;&gt;Gregory Strong&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, November 04, 2009&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:61:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc11&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:61 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions&quot; rel=&quot;nofollow&quot;&gt;SSE from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/SSE2&quot; rel=&quot;nofollow&quot;&gt;SSE2 from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://stackoverflow.com/questions/661338/sse-sse2-and-sse3-for-gnu-c&quot; rel=&quot;nofollow&quot;&gt;SSE SSE2 and SSE3 for GNU C++&lt;/a&gt;,  &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Stack_Overflow&quot; rel=&quot;nofollow&quot;&gt;Stack Overflow&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://stackoverflow.com/questions/7646018/sse-instructions-single-memory-access&quot; rel=&quot;nofollow&quot;&gt;Concurrency - SSE instructions: single memory access&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Stack_Overflow&quot; rel=&quot;nofollow&quot;&gt;Stack Overflow&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/#manuals&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&#039;s manuals&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/calling_conventions.pdf&quot; rel=&quot;nofollow&quot;&gt;Calling conventions for different C++ compilers and operating systems&lt;/a&gt; (pdf) by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/blog/&quot; rel=&quot;nofollow&quot;&gt;Agner`s CPU blog&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/cpu/Libraries/sseplus/Pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;SSEPlus Project&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;AMD Developer Central&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://sseplus.sourceforge.net/index.html&quot; rel=&quot;nofollow&quot;&gt;SSEPlus Project Documentation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/landingpage/IntrinsicsGuide/&quot; rel=&quot;nofollow&quot;&gt;Intel Intrinsics Guide&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#Kraan&quot;&gt;Kraan&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:35:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.kraan.de/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Kraan homepage&amp;lt;/a&amp;gt; (German)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-10&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-10&quot;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:35 --&gt; - &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Full_Throttle&quot; rel=&quot;nofollow&quot;&gt;Vollgas&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Ahoy_%28greeting%29&quot; rel=&quot;nofollow&quot;&gt;Ahoi&lt;/a&gt; - Live April 25, 2009, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.raetsche.de/index.php&quot; rel=&quot;nofollow&quot;&gt;Rätschenmühle&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Geislingen_an_der_Steige&quot; rel=&quot;nofollow&quot;&gt;Geislingen&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Hellmut_Hattler&quot; rel=&quot;nofollow&quot;&gt;Hellmut Hattler&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Peter_Wolbrandt&quot; rel=&quot;nofollow&quot;&gt;Peter Wolbrandt&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www1.sticks.de/magazine/0309/fride.htm&quot; rel=&quot;nofollow&quot;&gt;Jan Fride Wolbrandt&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:36:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/youtube/A11bAJOOqF8?h=315&amp;amp;w=560&amp;quot; class=&amp;quot;WikiMedia WikiMediaYoutube&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;youtube&amp;amp;quot; key=&amp;amp;quot;A11bAJOOqF8&amp;amp;quot;&amp;quot; title=&amp;quot;YouTube Video&amp;quot;height=&amp;quot;315&amp;quot; width=&amp;quot;560&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/A11bAJOOqF8&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:36 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:63:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc12&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:63 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:333:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt;  &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://support.amd.com/TechDocs/26568.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD64 Architecture, Programmer’s Manual, Volume 4 128-Bit Media Instructions&lt;/a&gt; (pdf), has detailed explanations on all SSE2 128-Bit Media Instructions.&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/84t4h8ys%28v=VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;Integer Intrinsics Using Streaming SIMD Extensions 2&lt;/a&gt; Visual C++ Developer Center - Run-Time Library Reference&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/x8zs5twb%28v=VS.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;Instruction Reference&lt;/a&gt; Visual C++ Developer Center - Run-Time Library Reference&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/index.htm&quot; rel=&quot;nofollow&quot;&gt;Intel(R) C++ Compiler User and Reference Guides&lt;/a&gt; covers Intrinsics&lt;br /&gt;
&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://softwarecommunity.intel.com/isn/downloads/softwareproducts/pdfs/347603.pdf&quot; rel=&quot;nofollow&quot;&gt;Intel C++ Compiler for Linux Intrinsics Reference&lt;/a&gt; (pdf)&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://mathworld.wolfram.com/DotProduct.html&quot; rel=&quot;nofollow&quot;&gt;Dot Product - from Wolfram MathWorld&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-7&quot;&gt;&lt;a href=&quot;#cite_ref-7&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=377546&quot; rel=&quot;nofollow&quot;&gt;SSE2 bit[64] * byte[64] dot product&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Gerd%20Isenberg&quot;&gt;Gerd Isenberg&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;Computer Chess Forums&lt;/a&gt;, July 17, 2004&lt;/li&gt;
&lt;li id=&quot;cite_note-8&quot;&gt;&lt;a href=&quot;#cite_ref-8&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.intel.com/design/processor/manuals/248966.pdf&quot; rel=&quot;nofollow&quot;&gt;Intel 64 and IA32 Architectures Optimization Reference Manual&lt;/a&gt; (pdf) Appendix C Instruction Latencies&lt;/li&gt;
&lt;li id=&quot;cite_note-9&quot;&gt;&lt;a href=&quot;#cite_ref-9&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/40546.pdf&quot; rel=&quot;nofollow&quot;&gt;Software Optimization Guide for AMD Family 10h and 12h Processors&lt;/a&gt; (pdf) Appendix C Instruction Latencies&lt;/li&gt;
&lt;li id=&quot;cite_note-10&quot;&gt;&lt;a href=&quot;#cite_ref-10&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.kraan.de/&quot; rel=&quot;nofollow&quot;&gt;Kraan homepage&lt;/a&gt; (German)&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:333 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:65:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc13&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:65 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:013:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;SSE2&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;SSE2&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-SSE2 includeBody-SSE2 includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Aart+Bik&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Aart Bik&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AltiVec&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AltiVec&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AMD&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AMD&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX-512&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX-512&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Byte&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Byte&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cpp&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cpp&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dictionary&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dictionary&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DirGolem&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DirGolem&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 30, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fill+by+Subtraction&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fill by Subtraction&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 5, 2010&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Float&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Float&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gregory+Strong&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gregory Strong&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/HansDamf&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;HansDamf&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Intel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Intel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/King+Pattern&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;King Pattern&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 15, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kogge-Stone+Algorithm&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kogge-Stone Algorithm&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MMX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MMX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mobility&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mobility&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 17, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Move+Ordering&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Move Ordering&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Papa&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Papa&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 11, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Population+Count&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Population Count&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Quad-Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Quad-Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shared+Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shared Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 11, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Sjaak+%28Glebbeek%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Sjaak (Glebbeek)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2+Instructions+to+Include&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2 Instructions to Include&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 17, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE5&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE5&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Windows&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Windows&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 2, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/XOP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;XOP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:013 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>SSE3</title>
      <link>https://chessprogramming.wikispaces.com/SSE3</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/SSE3</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/SSE3</comments>
      <pubDate>Sun, 05 Jun 2016 22:00:11 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:17:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:17 --&gt;&lt;!-- ws:start:WikiTextTocRule:18: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:18 --&gt;&lt;!-- ws:start:WikiTextTocRule:19: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Publications&quot;&gt;Publications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:19 --&gt;&lt;!-- ws:start:WikiTextTocRule:20: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:20 --&gt;&lt;!-- ws:start:WikiTextTocRule:21: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextTocRule:22: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;!-- ws:start:WikiTextTocRule:23: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; * SSE3&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SSE3&lt;/strong&gt; (Streaming SIMD Extensions 3), is &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&#039;s&lt;/a&gt; third iteration for the &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE&quot;&gt;SSE&lt;/a&gt; x86 instruction set, introduced in 2004 with the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/List_of_Intel_Pentium_4_microprocessors#Prescott_.2890.C2.A0nm.29&quot; rel=&quot;nofollow&quot;&gt;Prescott&lt;/a&gt; revision of the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Pentium_4&quot; rel=&quot;nofollow&quot;&gt;Pentium 4&lt;/a&gt; CPU. In April 2005 &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; introduced a subset of SSE3 in revision E (&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Athlon_64#Venice_.2890.C2.A0nm_SOI.29&quot; rel=&quot;nofollow&quot;&gt;Venice&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Athlon_64#San_Diego_.2890.C2.A0nm_SOI.29_2&quot; rel=&quot;nofollow&quot;&gt;San Diego&lt;/a&gt;) of their &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Athlon_64&quot; rel=&quot;nofollow&quot;&gt;Athlon 64&lt;/a&gt; CPUs. The 13 new instructions are most processing vectors of &lt;a class=&quot;wiki_link&quot; href=&quot;/Float&quot;&gt;floats&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Double&quot;&gt;doubles&lt;/a&gt;, most notable horizontal add and sub inside one 128-bit xmm-register, LDDQU, an alternative misaligned load, which is even quite fast for loads that cross cacheline boundaries &lt;!-- ws:start:WikiTextRefRule:1:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://siyobik.info/index.php?module=x86&amp;amp;amp;id=150&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;LDDQU: Load Unaligned Integer 128 Bits (x86 Instruction Set Reference)&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:1 --&gt;&lt;!-- ws:start:WikiTextRefRule:3:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.patentstorm.us/patents/6721866/description.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Unaligned memory operands - US Patent 6721866 Description&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:3 --&gt;, and FISTTP, which is a new &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/X87&quot; rel=&quot;nofollow&quot;&gt;x87&lt;/a&gt; instruction &lt;!-- ws:start:WikiTextRefRule:5:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://software.intel.com/en-us/articles/how-to-implement-the-fisttp-streaming-simd-extensions-3-instruction/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;How to Implement the FISTTP Streaming SIMD Extensions 3 Instruction - Intel® Software Network&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:5 --&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AltiVec&quot;&gt;AltiVec&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/MMX&quot;&gt;MMX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE&quot;&gt;SSE&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3&quot;&gt;SSSE3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4&quot;&gt;SSE4&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE5&quot;&gt;SSE5&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Publications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Publications&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Daisuke%20Takahashi&quot;&gt;Daisuke Takahashi&lt;/a&gt; (&lt;strong&gt;2007&lt;/strong&gt;). &lt;em&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.springerlink.com/content/6481607675376w42/&quot; rel=&quot;nofollow&quot;&gt;An Implementation of Parallel 1-D FFT Using SSE3 Instructions on Dual-Core Processors&lt;/a&gt;&lt;/em&gt;. Proc. Workshop on State-of-the-Art in Scientific and Parallel Computing (PARA 2006), Lecture Notes in Computer Science, No. 4699, pp. 1178-1187, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Springer_Science%2BBusiness_Media&quot; rel=&quot;nofollow&quot;&gt;Springer&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/SSE3&quot; rel=&quot;nofollow&quot;&gt;SSE3 from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/products/documentation/hpc/compilerpro/en-us/cpp/win/compiler_c/index.htm&quot; rel=&quot;nofollow&quot;&gt;Intel(R) C++ Compiler User and Reference Guides&lt;/a&gt; covers Intrinsics&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://stackoverflow.com/questions/661338/sse-sse2-and-sse3-for-gnu-c&quot; rel=&quot;nofollow&quot;&gt;SSE SSE2 and SSE3 for GNU C++ - Stack Overflow&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/cpu/Libraries/sseplus/Pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;SSEPlus Project&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;AMD Developer Central&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://sseplus.sourceforge.net/index.html&quot; rel=&quot;nofollow&quot;&gt;SSEPlus Project Documentation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/blog/&quot; rel=&quot;nofollow&quot;&gt;Agner`s CPU blog&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/landingpage/IntrinsicsGuide/&quot; rel=&quot;nofollow&quot;&gt;Intel Intrinsics Guide&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;References&lt;/h1&gt;
&lt;!-- ws:start:WikiTextReferencesRule:125:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://siyobik.info/index.php?module=x86&amp;amp;id=150&quot; rel=&quot;nofollow&quot;&gt;LDDQU: Load Unaligned Integer 128 Bits (x86 Instruction Set Reference)&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.patentstorm.us/patents/6721866/description.html&quot; rel=&quot;nofollow&quot;&gt;Unaligned memory operands - US Patent 6721866 Description&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/en-us/articles/how-to-implement-the-fisttp-streaming-simd-extensions-3-instruction/&quot; rel=&quot;nofollow&quot;&gt;How to Implement the FISTTP Streaming SIMD Extensions 3 Instruction - Intel® Software Network&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:125 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;SSE3&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;SSE3&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-SSE3 includeBody-SSE3 includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Aart+Bik&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Aart Bik&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AltiVec&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AltiVec&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AMD&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AMD&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Intel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Intel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE5&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE5&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/XOP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;XOP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>SSE5</title>
      <link>https://chessprogramming.wikispaces.com/SSE5</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/SSE5</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/SSE5</comments>
      <pubDate>Sun, 05 Jun 2016 22:00:33 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:16:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:16 --&gt;&lt;!-- ws:start:WikiTextTocRule:17: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Instructions&quot;&gt;Instructions&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:17 --&gt;&lt;!-- ws:start:WikiTextTocRule:18: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See Also&quot;&gt;See Also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:18 --&gt;&lt;!-- ws:start:WikiTextTocRule:19: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:19 --&gt;&lt;!-- ws:start:WikiTextTocRule:20: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:20 --&gt;&lt;!-- ws:start:WikiTextTocRule:21: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:21 --&gt;&lt;!-- ws:start:WikiTextTocRule:22: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:22 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; * SSE5&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Streaming SIMD Extensions version 5 (SSE5)&lt;/strong&gt;,&lt;br /&gt;
was a &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD&lt;/a&gt; instruction set extension proposed by &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; in 2007, with a bunch of very interesting instructions for high performance &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboarding&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation&quot;&gt;evaluation&lt;/a&gt;. However, after &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; declared their 256-bit wide &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;Advanced Vector Extensions&lt;/a&gt; (AVX) as further SIMD extension, AMD reconsidered and replaced SSE5 with three smaller instruction set extensions &lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt; for vectors of integers, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/FMA_instruction_set&quot; rel=&quot;nofollow&quot;&gt;FMA4&lt;/a&gt; (&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Multiply-accumulate&quot; rel=&quot;nofollow&quot;&gt;fused multiply-add&lt;/a&gt; on vectors of &lt;a class=&quot;wiki_link&quot; href=&quot;/Float&quot;&gt;float&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Double&quot;&gt;double&lt;/a&gt;), and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/CVT16_instruction_set&quot; rel=&quot;nofollow&quot;&gt;CVT16&lt;/a&gt; (&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Half_precision&quot; rel=&quot;nofollow&quot;&gt;Half precision floating-point format&lt;/a&gt;), which retain the proposed functionality of SSE5, but encode the instructions differently for better compatibility with Intel&#039;s proposed AVX instruction set and the new &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/VEX_prefix&quot; rel=&quot;nofollow&quot;&gt;VEX prefix coding scheme&lt;/a&gt;. The sets are stated for introduction in AMD&#039;s new &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Bulldozer_%28processor%29&quot; rel=&quot;nofollow&quot;&gt;Bulldozer&lt;/a&gt; processor core, due for release in late 2011 on a 32nm process &lt;!-- ws:start:WikiTextRefRule:2:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://arstechnica.com/old/content/2008/11/amd-fusion-now-pushed-back-to-2011.ars&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AMD Fusion now pushed back to 2011&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://arstechnica.com/author/joel-hruska/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Joel Hruska&amp;lt;/a&amp;gt;, November 14, 2008&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:2 --&gt; .&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:6:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Instructions&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:6 --&gt;Instructions&lt;/h1&gt;
 Some of the new instructions are quite interesting for computer chess, with applications in evaluation and byte shuffling of bitboards. Their XOP successors still work on 128-bit XMM registers &lt;!-- ws:start:WikiTextRefRule:4:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://support.amd.com/us/Embedded_TechDocs/43479.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Volume 6: 128-Bit and 256-Bit XOP, FMA4 and CVT16 Instructions&amp;lt;/a&amp;gt; (pdf)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:4 --&gt;, and implicitly clear the upper 128 bit of a 256-bit YMM register. Some of the instructions, like &lt;a class=&quot;wiki_link&quot; href=&quot;/XOP#VPPERM&quot;&gt;VPPERM&lt;/a&gt;, have as many as 4 operands.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/XOP#Instructions&quot;&gt;XOP Instructions&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:8:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;See Also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:8 --&gt;See Also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AltiVec&quot;&gt;AltiVec&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE&quot;&gt;SSE&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE3&quot;&gt;SSE3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3&quot;&gt;SSSE3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4&quot;&gt;SSE4&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:10:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:10 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/SSE5&quot; rel=&quot;nofollow&quot;&gt;SSE5 from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/archive/cpu/SSE5/Pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;128-Bit SSE5 Instruction Set&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;AMD Developer Central&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://blogs.amd.com/developer/2009/05/06/striking-a-balance/&quot; rel=&quot;nofollow&quot;&gt;AMD Developer Blogs - Striking a Balance&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;AMD Developer Central&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://devgurus.amd.com/thread/98392&quot; rel=&quot;nofollow&quot;&gt;AMD and Intel incompatible - What to do?&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;AMD Developer Central&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/cpu/Libraries/sseplus/Pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;SSEPlus Project&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://developer.amd.com/pages/default.aspx&quot; rel=&quot;nofollow&quot;&gt;AMD Developer Central&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://sseplus.sourceforge.net/index.html&quot; rel=&quot;nofollow&quot;&gt;SSEPlus Project Documentation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/blog/&quot; rel=&quot;nofollow&quot;&gt;Agner`s CPU blog&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:12:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:12 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:129:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://arstechnica.com/old/content/2008/11/amd-fusion-now-pushed-back-to-2011.ars&quot; rel=&quot;nofollow&quot;&gt;AMD Fusion now pushed back to 2011&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://arstechnica.com/author/joel-hruska/&quot; rel=&quot;nofollow&quot;&gt;Joel Hruska&lt;/a&gt;, November 14, 2008&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Embedded_TechDocs/43479.pdf&quot; rel=&quot;nofollow&quot;&gt;Volume 6: 128-Bit and 256-Bit XOP, FMA4 and CVT16 Instructions&lt;/a&gt; (pdf)&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:129 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:14:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:14 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;SSE5&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;SSE5&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-SSE5 includeBody-SSE5 includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AMD&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AMD&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hyperbola+Quintessence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hyperbola Quintessence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE5&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE5&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/XOP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;XOP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>SSSE3</title>
      <link>https://chessprogramming.wikispaces.com/SSSE3</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/SSSE3</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/SSSE3</comments>
      <pubDate>Tue, 08 Aug 2017 19:51:47 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:86:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:86 --&gt;&lt;!-- ws:start:WikiTextTocRule:87: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Instructions&quot;&gt;Instructions&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:87 --&gt;&lt;!-- ws:start:WikiTextTocRule:88: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-PH(ADD/SUB)W&quot;&gt;PH(ADD/SUB)W&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:88 --&gt;&lt;!-- ws:start:WikiTextTocRule:89: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PH(ADD/SUB)W-Intrinsic&quot;&gt;Intrinsic&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:89 --&gt;&lt;!-- ws:start:WikiTextTocRule:90: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PH(ADD/SUB)W-Pseudocode&quot;&gt;Pseudocode&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:90 --&gt;&lt;!-- ws:start:WikiTextTocRule:91: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-PMADDUBSW&quot;&gt;PMADDUBSW&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:91 --&gt;&lt;!-- ws:start:WikiTextTocRule:92: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PMADDUBSW-Intrinsic&quot;&gt;Intrinsic&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:92 --&gt;&lt;!-- ws:start:WikiTextTocRule:93: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PMADDUBSW-Pseudocode&quot;&gt;Pseudocode&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:93 --&gt;&lt;!-- ws:start:WikiTextTocRule:94: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-PMULHRSW&quot;&gt;PMULHRSW&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:94 --&gt;&lt;!-- ws:start:WikiTextTocRule:95: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PMULHRSW-Intrinsic&quot;&gt;Intrinsic&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:95 --&gt;&lt;!-- ws:start:WikiTextTocRule:96: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PMULHRSW-Pseudocode&quot;&gt;Pseudocode&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:96 --&gt;&lt;!-- ws:start:WikiTextTocRule:97: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-PSHUFB&quot;&gt;PSHUFB&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:97 --&gt;&lt;!-- ws:start:WikiTextTocRule:98: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PSHUFB-Intrinsic&quot;&gt;Intrinsic&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:98 --&gt;&lt;!-- ws:start:WikiTextTocRule:99: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PSHUFB-Pseudocode&quot;&gt;Pseudocode&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:99 --&gt;&lt;!-- ws:start:WikiTextTocRule:100: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-PSIGN&quot;&gt;PSIGN&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:100 --&gt;&lt;!-- ws:start:WikiTextTocRule:101: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PSIGN-Intrinsic&quot;&gt;Intrinsic&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:101 --&gt;&lt;!-- ws:start:WikiTextTocRule:102: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-PSIGN-Pseudocode&quot;&gt;Pseudocode&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:102 --&gt;&lt;!-- ws:start:WikiTextTocRule:103: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Applications&quot;&gt;Applications&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:103 --&gt;&lt;!-- ws:start:WikiTextTocRule:104: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-SSE3 Population Count&quot;&gt;SSE3 Population Count&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:104 --&gt;&lt;!-- ws:start:WikiTextTocRule:105: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-Byte-wise Dot-Product&quot;&gt;Byte-wise Dot-Product&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:105 --&gt;&lt;!-- ws:start:WikiTextTocRule:106: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Applications-SSSE3 Hyperbola Quintessence&quot;&gt;SSSE3 Hyperbola Quintessence&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:106 --&gt;&lt;!-- ws:start:WikiTextTocRule:107: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Applications-SSSE3 Hyperbola Quintessence-Intrinsic Version&quot;&gt;Intrinsic Version&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:107 --&gt;&lt;!-- ws:start:WikiTextTocRule:108: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Applications-SSSE3 Hyperbola Quintessence-Peshkov&#039;s Optimization&quot;&gt;Peshkov&#039;s Optimization&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:108 --&gt;&lt;!-- ws:start:WikiTextTocRule:109: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:109 --&gt;&lt;!-- ws:start:WikiTextTocRule:110: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:110 --&gt;&lt;!-- ws:start:WikiTextTocRule:111: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:111 --&gt;&lt;!-- ws:start:WikiTextTocRule:112: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:112 --&gt;&lt;!-- ws:start:WikiTextTocRule:113: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:113 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; * SSSE3&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SSSE3&lt;/strong&gt; (Supplemental Streaming SIMD Extension 3) is &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&#039;s&lt;/a&gt; name for the &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE&quot;&gt;SSE&lt;/a&gt; instruction set&#039;s fourth iteration. 16 new instructions, also available as &lt;a class=&quot;wiki_link&quot; href=&quot;/MMX&quot;&gt;MMX&lt;/a&gt;-extension with _m64 intrinsic datatype. SSSE3 was introduced in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Intel_Core_microarchitecture&quot; rel=&quot;nofollow&quot;&gt;Intel&#039;s Core Microarchitecture&lt;/a&gt;. SSSE3-intrinsic functions are available in &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Visual_C%2B%2B&quot; rel=&quot;nofollow&quot;&gt;Visual C&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:10:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://msdn.microsoft.com/en-us/library/vstudio/bb892952%28v=vs.100%29.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Supplemental Streaming SIMD Extensions 3 Instructions&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:10 --&gt; or &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_C%2B%2B_Compiler&quot; rel=&quot;nofollow&quot;&gt;Intel-C&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:12:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://www.cs.fsu.edu/~engelen/courses/HPC-adv/intref_cls.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Intel C++ Compiler for Linux Intrinsics Reference&amp;lt;/a&amp;gt; (pdf)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:12 --&gt; .&lt;br /&gt;
&lt;br /&gt;
SSSE3 instructions are not available for &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; processors until Bulldozer, which also implements &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4&quot;&gt;SSE4&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:34:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Instructions&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:34 --&gt;Instructions&lt;/h1&gt;
 Some of the new instructions are quite interesting for computer chess, with applications in &lt;a class=&quot;wiki_link&quot; href=&quot;/Evaluation&quot;&gt;evaluation&lt;/a&gt; and byte shuffling of &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboards&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:114:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PHADDSW&amp;quot; title=&amp;quot;Anchor: PHADDSW&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PHADDSW&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:114 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:36:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Instructions-PH(ADD/SUB)W&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:36 --&gt;PH(ADD/SUB)W&lt;/h2&gt;
 Packed Horizontal Add/Subtract Words. Each of the eight shorts integers is the sum/difference between adjacent pairs of elements in the input parameters. Saturating versions, PHADDSW and PHSUBSW, are also available.&lt;br /&gt;
&lt;br /&gt;
The primary downside of these instructions is that they tend to be very slow multiple-uop instructions on most CPUs, resulting in alternate instruction sequences almost always being faster.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:38:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Instructions-PH(ADD/SUB)W-Intrinsic&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:38 --&gt;Intrinsic&lt;/h3&gt;
 _m128i &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb514049%28v=vs.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_hadd_epi16&lt;/a&gt; (_m128i a, _m128i b);&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:40:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Instructions-PH(ADD/SUB)W-Pseudocode&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:40 --&gt;Pseudocode&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;signed short a[ 8]; // input a&amp;lt;br/&amp;gt;signed short b[ 8]; // input b&amp;lt;br/&amp;gt;signed short r[ 8]; // output r&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;for (i=0; i &amp;amp;lt; 4; i++) {&amp;lt;br/&amp;gt;   r[  i] = a[2i] + a[2i+1];&amp;lt;br/&amp;gt;   r[4+i] = b[2i] + b[2i+1];&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;signed&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// input a&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;signed&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// input b&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;signed&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// output r&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;  i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;2i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;2i&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;2i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;2i&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:115:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PMADDUBSW&amp;quot; title=&amp;quot;Anchor: PMADDUBSW&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PMADDUBSW&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:115 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:42:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Instructions-PMADDUBSW&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:42 --&gt;PMADDUBSW&lt;/h2&gt;
 Packed Multiply and Add a vector of 16 unsigned bytes (char) with a vector of 16 signed bytes (not &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Commutative&quot; rel=&quot;nofollow&quot;&gt;commutative&lt;/a&gt;! &lt;!-- ws:start:WikiTextRefRule:16:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00619.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;fixing SSSE3 pmaddubsw description&amp;lt;/a&amp;gt; from the mail archive of the &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;mailto:gcc-patches@gcc.gnu.org&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;gcc-patches@gcc.gnu.org&amp;lt;/a&amp;gt; mailing list for the &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Free%20Software%20Foundation#GCC&amp;quot;&amp;gt;GCC project&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:16 --&gt; ). Two consecutive products are added and the saturated signed 16-bit results are stored as vector of eight signed shorts.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:44:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Instructions-PMADDUBSW-Intrinsic&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:44 --&gt;Intrinsic&lt;/h3&gt;
 _m128i &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb514017%28v=vs.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_maddubs_epi16&lt;/a&gt; (_m128i a, _m128i b); &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:46:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Instructions-PMADDUBSW-Pseudocode&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:46 --&gt;Pseudocode&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;unsigned char  a[16]; // input a&amp;lt;br/&amp;gt;signed   char  b[16]; // input b&amp;lt;br/&amp;gt;signed   short r[ 8]; // output r&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;for (i=0; i &amp;amp;lt; 8; i++)&amp;lt;br/&amp;gt;   r[i] = SATURATE_16(a[2i]*b[2i] + a[2i+1] * b[2i+1]);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt;  a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// input a&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;signed&lt;/span&gt;   &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt;  b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// input b&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;signed&lt;/span&gt;   &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// output r&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
   r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; SATURATE_16&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;2i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;2i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;2i&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;2i&lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:116:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PMULHRSW&amp;quot; title=&amp;quot;Anchor: PMULHRSW&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PMULHRSW&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:116 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:48:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Instructions-PMULHRSW&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:48 --&gt;PMULHRSW&lt;/h2&gt;
 Packed Multiply High with Round and Scale is an instruction designed for fixed-point math. It is similar to the existing pmulhw, but only shifts right by 15 instead of 16, and adds a factor for correct rounding.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:50:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Instructions-PMULHRSW-Intrinsic&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:50 --&gt;Intrinsic&lt;/h3&gt;
 _m128i &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb513995%28v=vs.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_mulhrs_epi16&lt;/a&gt; (_m128i a, _m128i b);&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:52:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Instructions-PMULHRSW-Pseudocode&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:52 --&gt;Pseudocode&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;signed short a[8]; // input a&amp;lt;br/&amp;gt;signed short b[8]; // input b&amp;lt;br/&amp;gt;signed short r[8]; // output r&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;for (i=0; i &amp;amp;lt; 8; i++)&amp;lt;br/&amp;gt;   r[i] = INT16((a[i]*b[i] + 0x4000) &amp;amp;gt;&amp;amp;gt; 15);&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;signed&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// input a&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;signed&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// input b&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;signed&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// output r&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
   r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; INT16&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x4000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:117:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PSHUFB&amp;quot; title=&amp;quot;Anchor: PSHUFB&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PSHUFB&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:117 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:54:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc10&quot;&gt;&lt;a name=&quot;Instructions-PSHUFB&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:54 --&gt;PSHUFB&lt;/h2&gt;
 Packed Shuffle Bytes is a very powerful instruction that can perform a fast arbitrary byte-shuffle of a register. It can also set some output bytes to zero instead of selecting them from the input. Packed Shuffle Bytes is used inside the &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#SSSE3Version&quot;&gt;SSSE3 Version of Hyperbola Quintessence&lt;/a&gt; to perform byte swaps. There might be some other interesting applications too, such as &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#PopCount&quot;&gt;SSSE3 Population Count&lt;/a&gt;. &lt;a class=&quot;wiki_link&quot; href=&quot;/XOP#VPPERM&quot;&gt;VPPERM&lt;/a&gt; from &lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt; is an even more powerful variant on this instruction.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:56:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc11&quot;&gt;&lt;a name=&quot;Instructions-PSHUFB-Intrinsic&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:56 --&gt;Intrinsic&lt;/h3&gt;
 _m128i &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb531427%28v=vs.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_shuffle_epi8&lt;/a&gt; (_m128i a, _m128i b);&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:58:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc12&quot;&gt;&lt;a name=&quot;Instructions-PSHUFB-Pseudocode&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:58 --&gt;Pseudocode&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;char a[16]; // input a&amp;lt;br/&amp;gt;char b[16]; // input b&amp;lt;br/&amp;gt;char r[16]; // output r&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;for (i=0; i &amp;amp;lt; 16; i++)&amp;lt;br/&amp;gt;   r[i] = (b[i] &amp;amp;lt; 0) ? 0 : a[b[i] % 16];&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// input a&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// input b&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// output r&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
   r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:118:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PSIGN&amp;quot; title=&amp;quot;Anchor: PSIGN&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PSIGN&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:118 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:60:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc13&quot;&gt;&lt;a name=&quot;Instructions-PSIGN&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:60 --&gt;PSIGN&lt;/h2&gt;
 Multiplies each element of one vector with the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Sign_function&quot; rel=&quot;nofollow&quot;&gt;sign function&lt;/a&gt; {-1,0,1} of the second vector. The instruction is available for signed &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;bytes&lt;/a&gt; (8-bit char psignb), signed &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;words&lt;/a&gt; (16-bit short psignw) and &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;double words&lt;/a&gt; (32-bit int psignd). If both input operands are equal, the result is a vector of absolute values, though PABS is probably preferred for this purpose.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:62:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc14&quot;&gt;&lt;a name=&quot;Instructions-PSIGN-Intrinsic&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:62 --&gt;Intrinsic&lt;/h3&gt;
 _m128i &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb531461%28v=vs.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_sign_epi8&lt;/a&gt; (_m128i a, _m128i b);&lt;br /&gt;
_m128i &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb531410%28v=vs.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_sign_epi16&lt;/a&gt; (_m128i a, _m128i b);&lt;br /&gt;
_m128i &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/bb514081%28v=vs.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;_mm_sign_epi32&lt;/a&gt; (_m128i a, _m128i b);&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:64:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc15&quot;&gt;&lt;a name=&quot;Instructions-PSIGN-Pseudocode&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:64 --&gt;Pseudocode&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/* type := {char, short, int}, N = {16, 8, 4} */&amp;lt;br/&amp;gt;#define N (sizeof(__m128i)/sizeof(type))&amp;lt;br/&amp;gt;type a[N]; // input a&amp;lt;br/&amp;gt;type b[N]; // input b&amp;lt;br/&amp;gt;type r[N]; // output r&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;for (i=0; i &amp;amp;lt; N; i++)&amp;lt;br/&amp;gt;   r[i] = (b[i] &amp;amp;lt; 0) ? -a[i] : ((b[i] == 0) ? 0 : a[i])&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/* type := {char, short, int}, N = {16, 8, 4} */&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#define N (sizeof(__m128i)/sizeof(type))&lt;/span&gt;
type a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;N&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// input a&lt;/span&gt;
type b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;N&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// input b&lt;/span&gt;
type r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;N&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// output r&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;i&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; N&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy2&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
   r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:66:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc16&quot;&gt;&lt;a name=&quot;Applications&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:66 --&gt;Applications&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:68:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc17&quot;&gt;&lt;a name=&quot;Applications-SSE3 Population Count&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:68 --&gt;SSE3 Population Count&lt;!-- ws:start:WikiTextAnchorRule:119:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@PopCount&amp;quot; title=&amp;quot;Anchor: PopCount&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;PopCount&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:119 --&gt;&lt;/h2&gt;
In 2008, &lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&lt;/a&gt; introduced a SSSE3 &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;Population Count&lt;/a&gt; performing a pair of &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#PSHUFB&quot;&gt;PSHUFB&lt;/a&gt; 16 parallel &lt;a class=&quot;wiki_link&quot; href=&quot;/Nibble&quot;&gt;nibble&lt;/a&gt; in-xmm lookups  &lt;!-- ws:start:WikiTextRefRule:19:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://0x80.pl/articles/sse-popcount.html&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;SSSE3: fast popcount&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Wojciech%20Mu%C5%82a&amp;quot;&amp;gt;Wojciech Muła&amp;lt;/a&amp;gt;, May 24, 2008&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:19 --&gt;, in the meantime due to &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt; even possible with doubled or fourfold register widths, competing the native &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64#gpinstructions&quot;&gt;popcount instruction&lt;/a&gt;  &lt;!-- ws:start:WikiTextRefRule:28:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Wojciech%20Mu%C5%82a&amp;quot;&amp;gt;Wojciech Muła&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://dblp.uni-trier.de/pers/hd/k/Kurz:Nathan&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Nathan Kurz&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://github.com/lemire&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Daniel Lemire&amp;lt;/a&amp;gt; (&amp;lt;strong&amp;gt;2016&amp;lt;/strong&amp;gt;). &amp;lt;em&amp;gt;Faster Population Counts Using AVX2 Instructions&amp;lt;/em&amp;gt;. &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://arxiv.org/abs/1611.07612&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;arXiv:1611.07612&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:28 --&gt; &lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;/**&amp;lt;br/&amp;gt; * popCount2 &amp;lt;br/&amp;gt; * @author Wojciech Muła&amp;lt;br/&amp;gt; * @param v vector of two bitboards&amp;lt;br/&amp;gt; * @return quad word vector of two popcounts&amp;lt;br/&amp;gt;*/&amp;lt;br/&amp;gt;__m128i popCount(__m128i v) {&amp;lt;br/&amp;gt;  __m128i lu = _mm_setr_epi8(0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4);&amp;lt;br/&amp;gt;  __m128i lm = _mm_set1_epi8(0x0f);&amp;lt;br/&amp;gt;  __m128i lo = _mm_and_si128(v, lm);&amp;lt;br/&amp;gt;  __m128i hi = _mm_and_si128(_mm_srli_epi16(v, 4), lm);&amp;lt;br/&amp;gt;  __m128i cl = _mm_shuffle_epi8(lu, lo); /* 16 low nibble counts */&amp;lt;br/&amp;gt;  __m128i ch = _mm_shuffle_epi8(lu, hi); /* 16 high nibble counts */&amp;lt;br/&amp;gt;  __m128i cb = _mm_add_epi8(cl, ch); /* 16 byte counts */&amp;lt;br/&amp;gt;  return _mm_sad_epu8(cb, _mm_setzero_si128());&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/**
 * popCount2 
 * @author Wojciech Muła
 * @param v vector of two bitboards
 * @return quad word vector of two popcounts
*/&lt;/span&gt;
__m128i popCount&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i v&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  __m128i lu &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_setr_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;,&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  __m128i lm &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_set1_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu12&quot;&gt;0x0f&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  __m128i lo &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, lm&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  __m128i hi &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_srli_epi16&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;v, &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;, lm&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
  __m128i cl &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_shuffle_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lu, lo&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* 16 low nibble counts */&lt;/span&gt;
  __m128i ch &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_shuffle_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lu, hi&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* 16 high nibble counts */&lt;/span&gt;
  __m128i cb &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;cl, ch&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* 16 byte counts */&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; _mm_sad_epu8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;cb, _mm_setzero_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:120:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@DotProduct&amp;quot; title=&amp;quot;Anchor: DotProduct&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;DotProduct&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:120 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:70:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc18&quot;&gt;&lt;a name=&quot;Applications-Byte-wise Dot-Product&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:70 --&gt;Byte-wise Dot-Product&lt;/h2&gt;
 This SSSE3-dot-product multiplies a vector of 64 unsigned chars with a vector of 64 signed char, and adds all 64 intermediate signed 16-bit products with saturation. It uses the &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#PMADDUBSW&quot;&gt;pmaddubsw&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#PHADDSW&quot;&gt;phaddsw&lt;/a&gt; SSSE3 instructions, in total 11 SSE instructions.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;int dotProduct(unsigned char features[], char weights[] /* XMM_ALIGN */) {&amp;lt;br/&amp;gt;   __m128i r0, r1, r2, r3;&amp;lt;br/&amp;gt;   __m128i* a = (__m128i*) features;&amp;lt;br/&amp;gt;   __m128i* b = (__m128i*) weights;&amp;lt;br/&amp;gt;   r0 = _mm_maddubs_epi16 (a[0], b[0]);&amp;lt;br/&amp;gt;   r1 = _mm_maddubs_epi16 (a[1], b[1]);&amp;lt;br/&amp;gt;   r2 = _mm_maddubs_epi16 (a[2], b[2]);&amp;lt;br/&amp;gt;   r3 = _mm_maddubs_epi16 (a[3], b[3]);&amp;lt;br/&amp;gt;   r0 = _mm_adds_epi16    (r0, r1);&amp;lt;br/&amp;gt;   r2 = _mm_adds_epi16    (r2, r3);&amp;lt;br/&amp;gt;   r0 = _mm_adds_epi16    (r0, r2); // 8 shorts&amp;lt;br/&amp;gt;   r0 = _mm_hadds_epi16   (r0, r0); // 4 shorts&amp;lt;br/&amp;gt;   r0 = _mm_hadds_epi16   (r0, r0); // 2 shorts&amp;lt;br/&amp;gt;   r0 = _mm_hadds_epi16   (r0, r0); // 1 final short&amp;lt;br/&amp;gt;   short s = (short)_mm_extract_epi16(r0, 0);&amp;lt;br/&amp;gt;   return (int) s; // sign extended&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; dotProduct&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; features&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; weights&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* XMM_ALIGN */&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   __m128i r0, r1, r2, r3&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   __m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; a &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; features&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   __m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;__m128i&lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; weights&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   r0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_maddubs_epi16 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   r1 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_maddubs_epi16 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   r2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_maddubs_epi16 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   r3 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_maddubs_epi16 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;, b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   r0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_adds_epi16    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r0, r1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   r2 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_adds_epi16    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r2, r3&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   r0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_adds_epi16    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r0, r2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 8 shorts&lt;/span&gt;
   r0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_hadds_epi16   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r0, r0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 4 shorts&lt;/span&gt;
   r0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_hadds_epi16   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r0, r0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 2 shorts&lt;/span&gt;
   r0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_hadds_epi16   &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r0, r0&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 1 final short&lt;/span&gt;
   &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; s &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;_mm_extract_epi16&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r0, &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; s&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// sign extended&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:121:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@SSSE3Version&amp;quot; title=&amp;quot;Anchor: SSSE3Version&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;SSSE3Version&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:121 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:72:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc19&quot;&gt;&lt;a name=&quot;Applications-SSSE3 Hyperbola Quintessence&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:72 --&gt;SSSE3 Hyperbola Quintessence&lt;/h2&gt;
 Following routine calculates bishop attacks performing the &lt;a class=&quot;wiki_link&quot; href=&quot;/Hyperbola%20Quintessence&quot;&gt;Hyperbola Quintessence&lt;/a&gt;. Both &lt;a class=&quot;wiki_link&quot; href=&quot;/Anti-Diagonals&quot;&gt;anti-diagonal&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Diagonals&quot;&gt;diagonal&lt;/a&gt; attacks are processed in parallel, using both halves of a 128-bit xmm register and pre-calculated &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;arrays&lt;/a&gt; of bitboard pairs for line-masks, single- and eventually reversed bits. &lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3#PSHUFB&quot;&gt;PSHUFB&lt;/a&gt; is used to swap bytes inside a &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboard&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:32:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;amp;p=367616&amp;amp;amp;t=35858&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt; Re: Plain and fancy magic on modern hardware&amp;lt;/a&amp;gt; by &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Robert%20Purves&amp;quot;&amp;gt;Robert Purves&amp;lt;/a&amp;gt;, &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Computer%20Chess%20Forums&amp;quot;&amp;gt;CCC&amp;lt;/a&amp;gt;, August 23, 2010&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-6&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-6&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:32 --&gt; .&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:74:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc20&quot;&gt;&lt;a name=&quot;Applications-SSSE3 Hyperbola Quintessence-Intrinsic Version&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:74 --&gt;Intrinsic Version&lt;/h3&gt;
 &lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;__m128i diaAntiMaskXMM[64]; // 1 KByte  antidiag : diagonal, excluding square&amp;lt;br/&amp;gt;__m128i singleBitsXMM [64]; // 1 KByte    1&amp;amp;lt;&amp;amp;lt;sq  : 1&amp;amp;lt;&amp;amp;lt;sq&amp;lt;br/&amp;gt;__m128i swapMaskXMM; // needs to be initialized to swap the bytes in both quad-words&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;// SSSE3 Hyperbola Quintessence&amp;lt;br/&amp;gt;U64 bishopAttacks(U64 occ, enumSquare sq) {&amp;lt;br/&amp;gt;   __m128i o, r, m, b, s;&amp;lt;br/&amp;gt;   m = diaAntiMaskXMM[sq];         // antidiag : diagonal, excluding square&amp;lt;br/&amp;gt;   b = singleBitsXMM [sq];         // bishop bits, equal qwords&amp;lt;br/&amp;gt;   s = swapMaskXMM;&amp;lt;br/&amp;gt;   o = _mm_cvtsi64x_si128  (occ) ; // general purpose 64 bit to xmm low qword&amp;lt;br/&amp;gt;   o = _mm_unpacklo_epi64  (o, o); // occ : occ&amp;lt;br/&amp;gt;   o = _mm_and_si128       (o, m); // o (antidiag : diagonal)&amp;lt;br/&amp;gt;   r = _mm_shuffle_epi8    (o, s); // o&#039;(antidiag : diagonal)&amp;lt;br/&amp;gt;   o = _mm_sub_epi64       (o, b); // o - bishop&amp;lt;br/&amp;gt;   b = _mm_shuffle_epi8    (b, s); // bishop&#039;, one may also use singleBitsXMM [sq^56]&amp;lt;br/&amp;gt;   r = _mm_sub_epi64       (r, b); // o&#039;- bishop&#039;&amp;lt;br/&amp;gt;   r = _mm_shuffle_epi8    (r, s); // re-reverse&amp;lt;br/&amp;gt;   o = _mm_xor_si128       (o, r); // attacks&amp;lt;br/&amp;gt;   o = _mm_and_si128       (o, m); // antidiag : diagonal&amp;lt;br/&amp;gt;   r = _mm_unpackhi_epi64  (o, o); // antidiag : antidiag&amp;lt;br/&amp;gt;   o = _mm_add_epi64       (o, r); // diagonal + antidiag&amp;lt;br/&amp;gt;   return _mm_cvtsi128_si64(o);    // convert xmm to general purpose 64 bit&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;__m128i diaAntiMaskXMM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 1 KByte  antidiag : diagonal, excluding square&lt;/span&gt;
__m128i singleBitsXMM &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// 1 KByte    1&amp;lt;&amp;lt;sq  : 1&amp;lt;&amp;lt;sq&lt;/span&gt;
__m128i swapMaskXMM&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// needs to be initialized to swap the bytes in both quad-words&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;// SSSE3 Hyperbola Quintessence&lt;/span&gt;
U64 bishopAttacks&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;U64 occ, enumSquare sq&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   __m128i o, r, m, b, s&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   m &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; diaAntiMaskXMM&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;         &lt;span class=&quot;co1&quot;&gt;// antidiag : diagonal, excluding square&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; singleBitsXMM &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;sq&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;         &lt;span class=&quot;co1&quot;&gt;// bishop bits, equal qwords&lt;/span&gt;
   s &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; swapMaskXMM&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   o &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cvtsi64x_si128  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;occ&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// general purpose 64 bit to xmm low qword&lt;/span&gt;
   o &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_unpacklo_epi64  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o, o&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// occ : occ&lt;/span&gt;
   o &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128       &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o, m&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// o (antidiag : diagonal)&lt;/span&gt;
   r &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_shuffle_epi8    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o, s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// o&#039;(antidiag : diagonal)&lt;/span&gt;
   o &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sub_epi64       &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o, b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// o - bishop&lt;/span&gt;
   b &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_shuffle_epi8    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;b, s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// bishop&#039;, one may also use singleBitsXMM [sq^56]&lt;/span&gt;
   r &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sub_epi64       &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r, b&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// o&#039;- bishop&#039;&lt;/span&gt;
   r &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_shuffle_epi8    &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r, s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// re-reverse&lt;/span&gt;
   o &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_xor_si128       &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o, r&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// attacks&lt;/span&gt;
   o &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_and_si128       &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o, m&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// antidiag : diagonal&lt;/span&gt;
   r &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_unpackhi_epi64  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o, o&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// antidiag : antidiag&lt;/span&gt;
   o &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_add_epi64       &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o, r&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// diagonal + antidiag&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; _mm_cvtsi128_si64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;o&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;    &lt;span class=&quot;co1&quot;&gt;// convert xmm to general purpose 64 bit&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:122:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Peshkov&amp;quot; title=&amp;quot;Anchor: Peshkov&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Peshkov&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:122 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:76:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc21&quot;&gt;&lt;a name=&quot;Applications-SSSE3 Hyperbola Quintessence-Peshkov&#039;s Optimization&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:76 --&gt;Peshkov&#039;s Optimization&lt;/h3&gt;
 The pioneer of Hyperbola Quintessence, &lt;a class=&quot;wiki_link&quot; href=&quot;/Aleks%20Peshkov&quot;&gt;Aleks Peshkov&lt;/a&gt;, applies a more sophisticated, optimized &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt; approach, further utilizing disjoint ray-attacks, and &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ExclusiveOr&quot;&gt;xor&lt;/a&gt; instruction is own inverse and distributive over &lt;a class=&quot;wiki_link&quot; href=&quot;/Flipping%20Mirroring%20and%20Rotating&quot;&gt;mirroring or flipping&lt;/a&gt;. Once per &lt;a class=&quot;wiki_link&quot; href=&quot;/Node&quot;&gt;node&lt;/a&gt; he instantiates an &lt;a class=&quot;wiki_link&quot; href=&quot;/Occupancy&quot;&gt;occupied object&lt;/a&gt; based on a &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Type_safety&quot; rel=&quot;nofollow&quot;&gt;type-safe&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern&quot; rel=&quot;nofollow&quot;&gt;curiously recurring template pattern&lt;/a&gt; aka the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Barton%E2%80%93Nackman_trick&quot; rel=&quot;nofollow&quot;&gt;Barton–Nackman trick&lt;/a&gt; to encapsulate the SSE intrinsic data types, to keep a twin of normal and flipped occupancy as base for further &lt;a class=&quot;wiki_link&quot; href=&quot;/Files&quot;&gt;file&lt;/a&gt;-, &lt;a class=&quot;wiki_link&quot; href=&quot;/Diagonals&quot;&gt;diagonal&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Anti-Diagonals&quot;&gt;anti-diagonal&lt;/a&gt; attack generations, which then requires only one final shuffle per piece attack getter, whether it is a bishop or even a queen.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;class Occupied : public BitSet&amp;amp;lt;Occupied, char_x16_t&amp;amp;gt; {&amp;lt;br/&amp;gt;    typedef BitSet&amp;amp;lt;Occupied, char_x16_t&amp;amp;gt; Base;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    struct Mask {&amp;lt;br/&amp;gt;        value_type singleton;&amp;lt;br/&amp;gt;        value_type file;&amp;lt;br/&amp;gt;        value_type diagonal;&amp;lt;br/&amp;gt;        value_type antidiag;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;        Mask operator () (Square);&amp;lt;br/&amp;gt;    };&amp;lt;br/&amp;gt;    typedef Square::const_array&amp;amp;lt;Mask, Mask&amp;amp;gt; CACHE_ALIGN AttackMask;&amp;lt;br/&amp;gt;    static const AttackMask mask;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    struct Shuffle {&amp;lt;br/&amp;gt;        value_type hyperbola;&amp;lt;br/&amp;gt;        value_type flipShift;&amp;lt;br/&amp;gt;        Shuffle ();&amp;lt;br/&amp;gt;    };&amp;lt;br/&amp;gt;    static const Shuffle shuffle;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    static BitBoard bitboard(value_type value) {&amp;lt;br/&amp;gt;        return BitBoard(static_cast&amp;amp;lt;BitBoard::value_type&amp;amp;gt;(_mm_cvtsi128_si64(value)));&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    static BitBoard hyperbola(value_type value) {&amp;lt;br/&amp;gt;        value_type reverse = _mm_shuffle_epi8(value, shuffle.hyperbola);&amp;lt;br/&amp;gt;        return bitboard(value ^ reverse); //xor is principal here&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    INLINE BitBoard bishopAttack(Square from) const {&amp;lt;br/&amp;gt;        value_type d = value;&amp;lt;br/&amp;gt;        value_type a = value;&amp;lt;br/&amp;gt;        d &amp;amp;amp;= mask[from].diagonal;&amp;lt;br/&amp;gt;        a &amp;amp;amp;= mask[from].antidiag;&amp;lt;br/&amp;gt;        d = _mm_sub_epi64(d, mask[from].singleton);&amp;lt;br/&amp;gt;        a = _mm_sub_epi64(a, mask[from].singleton);&amp;lt;br/&amp;gt;        d &amp;amp;amp;= mask[from].diagonal;&amp;lt;br/&amp;gt;        a &amp;amp;amp;= mask[from].antidiag;&amp;lt;br/&amp;gt;        return hyperbola(d ^ a);&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    ...&amp;lt;br/&amp;gt;public:&amp;lt;br/&amp;gt;    Occupied (const BitBoard&amp;amp;amp; myB, const BitBoard&amp;amp;amp; opB) {&amp;lt;br/&amp;gt;        value_type my = _mm_cvtsi64_si128(reinterpret_cast&amp;amp;lt;const U64&amp;amp;amp;&amp;amp;gt;(myB));&amp;lt;br/&amp;gt;        value_type op = _mm_cvtsi64_si128(reinterpret_cast&amp;amp;lt;const U64&amp;amp;amp;&amp;amp;gt;(opB));&amp;lt;br/&amp;gt;        op = _mm_shuffle_epi8(op, shuffle.flipShift);&amp;lt;br/&amp;gt;        assert (Occupied(my &amp;amp;amp; op) == empty()); //no intersection&amp;lt;br/&amp;gt;        this-&amp;amp;gt;value = my ^ op;&amp;lt;br/&amp;gt;    }&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;    ...&amp;lt;br/&amp;gt;};&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;class&lt;/span&gt; Occupied &lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt; BitSet&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt;Occupied, char_x16_t&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; BitSet&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt;Occupied, char_x16_t&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; Base&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; Mask &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        value_type singleton&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        value_type file&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        value_type diagonal&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        value_type antidiag&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        Mask operator &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Square&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; Square&lt;span class=&quot;sy4&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;const_array&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt;Mask, Mask&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt; CACHE_ALIGN AttackMask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; AttackMask mask&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;struct&lt;/span&gt; Shuffle &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        value_type hyperbola&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        value_type flipShift&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        Shuffle &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; Shuffle shuffle&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; BitBoard bitboard&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;value_type value&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; BitBoard&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;static_cast&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt;BitBoard&lt;span class=&quot;sy4&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;value_type&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;_mm_cvtsi128_si64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;value&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; BitBoard hyperbola&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;value_type value&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        value_type reverse &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_shuffle_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;value, shuffle.&lt;span class=&quot;me1&quot;&gt;hyperbola&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; bitboard&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;value &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; reverse&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;//xor is principal here&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
    INLINE BitBoard bishopAttack&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Square from&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        value_type d &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; value&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        value_type a &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; value&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        d &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;from&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;diagonal&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;from&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;antidiag&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        d &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sub_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;d, mask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;from&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;singleton&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        a &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_sub_epi64&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a, mask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;from&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;singleton&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        d &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;from&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;diagonal&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        a &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; mask&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;from&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;antidiag&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; hyperbola&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;d &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
    ...
&lt;span class=&quot;kw2&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
    Occupied &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; BitBoard&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; myB, &lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; BitBoard&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; opB&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        value_type my &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cvtsi64_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;reinterpret_cast&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;myB&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        value_type op &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_cvtsi64_si128&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;reinterpret_cast&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;const&lt;/span&gt; U64&lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;opB&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        op &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; _mm_shuffle_epi8&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;op, shuffle.&lt;span class=&quot;me1&quot;&gt;flipShift&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Occupied&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;my &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; op&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; empty&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;//no intersection&lt;/span&gt;
        this&lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;&amp;gt;&lt;/span&gt;value &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; my &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt; op&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
    ...
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:78:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc22&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:78 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AltiVec&quot;&gt;AltiVec&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/MMX&quot;&gt;MMX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE3&quot;&gt;SSE3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4&quot;&gt;SSE4&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE5&quot;&gt;SSE5&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:80:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc23&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:80 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/SSSE3&quot; rel=&quot;nofollow&quot;&gt;SSSE3 from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://sseplus.sourceforge.net/index.html&quot; rel=&quot;nofollow&quot;&gt;SSEPlus Project Documentation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/blog/&quot; rel=&quot;nofollow&quot;&gt;Agner`s CPU blog&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://0x80.pl/articles/sse-popcount.html&quot; rel=&quot;nofollow&quot;&gt;SSSE3: fast popcount&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&lt;/a&gt;, May 24, 2008 » &lt;a class=&quot;wiki_link&quot; href=&quot;/Population%20Count&quot;&gt;Population Count&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://software.intel.com/sites/landingpage/IntrinsicsGuide/&quot; rel=&quot;nofollow&quot;&gt;Intel Intrinsics Guide&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:82:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc24&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:82 --&gt;References&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextReferencesRule:296:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://msdn.microsoft.com/en-us/library/vstudio/bb892952%28v=vs.100%29.aspx&quot; rel=&quot;nofollow&quot;&gt;Supplemental Streaming SIMD Extensions 3 Instructions&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://www.cs.fsu.edu/~engelen/courses/HPC-adv/intref_cls.pdf&quot; rel=&quot;nofollow&quot;&gt;Intel C++ Compiler for Linux Intrinsics Reference&lt;/a&gt; (pdf)&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00619.html&quot; rel=&quot;nofollow&quot;&gt;fixing SSSE3 pmaddubsw description&lt;/a&gt; from the mail archive of the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;mailto:gcc-patches@gcc.gnu.org&quot; rel=&quot;nofollow&quot;&gt;gcc-patches@gcc.gnu.org&lt;/a&gt; mailing list for the &lt;a class=&quot;wiki_link&quot; href=&quot;/Free%20Software%20Foundation#GCC&quot;&gt;GCC project&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://0x80.pl/articles/sse-popcount.html&quot; rel=&quot;nofollow&quot;&gt;SSSE3: fast popcount&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&lt;/a&gt;, May 24, 2008&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/Wojciech%20Mu%C5%82a&quot;&gt;Wojciech Muła&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://dblp.uni-trier.de/pers/hd/k/Kurz:Nathan&quot; rel=&quot;nofollow&quot;&gt;Nathan Kurz&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://github.com/lemire&quot; rel=&quot;nofollow&quot;&gt;Daniel Lemire&lt;/a&gt; (&lt;strong&gt;2016&lt;/strong&gt;). &lt;em&gt;Faster Population Counts Using AVX2 Instructions&lt;/em&gt;. &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://arxiv.org/abs/1611.07612&quot; rel=&quot;nofollow&quot;&gt;arXiv:1611.07612&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-6&quot;&gt;&lt;a href=&quot;#cite_ref-6&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?topic_view=threads&amp;amp;p=367616&amp;amp;t=35858&quot; rel=&quot;nofollow&quot;&gt; Re: Plain and fancy magic on modern hardware&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Robert%20Purves&quot;&gt;Robert Purves&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Computer%20Chess%20Forums&quot;&gt;CCC&lt;/a&gt;, August 23, 2010&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:296 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:84:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc25&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:84 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:09:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;SSSE3&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;SSSE3&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-SSSE3 includeBody-SSSE3 includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Aart+Bik&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Aart Bik&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Aleks+Peshkov&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Aleks Peshkov&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 13, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AltiVec&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AltiVec&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hyperbola+Quintessence&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hyperbola Quintessence&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Intel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Intel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Population+Count&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Population Count&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Reverse+Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Reverse Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE5&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE5&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Windows&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Windows&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 2, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Wojciech+Mu%C5%82a&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Wojciech Muła&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/XOP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;XOP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:09 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>TBM</title>
      <link>https://chessprogramming.wikispaces.com/TBM</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/TBM</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/TBM</comments>
      <pubDate>Thu, 28 Jun 2012 17:56:56 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:51:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:51 --&gt;&lt;!-- ws:start:WikiTextTocRule:52: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Instructions&quot;&gt;Instructions&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:52 --&gt;&lt;!-- ws:start:WikiTextTocRule:53: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-Least Significant One Bit&quot;&gt;Least Significant One Bit&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:53 --&gt;&lt;!-- ws:start:WikiTextTocRule:54: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-Least Significant One Bit-BLSFILL&quot;&gt;BLSFILL&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:54 --&gt;&lt;!-- ws:start:WikiTextTocRule:55: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-Least Significant One Bit-BLSIC&quot;&gt;BLSIC&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:55 --&gt;&lt;!-- ws:start:WikiTextTocRule:56: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-Least Significant One Bit-TZMSK&quot;&gt;TZMSK&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:56 --&gt;&lt;!-- ws:start:WikiTextTocRule:57: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-Least Significant Zero Bit&quot;&gt;Least Significant Zero Bit&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:57 --&gt;&lt;!-- ws:start:WikiTextTocRule:58: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-Least Significant Zero Bit-BLCFILL&quot;&gt;BLCFILL&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:58 --&gt;&lt;!-- ws:start:WikiTextTocRule:59: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-Least Significant Zero Bit-BLCI&quot;&gt;BLCI&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:59 --&gt;&lt;!-- ws:start:WikiTextTocRule:60: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-Least Significant Zero Bit-BLCIC&quot;&gt;BLCIC&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:60 --&gt;&lt;!-- ws:start:WikiTextTocRule:61: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-Least Significant Zero Bit-BLCMSK&quot;&gt;BLCMSK&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:61 --&gt;&lt;!-- ws:start:WikiTextTocRule:62: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-Least Significant Zero Bit-BLCS&quot;&gt;BLCS&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:62 --&gt;&lt;!-- ws:start:WikiTextTocRule:63: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-Least Significant Zero Bit-T1MSKC&quot;&gt;T1MSKC&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:63 --&gt;&lt;!-- ws:start:WikiTextTocRule:64: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Instructions-Misc&quot;&gt;Misc&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:64 --&gt;&lt;!-- ws:start:WikiTextTocRule:65: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Instructions-Misc-BEXTR&quot;&gt;BEXTR&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:65 --&gt;&lt;!-- ws:start:WikiTextTocRule:66: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:66 --&gt;&lt;!-- ws:start:WikiTextTocRule:67: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Manuals&quot;&gt;Manuals&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:67 --&gt;&lt;!-- ws:start:WikiTextTocRule:68: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:68 --&gt;&lt;!-- ws:start:WikiTextTocRule:69: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:69 --&gt;&lt;!-- ws:start:WikiTextTocRule:70: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:70 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; * TBM&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;TBM&lt;/strong&gt; (Trailing Bit Manipulation Instructions),&lt;br /&gt;
an x86-64 expansion of &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling#BitManipulation&quot;&gt;bit-manipulation&lt;/a&gt; instructions, introduced by &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; with the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Bulldozer_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Bulldozer microarchitecture&lt;/a&gt;, which also comprises the &lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt; instruction sets. TBM requires  bit 21 set in ECX of CPUID EAX=80000001H &lt;!-- ws:start:WikiTextRefRule:11:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://support.amd.com/us/Embedded_TechDocs/25481.pdf&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;AMD CPUID Specification&amp;lt;/a&amp;gt; (pdf)&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:11 --&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Instructions&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;Instructions&lt;/h1&gt;
TBM offers various bit-manipulations based on the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;least significant one&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantZeroBitLS0B&quot;&gt;zero bit&lt;/a&gt;. In general they combine two or three &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations&quot;&gt;operations&lt;/a&gt; on 32- or 64-bit general purpose registers, expanding the &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI&lt;/a&gt; type of operations of &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1#BLSI&quot;&gt;BLSI&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1#BLSMSK&quot;&gt;BLSMSK&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1#BLSR&quot;&gt;BLSR&lt;/a&gt;. In &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt;, these instructions should be emitted by an optimizing compiler for this target platform, rather than using intrinsics. Instructions are given with &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Assembly_language#Opcode_mnemonics_and_extended_mnemonics&quot; rel=&quot;nofollow&quot;&gt;mnemonics&lt;/a&gt; with 64-bit destination and source register according to &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#x86Syntax&quot;&gt;Intel Syntax&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; like definition, and some arbitrary &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;bitboard&lt;/a&gt; diagrams with &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations#LittleEndianRankFileMapping&quot;&gt;little-endian rank-file mapping&lt;/a&gt; (least significant bit 0 as square a1 bottom-left) to illustrate the operations. &lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextIncludeRule:010:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/page?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; title=&amp;quot;Include page: page=&amp;amp;quot;MappingHint&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a href=&quot;/Square%20Mapping%20Considerations&quot;&gt;&lt;img src=&quot;/file/view/mapping.JPG/93134172/mapping.JPG&quot; alt=&quot;mapping.JPG&quot; title=&quot;mapping.JPG&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;em&gt;Code samples and bitboard diagrams rely on &lt;a class=&quot;wiki_link&quot; href=&quot;/Square%20Mapping%20Considerations#LittleEndianRankFileMapping&quot;&gt;Little endian file and rank mapping&lt;/a&gt;&lt;/em&gt;.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;!-- ws:end:WikiTextIncludeRule:010 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextAnchorRule:71:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BLSFILL&amp;quot; title=&amp;quot;Anchor: BLSFILL&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BLSFILL&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:71 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Instructions-Least Significant One Bit&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;Least Significant One Bit&lt;/h2&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Instructions-Least Significant One Bit-BLSFILL&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;BLSFILL&lt;/h3&gt;
Fill From Lowest Set Bit. &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;Union&lt;/a&gt; with the decrement.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;BLSFILL reg64, reg/mem64&amp;lt;br/&amp;gt;dest ::= src | (src - 1);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;       src         |     (src - 1)     =       dest&amp;lt;br/&amp;gt;0x0040201008040200  0x00402010080401FF  0x00402010080403FF&amp;lt;br/&amp;gt;  . . . . . . . .     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;  . . . . . . 1 .     . . . . . . 1 .     . . . . . . 1 .&amp;lt;br/&amp;gt;  . . . . . 1 . .     . . . . . 1 . .     . . . . . 1 . .&amp;lt;br/&amp;gt;  . . . . 1 . . .     . . . . 1 . . .     . . . . 1 . . .&amp;lt;br/&amp;gt;  . . . 1 . . . .  |  . . . 1 . . . .  =  . . . 1 . . . .&amp;lt;br/&amp;gt;  . . 1 . . . . .     . . 1 . . . . .     . . 1 . . . . .&amp;lt;br/&amp;gt;  . 1 . . . . . .     1 . . . . . . .     1 1 . . . . . .&amp;lt;br/&amp;gt;  . . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;BLSFILL reg64, reg/mem64
dest ::= src | (src - 1);
&amp;nbsp;
       src         |     (src - 1)     =       dest
0x0040201008040200  0x00402010080401FF  0x00402010080403FF
  . . . . . . . .     . . . . . . . .     . . . . . . . .
  . . . . . . 1 .     . . . . . . 1 .     . . . . . . 1 .
  . . . . . 1 . .     . . . . . 1 . .     . . . . . 1 . .
  . . . . 1 . . .     . . . . 1 . . .     . . . . 1 . . .
  . . . 1 . . . .  |  . . . 1 . . . .  =  . . . 1 . . . .
  . . 1 . . . . .     . . 1 . . . . .     . . 1 . . . . .
  . 1 . . . . . .     1 . . . . . . .     1 1 . . . . . .
  . . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:72:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BLSIC&amp;quot; title=&amp;quot;Anchor: BLSIC&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BLSIC&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:72 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Instructions-Least Significant One Bit-BLSIC&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;BLSIC&lt;/h3&gt;
Isolate Lowest Set Bit and Complement. &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;Union&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;complement&lt;/a&gt; and decrement.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;BLSIC reg64, reg/mem64&amp;lt;br/&amp;gt;dest ::= ~src | (src - 1);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;       src        -&amp;amp;gt;       ~src        |     (src - 1)     =       dest&amp;lt;br/&amp;gt;0x0040201008040200  0x00402010080401FF  0x00402010080403FF  0xFFFFFFFFFFFFFDFF&amp;lt;br/&amp;gt;  . . . . . . . .     1 1 1 1 1 1 1 1     . . . . . . . .     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;  . . . . . . 1 .     1 1 1 1 1 1 . 1     . . . . . . 1 .     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;  . . . . . 1 . .     1 1 1 1 1 . 1 1     . . . . . 1 . .     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;  . . . . 1 . . .     1 1 1 1 . 1 1 1     . . . . 1 . . .     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;  . . . 1 . . . . -&amp;amp;gt;  1 1 1 . 1 1 1 1  |  . . . 1 . . . .  =  1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;  . . 1 . . . . .     1 1 . 1 1 1 1 1     . . 1 . . . . .     1 1 1 1 1 1 1 1&amp;lt;br/&amp;gt;  . 1 . . . . . .     1 . 1 1 1 1 1 1     1 . . . . . . .     1 . 1 1 1 1 1 1&amp;lt;br/&amp;gt;  . . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;BLSIC reg64, reg/mem64
dest ::= ~src | (src - 1);
&amp;nbsp;
       src        -&amp;gt;       ~src        |     (src - 1)     =       dest
0x0040201008040200  0x00402010080401FF  0x00402010080403FF  0xFFFFFFFFFFFFFDFF
  . . . . . . . .     1 1 1 1 1 1 1 1     . . . . . . . .     1 1 1 1 1 1 1 1
  . . . . . . 1 .     1 1 1 1 1 1 . 1     . . . . . . 1 .     1 1 1 1 1 1 1 1
  . . . . . 1 . .     1 1 1 1 1 . 1 1     . . . . . 1 . .     1 1 1 1 1 1 1 1
  . . . . 1 . . .     1 1 1 1 . 1 1 1     . . . . 1 . . .     1 1 1 1 1 1 1 1
  . . . 1 . . . . -&amp;gt;  1 1 1 . 1 1 1 1  |  . . . 1 . . . .  =  1 1 1 1 1 1 1 1
  . . 1 . . . . .     1 1 . 1 1 1 1 1     . . 1 . . . . .     1 1 1 1 1 1 1 1
  . 1 . . . . . .     1 . 1 1 1 1 1 1     1 . . . . . . .     1 . 1 1 1 1 1 1
  . . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:73:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@TZMSK&amp;quot; title=&amp;quot;Anchor: TZMSK&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;TZMSK&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:73 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:23:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Instructions-Least Significant One Bit-TZMSK&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:23 --&gt;TZMSK&lt;/h3&gt;
Mask From Trailing Zeros. &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;Intersection&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;complement&lt;/a&gt; and decrement &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#LS1BSeparation&quot;&gt;sets all bits below&lt;/a&gt; the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;least significant one bit&lt;/a&gt;, and clears all other bits, including the LS1B itself.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;dest ::= ~src &amp;amp;amp; (src - 1);&amp;lt;br/&amp;gt;       src        -&amp;amp;gt;       ~src        &amp;amp;amp;     (src - 1)     =       dest&amp;lt;br/&amp;gt;0x0040201008040200  0x00402010080401FF  0x00402010080403FF  0x00000000000001FF&amp;lt;br/&amp;gt;  . . . . . . . .     1 1 1 1 1 1 1 1     . . . . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;  . . . . . . 1 .     1 1 1 1 1 1 . 1     . . . . . . 1 .     . . . . . . . .&amp;lt;br/&amp;gt;  . . . . . 1 . .     1 1 1 1 1 . 1 1     . . . . . 1 . .     . . . . . . . .&amp;lt;br/&amp;gt;  . . . . 1 . . .     1 1 1 1 . 1 1 1     . . . . 1 . . .     . . . . . . . .&amp;lt;br/&amp;gt;  . . . 1 . . . . -&amp;amp;gt;  1 1 1 . 1 1 1 1  &amp;amp;amp;  . . . 1 . . . .  =  . . . . . . . .&amp;lt;br/&amp;gt;  . . 1 . . . . .     1 1 . 1 1 1 1 1     . . 1 . . . . .     . . . . . . . .&amp;lt;br/&amp;gt;  . 1 . . . . . .     1 . 1 1 1 1 1 1     1 . . . . . . .     1 . . . . . . .&amp;lt;br/&amp;gt;  . . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;dest ::= ~src &amp;amp; (src - 1);
       src        -&amp;gt;       ~src        &amp;amp;     (src - 1)     =       dest
0x0040201008040200  0x00402010080401FF  0x00402010080403FF  0x00000000000001FF
  . . . . . . . .     1 1 1 1 1 1 1 1     . . . . . . . .     . . . . . . . .
  . . . . . . 1 .     1 1 1 1 1 1 . 1     . . . . . . 1 .     . . . . . . . .
  . . . . . 1 . .     1 1 1 1 1 . 1 1     . . . . . 1 . .     . . . . . . . .
  . . . . 1 . . .     1 1 1 1 . 1 1 1     . . . . 1 . . .     . . . . . . . .
  . . . 1 . . . . -&amp;gt;  1 1 1 . 1 1 1 1  &amp;amp;  . . . 1 . . . .  =  . . . . . . . .
  . . 1 . . . . .     1 1 . 1 1 1 1 1     . . 1 . . . . .     . . . . . . . .
  . 1 . . . . . .     1 . 1 1 1 1 1 1     1 . . . . . . .     1 . . . . . . .
  . . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:74:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BLCFILL&amp;quot; title=&amp;quot;Anchor: BLCFILL&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BLCFILL&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:74 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:25:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Instructions-Least Significant Zero Bit&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:25 --&gt;Least Significant Zero Bit&lt;/h2&gt;
&lt;!-- ws:start:WikiTextHeadingRule:27:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Instructions-Least Significant Zero Bit-BLCFILL&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:27 --&gt;BLCFILL&lt;/h3&gt;
Fill From Lowest Clear Bit. &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;Intersection&lt;/a&gt; with the increment.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:3:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;BLCFILL reg64, reg/mem64&amp;lt;br/&amp;gt;dest ::= src &amp;amp;amp; (src + 1);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;       src         &amp;amp;amp;     (src + 1)     =       dest&amp;lt;br/&amp;gt;0x80C0E0F0F8FCFEFF  0x80C0E0F0F8FCFF00  0x80C0E0F0F8FCFE00&amp;lt;br/&amp;gt;  . . . . . . . 1     . . . . . . . 1     . . . . . . . 1  &amp;lt;br/&amp;gt;  . . . . . . 1 1     . . . . . . 1 1     . . . . . . 1 1  &amp;lt;br/&amp;gt;  . . . . . 1 1 1     . . . . . 1 1 1     . . . . . 1 1 1  &amp;lt;br/&amp;gt;  . . . . 1 1 1 1     . . . . 1 1 1 1     . . . . 1 1 1 1  &amp;lt;br/&amp;gt;  . . . 1 1 1 1 1  &amp;amp;amp;  . . . 1 1 1 1 1  =  . . . 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . 1 1 1 1 1 1     . . 1 1 1 1 1 1     . . 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  1 1 1 1 1 1 1 1     . . . . . . . .     . . . . . . . .  &amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;BLCFILL reg64, reg/mem64
dest ::= src &amp;amp; (src + 1);
&amp;nbsp;
       src         &amp;amp;     (src + 1)     =       dest
0x80C0E0F0F8FCFEFF  0x80C0E0F0F8FCFF00  0x80C0E0F0F8FCFE00
  . . . . . . . 1     . . . . . . . 1     . . . . . . . 1  
  . . . . . . 1 1     . . . . . . 1 1     . . . . . . 1 1  
  . . . . . 1 1 1     . . . . . 1 1 1     . . . . . 1 1 1  
  . . . . 1 1 1 1     . . . . 1 1 1 1     . . . . 1 1 1 1  
  . . . 1 1 1 1 1  &amp;amp;  . . . 1 1 1 1 1  =  . . . 1 1 1 1 1  
  . . 1 1 1 1 1 1     . . 1 1 1 1 1 1     . . 1 1 1 1 1 1  
  . 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     . 1 1 1 1 1 1 1  
  1 1 1 1 1 1 1 1     . . . . . . . .     . . . . . . . .  &lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:3 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:75:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BLCI&amp;quot; title=&amp;quot;Anchor: BLCI&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BLCI&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:75 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:29:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc7&quot;&gt;&lt;a name=&quot;Instructions-Least Significant Zero Bit-BLCI&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:29 --&gt;BLCI&lt;/h3&gt;
Isolate Lowest Clear Bit. &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;Union&lt;/a&gt; with the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;complement&lt;/a&gt; of the increment.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:4:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;BLCI reg64, reg/mem64&amp;lt;br/&amp;gt;dest ::= src | ~(src + 1);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;       src         |    ~(src + 1)     =       dest&amp;lt;br/&amp;gt;0x80C0E0F0F8FCFEFF  0x7F3F1F0F070300FF  0xFFFFFFFFFFFFFEFF&amp;lt;br/&amp;gt;  . . . . . . . 1     1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . . . . . 1 1     1 1 1 1 1 1 . .     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . . . . 1 1 1     1 1 1 1 1 . . .     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . . . 1 1 1 1     1 1 1 1 . . . .     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . . 1 1 1 1 1  |  1 1 1 . . . . .  =  1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . 1 1 1 1 1 1     1 1 . . . . . .     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . 1 1 1 1 1 1 1     . . . . . . . .     . 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1  &amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;BLCI reg64, reg/mem64
dest ::= src | ~(src + 1);
&amp;nbsp;
       src         |    ~(src + 1)     =       dest
0x80C0E0F0F8FCFEFF  0x7F3F1F0F070300FF  0xFFFFFFFFFFFFFEFF
  . . . . . . . 1     1 1 1 1 1 1 1 .     1 1 1 1 1 1 1 1  
  . . . . . . 1 1     1 1 1 1 1 1 . .     1 1 1 1 1 1 1 1  
  . . . . . 1 1 1     1 1 1 1 1 . . .     1 1 1 1 1 1 1 1  
  . . . . 1 1 1 1     1 1 1 1 . . . .     1 1 1 1 1 1 1 1  
  . . . 1 1 1 1 1  |  1 1 1 . . . . .  =  1 1 1 1 1 1 1 1  
  . . 1 1 1 1 1 1     1 1 . . . . . .     1 1 1 1 1 1 1 1  
  . 1 1 1 1 1 1 1     . . . . . . . .     . 1 1 1 1 1 1 1  
  1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1  &lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:4 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:76:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BLCIC&amp;quot; title=&amp;quot;Anchor: BLCIC&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BLCIC&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:76 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:31:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc8&quot;&gt;&lt;a name=&quot;Instructions-Least Significant Zero Bit-BLCIC&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:31 --&gt;BLCIC&lt;/h3&gt;
Isolate Lowest Clear Bit and Complement. &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Intersection&quot;&gt;Intersection&lt;/a&gt; of the &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;complement&lt;/a&gt; with the increment.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:5:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;BLCIC reg64, reg/mem64&amp;lt;br/&amp;gt;dest ::= ~src &amp;amp;amp; (src + 1);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;       src        -&amp;amp;gt;       ~src        &amp;amp;amp;     (src + 1)     =       dest&amp;lt;br/&amp;gt;0x80C0E0F0F8FCFEFF  0x7F3F1F0F07030100  0x80C0E0F0F8FCFF00  0x0000000000000100&amp;lt;br/&amp;gt;  . . . . . . . 1     1 1 1 1 1 1 1 .     . . . . . . . 1     . . . . . . . . &amp;lt;br/&amp;gt;  . . . . . . 1 1     1 1 1 1 1 1 . .     . . . . . . 1 1     . . . . . . . .  &amp;lt;br/&amp;gt;  . . . . . 1 1 1     1 1 1 1 1 . . .     . . . . . 1 1 1     . . . . . . . .  &amp;lt;br/&amp;gt;  . . . . 1 1 1 1     1 1 1 1 . . . .     . . . . 1 1 1 1     . . . . . . . .  &amp;lt;br/&amp;gt;  . . . 1 1 1 1 1 -&amp;amp;gt;  1 1 1 . . . . .  &amp;amp;amp;  . . . 1 1 1 1 1  =  . . . . . . . .  &amp;lt;br/&amp;gt;  . . 1 1 1 1 1 1     1 1 . . . . . .     . . 1 1 1 1 1 1     . . . . . . . .  &amp;lt;br/&amp;gt;  . 1 1 1 1 1 1 1     1 . . . . . . .     1 1 1 1 1 1 1 1     1 . . . . . . .  &amp;lt;br/&amp;gt;  1 1 1 1 1 1 1 1     . . . . . . . .     . . . . . . . .     . . . . . . . .  &amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;BLCIC reg64, reg/mem64
dest ::= ~src &amp;amp; (src + 1);
&amp;nbsp;
       src        -&amp;gt;       ~src        &amp;amp;     (src + 1)     =       dest
0x80C0E0F0F8FCFEFF  0x7F3F1F0F07030100  0x80C0E0F0F8FCFF00  0x0000000000000100
  . . . . . . . 1     1 1 1 1 1 1 1 .     . . . . . . . 1     . . . . . . . . 
  . . . . . . 1 1     1 1 1 1 1 1 . .     . . . . . . 1 1     . . . . . . . .  
  . . . . . 1 1 1     1 1 1 1 1 . . .     . . . . . 1 1 1     . . . . . . . .  
  . . . . 1 1 1 1     1 1 1 1 . . . .     . . . . 1 1 1 1     . . . . . . . .  
  . . . 1 1 1 1 1 -&amp;gt;  1 1 1 . . . . .  &amp;amp;  . . . 1 1 1 1 1  =  . . . . . . . .  
  . . 1 1 1 1 1 1     1 1 . . . . . .     . . 1 1 1 1 1 1     . . . . . . . .  
  . 1 1 1 1 1 1 1     1 . . . . . . .     1 1 1 1 1 1 1 1     1 . . . . . . .  
  1 1 1 1 1 1 1 1     . . . . . . . .     . . . . . . . .     . . . . . . . .  &lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:5 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:77:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BLCMSK&amp;quot; title=&amp;quot;Anchor: BLCMSK&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BLCMSK&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:77 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:33:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc9&quot;&gt;&lt;a name=&quot;Instructions-Least Significant Zero Bit-BLCMSK&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:33 --&gt;BLCMSK&lt;/h3&gt;
Mask From Lowest Clear Bit. &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ExclusiveOr&quot;&gt;Exclusive or&lt;/a&gt; with the increment.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:6:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;BLCMSK reg64, reg/mem64&amp;lt;br/&amp;gt;dest ::= src ^ (src + 1);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;       src         ^     (src + 1)     =       dest&amp;lt;br/&amp;gt;0x80C0E0F0F8FCFEFF  0x80C0E0F0F8FCFF00  0x00000000000001FF&amp;lt;br/&amp;gt;  . . . . . . . 1     . . . . . . . 1     . . . . . . . .  &amp;lt;br/&amp;gt;  . . . . . . 1 1     . . . . . . 1 1     . . . . . . . .  &amp;lt;br/&amp;gt;  . . . . . 1 1 1     . . . . . 1 1 1     . . . . . . . .  &amp;lt;br/&amp;gt;  . . . . 1 1 1 1     . . . . 1 1 1 1     . . . . . . . .  &amp;lt;br/&amp;gt;  . . . 1 1 1 1 1  ^  . . . 1 1 1 1 1  =  . . . . . . . .  &amp;lt;br/&amp;gt;  . . 1 1 1 1 1 1     . . 1 1 1 1 1 1     . . . . . . . .  &amp;lt;br/&amp;gt;  . 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 . . . . . . .  &amp;lt;br/&amp;gt;  1 1 1 1 1 1 1 1     . . . . . . . .     1 1 1 1 1 1 1 1  &amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;BLCMSK reg64, reg/mem64
dest ::= src ^ (src + 1);
&amp;nbsp;
       src         ^     (src + 1)     =       dest
0x80C0E0F0F8FCFEFF  0x80C0E0F0F8FCFF00  0x00000000000001FF
  . . . . . . . 1     . . . . . . . 1     . . . . . . . .  
  . . . . . . 1 1     . . . . . . 1 1     . . . . . . . .  
  . . . . . 1 1 1     . . . . . 1 1 1     . . . . . . . .  
  . . . . 1 1 1 1     . . . . 1 1 1 1     . . . . . . . .  
  . . . 1 1 1 1 1  ^  . . . 1 1 1 1 1  =  . . . . . . . .  
  . . 1 1 1 1 1 1     . . 1 1 1 1 1 1     . . . . . . . .  
  . 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 . . . . . . .  
  1 1 1 1 1 1 1 1     . . . . . . . .     1 1 1 1 1 1 1 1  &lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:6 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:78:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BLCS&amp;quot; title=&amp;quot;Anchor: BLCS&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BLCS&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:78 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:35:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc10&quot;&gt;&lt;a name=&quot;Instructions-Least Significant Zero Bit-BLCS&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:35 --&gt;BLCS&lt;/h3&gt;
Set Lowest Clear Bit. &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;Union&lt;/a&gt; with the increment.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:7:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;BLCS reg64, reg/mem64&amp;lt;br/&amp;gt;dest ::= src | (src + 1);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;       src         |     (src + 1)     =       dest&amp;lt;br/&amp;gt;0x80C0E0F0F8FCFEFF  0x80C0E0F0F8FCFF00  0x80C0E0F0F8FCFFFF&amp;lt;br/&amp;gt;  . . . . . . . 1     . . . . . . . 1     . . . . . . . 1  &amp;lt;br/&amp;gt;  . . . . . . 1 1     . . . . . . 1 1     . . . . . . 1 1  &amp;lt;br/&amp;gt;  . . . . . 1 1 1     . . . . . 1 1 1     . . . . . 1 1 1  &amp;lt;br/&amp;gt;  . . . . 1 1 1 1     . . . . 1 1 1 1     . . . . 1 1 1 1  &amp;lt;br/&amp;gt;  . . . 1 1 1 1 1  |  . . . 1 1 1 1 1  =  . . . 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . 1 1 1 1 1 1     . . 1 1 1 1 1 1     . . 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  1 1 1 1 1 1 1 1     . . . . . . . .     1 1 1 1 1 1 1 1  &amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;BLCS reg64, reg/mem64
dest ::= src | (src + 1);
&amp;nbsp;
       src         |     (src + 1)     =       dest
0x80C0E0F0F8FCFEFF  0x80C0E0F0F8FCFF00  0x80C0E0F0F8FCFFFF
  . . . . . . . 1     . . . . . . . 1     . . . . . . . 1  
  . . . . . . 1 1     . . . . . . 1 1     . . . . . . 1 1  
  . . . . . 1 1 1     . . . . . 1 1 1     . . . . . 1 1 1  
  . . . . 1 1 1 1     . . . . 1 1 1 1     . . . . 1 1 1 1  
  . . . 1 1 1 1 1  |  . . . 1 1 1 1 1  =  . . . 1 1 1 1 1  
  . . 1 1 1 1 1 1     . . 1 1 1 1 1 1     . . 1 1 1 1 1 1  
  . 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1  
  1 1 1 1 1 1 1 1     . . . . . . . .     1 1 1 1 1 1 1 1  &lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:7 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:79:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@T1MSKC&amp;quot; title=&amp;quot;Anchor: T1MSKC&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;T1MSKC&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:79 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:37:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc11&quot;&gt;&lt;a name=&quot;Instructions-Least Significant Zero Bit-T1MSKC&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:37 --&gt;T1MSKC&lt;/h3&gt;
Inverse Mask From Trailing Ones. &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#Union&quot;&gt;Union&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#ComplementSet&quot;&gt;complement&lt;/a&gt; and increment.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:8:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;T1MSKC reg64, reg/mem64&amp;lt;br/&amp;gt;dest ::= ~src | (src + 1);&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;       src        -&amp;amp;gt;       ~src        |     (src + 1)     =       dest&amp;lt;br/&amp;gt;0x80C0E0F0F8FCFEFF  0x7F3F1F0F07030100  0x80C0E0F0F8FCFF00  0xFFFFFFFFFFFFFF00&amp;lt;br/&amp;gt;  . . . . . . . 1     1 1 1 1 1 1 1 .     . . . . . . . 1     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . . . . . 1 1     1 1 1 1 1 1 . .     . . . . . . 1 1     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . . . . 1 1 1     1 1 1 1 1 . . .     . . . . . 1 1 1     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . . . 1 1 1 1     1 1 1 1 . . . .     . . . . 1 1 1 1     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . . 1 1 1 1 1 -&amp;amp;gt;  1 1 1 . . . . .  |  . . . 1 1 1 1 1  =  1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . . 1 1 1 1 1 1     1 1 . . . . . .     . . 1 1 1 1 1 1     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  . 1 1 1 1 1 1 1     1 . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1  &amp;lt;br/&amp;gt;  1 1 1 1 1 1 1 1     . . . . . . . .     . . . . . . . .     . . . . . . . .  &amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;T1MSKC reg64, reg/mem64
dest ::= ~src | (src + 1);
&amp;nbsp;
       src        -&amp;gt;       ~src        |     (src + 1)     =       dest
0x80C0E0F0F8FCFEFF  0x7F3F1F0F07030100  0x80C0E0F0F8FCFF00  0xFFFFFFFFFFFFFF00
  . . . . . . . 1     1 1 1 1 1 1 1 .     . . . . . . . 1     1 1 1 1 1 1 1 1  
  . . . . . . 1 1     1 1 1 1 1 1 . .     . . . . . . 1 1     1 1 1 1 1 1 1 1  
  . . . . . 1 1 1     1 1 1 1 1 . . .     . . . . . 1 1 1     1 1 1 1 1 1 1 1  
  . . . . 1 1 1 1     1 1 1 1 . . . .     . . . . 1 1 1 1     1 1 1 1 1 1 1 1  
  . . . 1 1 1 1 1 -&amp;gt;  1 1 1 . . . . .  |  . . . 1 1 1 1 1  =  1 1 1 1 1 1 1 1  
  . . 1 1 1 1 1 1     1 1 . . . . . .     . . 1 1 1 1 1 1     1 1 1 1 1 1 1 1  
  . 1 1 1 1 1 1 1     1 . . . . . . .     1 1 1 1 1 1 1 1     1 1 1 1 1 1 1 1  
  1 1 1 1 1 1 1 1     . . . . . . . .     . . . . . . . .     . . . . . . . .  &lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:8 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:80:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@BEXTR&amp;quot; title=&amp;quot;Anchor: BEXTR&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;BEXTR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:80 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:39:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc12&quot;&gt;&lt;a name=&quot;Instructions-Misc&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:39 --&gt;Misc&lt;/h2&gt;
&lt;!-- ws:start:WikiTextHeadingRule:41:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc13&quot;&gt;&lt;a name=&quot;Instructions-Misc-BEXTR&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:41 --&gt;BEXTR&lt;/h3&gt;
An immediate form of the variable &lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1#BEXTR&quot;&gt;BMI1 Bit Field Extract&lt;/a&gt;.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:9:
&amp;lt;pre class=&amp;quot;text&amp;quot;&amp;gt;BEXTR reg32, reg/mem32, imm32&amp;lt;br/&amp;gt;BEXTR reg64, reg/mem64, imm32&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.text  {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;text&quot;&gt;BEXTR reg32, reg/mem32, imm32
BEXTR reg64, reg/mem64, imm32&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:9 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:43:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc14&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:43 --&gt;See also&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4#ABM&quot;&gt;ABM&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Bit-Twiddling&quot;&gt;Bit-Twiddling&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI1&quot;&gt;BMI1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/BMI2&quot;&gt;BMI2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations&quot;&gt;General Setwise Operations&lt;/a&gt;&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/General%20Setwise%20Operations#TheLeastSignificantOneBitLS1B&quot;&gt;Obtaining and Clearing the Least Significant Bit (LS1B)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:45:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc15&quot;&gt;&lt;a name=&quot;Manuals&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:45 --&gt;Manuals&lt;/h1&gt;
    &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/24594_APM_v3.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD64 Architecture Programmer’s Manual Volume 3: General-Purpose and System Instructions&lt;/a&gt; (pdf) &lt;!-- ws:start:WikiTextRefRule:12:&amp;amp;lt;ref&amp;amp;gt;Moved BMI and TBM instructions from Volume 4 to Volume 3 in September 2011&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:12 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Processor_TechDocs/47414_15h_sw_opt_guide.pdf&quot; rel=&quot;nofollow&quot;&gt;Software Optimization Guide for AMD Family 15h Processors&lt;/a&gt; (pdf) 9.9 Optimizing with BMI and TBM Instructions, pp. 163&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:47:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc16&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:47 --&gt;References&lt;/h1&gt;
&lt;!-- ws:start:WikiTextReferencesRule:188:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://support.amd.com/us/Embedded_TechDocs/25481.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD CPUID Specification&lt;/a&gt; (pdf)&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; Moved BMI and TBM instructions from Volume 4 to Volume 3 in September 2011&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:188 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:49:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc17&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:49 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:011:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;TBM&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;TBM&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;60&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-TBM includeBody-TBM includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit-Twiddling&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit-Twiddling&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/TBM&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;TBM&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 28, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:011 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>Word</title>
      <link>https://chessprogramming.wikispaces.com/Word</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/Word</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/Word</comments>
      <pubDate>Sun, 25 Jan 2015 22:21:42 GMT</pubDate>
      <description>&lt;!-- ws:start:WikiTextTocRule:23:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:23 --&gt;&lt;!-- ws:start:WikiTextTocRule:24: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#x16-bit Word&quot;&gt;16-bit Word&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:24 --&gt;&lt;!-- ws:start:WikiTextTocRule:25: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Short&quot;&gt;Short&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:25 --&gt;&lt;!-- ws:start:WikiTextTocRule:26: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Ranges&quot;&gt;Ranges&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:26 --&gt;&lt;!-- ws:start:WikiTextTocRule:27: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Alignment&quot;&gt;Alignment&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:27 --&gt;&lt;!-- ws:start:WikiTextTocRule:28: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Endianness&quot;&gt;Endianness&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:28 --&gt;&lt;!-- ws:start:WikiTextTocRule:29: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Extracting Bytes&quot;&gt;Extracting Bytes&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:29 --&gt;&lt;!-- ws:start:WikiTextTocRule:30: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#See also&quot;&gt;See also&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:30 --&gt;&lt;!-- ws:start:WikiTextTocRule:31: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:31 --&gt;&lt;!-- ws:start:WikiTextTocRule:32: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:32 --&gt;&lt;!-- ws:start:WikiTextTocRule:33: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:33 --&gt;&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Programming&quot;&gt;Programming&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Data&quot;&gt;Data&lt;/a&gt; * Word&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
A &lt;strong&gt;Word&lt;/strong&gt; or Computer Word, is a term for the natural unit of data used by a particular computer architecture. Modern computers usually have a word size to be a power of 2 multiple of the unit of address resolution, likely a &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;Byte&lt;/a&gt;, that is two, four, or eight Bytes, which are 16, 32, or 64 &lt;a class=&quot;wiki_link&quot; href=&quot;/Bit&quot;&gt;bits&lt;/a&gt;. Many other sizes have been used in the past, including 8 (a Byte), 9, 12, 18, 24, 36, 39, 40, 48, and 60 bits. Some of the early computers were decimal rather than binary, having a word size of 10 or 12 decimal digits, and some of them had no fixed word length at all.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:5:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;x16-bit Word&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:5 --&gt;16-bit Word&lt;/h1&gt;
 Often the size of a word is defined to be a value for compatibility with earlier computers, such as &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; architecture, which referes a &lt;strong&gt;Word&lt;/strong&gt; from the original &lt;a class=&quot;wiki_link&quot; href=&quot;/8086&quot;&gt;8086&lt;/a&gt; 16-bit µ-Processor. Subsequently Intel used the terms &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;Double Word&lt;/a&gt; (&lt;strong&gt;dword&lt;/strong&gt;) for 32-bit words, a quadruple word or &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;Quad Word&lt;/a&gt; (&lt;strong&gt;qword&lt;/strong&gt;) for 64-bits words, and even a &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Quad%20Word&quot;&gt;Double Quad Word&lt;/a&gt; for 128-bit words. &lt;a class=&quot;wiki_link&quot; href=&quot;/x86&quot;&gt;x86&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; registers may still treated as word registers (ax versus eax or even rax) , while it is recommend to use the native 32-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;double word&lt;/a&gt;, because the word-wise access requires a prefix byte to overwrite the default width. &lt;a class=&quot;wiki_link&quot; href=&quot;/SIMD%20and%20SWAR%20Techniques&quot;&gt;SIMD&lt;/a&gt; instruction sets like &lt;a class=&quot;wiki_link&quot; href=&quot;/MMX&quot;&gt;MMX&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/AltiVec&quot;&gt;AltiVec&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt; provide operations on vectors of four or eight words inside appropriate SIMD-registers. &lt;a class=&quot;wiki_link&quot; href=&quot;/IBM%20360&quot;&gt;IBM 360&lt;/a&gt; and successors with 32-bit words, refer 16-bit size as &lt;strong&gt;halfword&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:7:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Short&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:7 --&gt;Short&lt;/h1&gt;
 On recent 32-bit and 64-bit processors the primitive &lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt; datatype &lt;strong&gt;short&lt;/strong&gt; and &lt;strong&gt;unsigned short&lt;/strong&gt; refers to 16-bit words by most compilers for those architectures. In &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;, &lt;strong&gt;short&lt;/strong&gt; is guaranteed to have 16-bit. Signed short in C is assumed to use &lt;a class=&quot;wiki_link&quot; href=&quot;/Twos%27%20Complement&quot;&gt;Twos&#039; Complement&lt;/a&gt;, but not strictly specified. A Word-type, explicitly type-defined in C, is therefor usually treated as unsigned, also to avoid arithmetical right shift issues:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:0:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;typedef unsigned char  BYTE;&amp;lt;br/&amp;gt;typedef unsigned short WORD;&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt;  BYTE&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;short&lt;/span&gt; WORD&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:0 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:34:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Ranges&amp;quot; title=&amp;quot;Anchor: Ranges&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Ranges&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:34 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:9:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Ranges&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:9 --&gt;Ranges&lt;/h1&gt;
 

&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;type&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;language&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;min&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;max&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;unsigned short&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;65535&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;hexadecimal&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x0000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0xFFFF&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;#include &amp;lt;limits.h&amp;gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;USHRT_MAX&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;short&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/C&quot;&gt;C&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Cpp&quot;&gt;C++&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Java&quot;&gt;Java&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;-32768&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;32767&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;hexadecimal&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x8000&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;0x7FFF&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;#include &amp;lt;limits.h&amp;gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;SHRT_MIN&lt;br /&gt;
&lt;/td&gt;
        &lt;td style=&quot;text-align: right;&quot;&gt;SHRT_MAX&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:11:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Alignment&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:11 --&gt;Alignment&lt;/h1&gt;
 Words stored in memory should be stored at even byte addresses. Otherwise at runtime it will cause a miss-alignment exception on some processors, or a huge penalty on others.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:13:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Endianness&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:13 --&gt;Endianness&lt;/h1&gt;
 &lt;em&gt;Main article: &lt;a class=&quot;wiki_link&quot; href=&quot;/Endianness&quot;&gt;Endianness&lt;/a&gt;.&lt;/em&gt;&lt;br /&gt;
An issue with words consisting of two or more bytes, is the order, bytes may appear inside a word of memory. According to their usual arithmetical significance, there is a low and a high byte of a 16-bit word, which may either be stored at the lower or higher byte-address in memory. Intel processors were always so called &lt;a class=&quot;wiki_link&quot; href=&quot;/little-endian&quot;&gt;little-endian&lt;/a&gt; machines, the least significant byte (LSB) is at the lowest address. Other processors, including the &lt;a class=&quot;wiki_link&quot; href=&quot;/IBM%20370&quot;&gt;IBM 370&lt;/a&gt; family, the &lt;a class=&quot;wiki_link&quot; href=&quot;/PDP-10&quot;&gt;PDP-10&lt;/a&gt; (36 bit), the Motorola microprocessor families, and most of the various RISC designs are &lt;a class=&quot;wiki_link&quot; href=&quot;/big-endian&quot;&gt;big-endian&lt;/a&gt;, and store the ‘big-end-first’.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:15:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Extracting Bytes&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:15 --&gt;Extracting Bytes&lt;/h1&gt;
 Following C union to extract or synthesize bytes from/in words, is not portable and should be avoided.&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:1:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;union {&amp;lt;br/&amp;gt;   BYTE b[2];&amp;lt;br/&amp;gt;   WORD s;&amp;lt;br/&amp;gt;} u;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;u.s = 0xaa55;&amp;lt;br/&amp;gt;assert (u.b[0] == 0x55); // fails, if big-endian&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;union&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   BYTE b&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   WORD s&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; u&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
u.&lt;span class=&quot;me1&quot;&gt;s&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0xaa55&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw3&quot;&gt;assert&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;u.&lt;span class=&quot;me1&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x55&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// fails, if big-endian&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:1 --&gt;The portable way in C can be done with inlined functions or C preprocessor macros, using arithmetical divide or modulo by 256, aka shift and mask by bitwise &#039;and&#039; - or for the synthesis multiplication of high byte by 256 plus low byte:&lt;br /&gt;
&lt;!-- ws:start:WikiTextCodeRule:2:
&amp;lt;pre class=&amp;quot;cpp&amp;quot;&amp;gt;BYTE lowByte (WORD s) {return (BYTE)(s &amp;amp;amp; 255);} // mod 256&amp;lt;br/&amp;gt;BYTE highByte(WORD s) {return (BYTE)(s &amp;amp;gt;&amp;amp;gt;  8);} // div 256&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;WORD makeWORD (BYTE high, BYTE low) {&amp;lt;br/&amp;gt;   WORD  s = high;&amp;lt;br/&amp;gt;   return (s &amp;amp;lt;&amp;amp;lt; 8) + low; // high * 256 + low&amp;lt;br/&amp;gt;}&amp;lt;/pre&amp;gt;
 --&gt;
&lt;style type=&quot;text/css&quot;&gt;&lt;!--
/**
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 */
.cpp  {font-family:monospace;}
.cpp .imp {font-weight: bold; color: red;}
.cpp .kw1 {color: #0000ff;}
.cpp .kw2 {color: #0000ff;}
.cpp .kw3 {color: #0000dd;}
.cpp .kw4 {color: #0000ff;}
.cpp .co1 {color: #666666;}
.cpp .co2 {color: #339900;}
.cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp .es0 {color: #000099; font-weight: bold;}
.cpp .es1 {color: #000099; font-weight: bold;}
.cpp .es2 {color: #660099; font-weight: bold;}
.cpp .es3 {color: #660099; font-weight: bold;}
.cpp .es4 {color: #660099; font-weight: bold;}
.cpp .es5 {color: #006699; font-weight: bold;}
.cpp .br0 {color: #008000;}
.cpp .sy0 {color: #008000;}
.cpp .sy1 {color: #000080;}
.cpp .sy2 {color: #000040;}
.cpp .sy3 {color: #000040;}
.cpp .sy4 {color: #008080;}
.cpp .st0 {color: #FF0000;}
.cpp .nu0 {color: #0000dd;}
.cpp .nu6 {color: #208080;}
.cpp .nu8 {color: #208080;}
.cpp .nu12 {color: #208080;}
.cpp .nu16 {color:#800080;}
.cpp .nu17 {color:#800080;}
.cpp .nu18 {color:#800080;}
.cpp .nu19 {color:#800080;}
.cpp .me1 {color: #007788;}
.cpp .me2 {color: #007788;}
.cpp span.xtra { display:block; }

--&gt;
&lt;/style&gt;&lt;pre class=&quot;cpp&quot;&gt;BYTE lowByte &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;WORD s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;BYTE&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// mod 256&lt;/span&gt;
BYTE highByte&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;WORD s&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;BYTE&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s &lt;span class=&quot;sy1&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;  &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// div 256&lt;/span&gt;
&amp;nbsp;
WORD makeWORD &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;BYTE high, BYTE low&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   WORD  s &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; high&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;s &lt;span class=&quot;sy1&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;+&lt;/span&gt; low&lt;span class=&quot;sy4&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// high * 256 + low&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;!-- ws:end:WikiTextCodeRule:2 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:17:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc6&quot;&gt;&lt;a name=&quot;See also&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:17 --&gt;See also&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;Byte&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;Double Word&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;Quad Word&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:19:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:19 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Word_%28computer_science%29&quot; rel=&quot;nofollow&quot;&gt;Word from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Byte&quot; rel=&quot;nofollow&quot;&gt;Byte from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Endianness&quot; rel=&quot;nofollow&quot;&gt;Endianness from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://betterexplained.com/articles/understanding-big-and-little-endian-byte-order/&quot; rel=&quot;nofollow&quot;&gt;Understanding Big and Little Endian Byte Order&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.ietf.org/rfc/ien/ien137.txt&quot; rel=&quot;nofollow&quot;&gt;IEN 137 - DAV&#039;s Endian FAQ - On Holy Wars and a Plea for Peace&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.myri.com/staff/cohen/&quot; rel=&quot;nofollow&quot;&gt;Danny Cohen&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://ai.isi.edu/&quot; rel=&quot;nofollow&quot;&gt;U S C/I S I&lt;/a&gt;, April 1, 1980&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#MahavishnuOrchestra&quot;&gt;Mahavishnu Orchestra&lt;/a&gt; - &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Birds_of_Fire&quot; rel=&quot;nofollow&quot;&gt;One Word&lt;/a&gt;, 1973, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/YouTube&quot; rel=&quot;nofollow&quot;&gt;YouTube&lt;/a&gt; Video&lt;br /&gt;
&lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#JohnMcLaughlin&quot;&gt;John McLaughlin&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#BillyCobham&quot;&gt;Billy Cobham&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Rick_Laird&quot; rel=&quot;nofollow&quot;&gt;Rick Laird&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Videos#JanHammer&quot;&gt;Jan Hammer&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikipedia.org/wiki/Jerry_Goodman&quot; rel=&quot;nofollow&quot;&gt;Jerry Goodman&lt;/a&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextMediaRule:3:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/youtube/_&amp;amp;#45;-OPhoTUZY%3Frel%3D0?h=360&amp;amp;w=480&amp;quot; class=&amp;quot;WikiMedia WikiMediaYoutube&amp;quot; id=&amp;quot;wikitext@@media@@type=&amp;amp;quot;youtube&amp;amp;quot; key=&amp;amp;quot;_&amp;amp;#45;-OPhoTUZY?rel=0&amp;amp;quot; height=&amp;amp;quot;360&amp;amp;quot; width=&amp;amp;quot;480&amp;amp;quot;&amp;quot; title=&amp;quot;YouTube Video&amp;quot;height=&amp;quot;360&amp;quot; width=&amp;quot;480&amp;quot;/&amp;gt; --&gt;&lt;iframe width=&quot;480&quot; height=&quot;360&quot; src=&quot;//www.youtube.com/embed/_--OPhoTUZY?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;!-- ws:end:WikiTextMediaRule:3 --&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:21:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc8&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:21 --&gt;What links here?&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextIncludeRule:03:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@page=&amp;amp;quot;Word&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: page=&amp;amp;quot;Word&amp;amp;quot; component=&amp;amp;quot;backlinks&amp;amp;quot; limit=&amp;amp;quot;40&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-Word includeBody-Word includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tfoot class=&quot;includeBacklinksFooter&quot;&gt;
    &lt;tr&gt;
      &lt;td colspan=&quot;5&quot;&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/page/links/Word&quot;&gt;More Links&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tfoot&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/6502&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;6502&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/6800&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;6800&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/8080&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;8080&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/8086&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;8086&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 18, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AltiVec&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AltiVec&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Array&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Array&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 1, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX-512&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX-512&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Big-endian&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Big-endian&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 29, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Serialization&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Serialization&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 24, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BMI2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BMI2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Byte&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Byte&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Checkmate&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Checkmate&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 13, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CHEOPS&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CHEOPS&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 18, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/CookieCat&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;CookieCat&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 15, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Cray-1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Cray-1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Data&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Data&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DEC+Alpha&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DEC Alpha&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 15, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dictionary&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dictionary&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double+Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Encoding+Moves&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Encoding Moves&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Endianness&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Endianness&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fairchild+F8&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fairchild F8&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 31, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Graphics+Programming&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Graphics Programming&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 22, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/HP+2100&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;HP 2100&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 3, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/i860&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;i860&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 21, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/IBM+704&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;IBM 704&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 2, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Little-endian&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Little-endian&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MMX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MMX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Murka&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Murka&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nova&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nova&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/PDP-11&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;PDP-11&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Quad+Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Quad Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Score&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Score&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 14, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Spector&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Spector&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:03 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Data&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>
    <item>
      <title>x86</title>
      <link>https://chessprogramming.wikispaces.com/x86</link>
      <dc:creator>GerdIsenberg</dc:creator>
      <guid isPermaLink="true">https://chessprogramming.wikispaces.com/x86</guid>
      <comments>https://chessprogramming.wikispaces.com/page/messages/x86</comments>
      <pubDate>Thu, 04 Jan 2018 20:27:06 GMT</pubDate>
      <description>&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Home&quot;&gt;Home&lt;/a&gt; * &lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Hardware&lt;/a&gt; * x86&lt;/strong&gt;&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;!-- ws:start:WikiTextLocalImageRule:450:&amp;lt;a href=&amp;quot;https://commons.wikimedia.org/wiki/File:Intel_80386_DX_die.JPG&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/Intel_80386_DX_die.JPG/540709892/Intel_80386_DX_die.JPG&amp;quot; alt=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;a href=&quot;https://commons.wikimedia.org/wiki/File:Intel_80386_DX_die.JPG&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/Intel_80386_DX_die.JPG/540709892/Intel_80386_DX_die.JPG&quot; alt=&quot;Intel_80386_DX_die.JPG&quot; title=&quot;Intel_80386_DX_die.JPG&quot; /&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextLocalImageRule:450 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
        &lt;td rowspan=&quot;2&quot;&gt;&lt;strong&gt;x86&lt;/strong&gt;, &lt;br /&gt;
also called IA-32, is an architecture referred to the 32-bit instruction set of the &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_80386&quot; rel=&quot;nofollow&quot;&gt;80386&lt;/a&gt; processor released in 1985 - the successor of Intel&#039;s 16-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/8086&quot;&gt;8086&lt;/a&gt; until &lt;a class=&quot;wiki_link&quot; href=&quot;/80286&quot;&gt;80286&lt;/a&gt; processors. x86 could address up to 4GByte physical &lt;a class=&quot;wiki_link&quot; href=&quot;/Memory&quot;&gt;memory&lt;/a&gt;, had virtual memory pages and a mode to protect them over process boundaries - a requirement for multitasking operating systems, despite 16-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/MS-DOS&quot;&gt;MS-DOS&lt;/a&gt; was still popular. While the initial x86 was &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Complex_instruction_set_computer&quot; rel=&quot;nofollow&quot;&gt;Complex Instruction Set Computing&lt;/a&gt; (CISC), the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Reduced_instruction_set_computer&quot; rel=&quot;nofollow&quot;&gt;RISC&lt;/a&gt; versus CISC issue had become indistinct with more recent x86 processors, internally processing RISC like micro opcode. Over the time, modern architectural features, such as &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Out-of-order_execution&quot; rel=&quot;nofollow&quot;&gt;Out-of-order execution&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Instruction_pipeline&quot; rel=&quot;nofollow&quot;&gt;Pipelining&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Register_renaming&quot; rel=&quot;nofollow&quot;&gt;Register Renaming&lt;/a&gt; and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Branch_predication&quot; rel=&quot;nofollow&quot;&gt;Branch Predication&lt;/a&gt; became an issue. 80386 was once clocked by about 25MHz. The &lt;a class=&quot;wiki_link&quot; href=&quot;/Memory#RAM&quot;&gt;RAM&lt;/a&gt; access speed could not keep up with higher and higher clock frequency of later processors - small but faster &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/CPU_cache&quot; rel=&quot;nofollow&quot;&gt;cache memory&lt;/a&gt; became necessary and strategies to make them efficient, nowadays even with three cache levels with different size and speed.&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Die_%28integrated_circuit%29&quot; rel=&quot;nofollow&quot;&gt;Die&lt;/a&gt; shot of &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; 80386 DX-25 &lt;!-- ws:start:WikiTextRefRule:4:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://commons.wikimedia.org/wiki/File:Intel_80386_DX_die.JPG&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Die shot&amp;lt;/a&amp;gt; of &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Intel&amp;quot;&amp;gt;Intel&amp;lt;/a&amp;gt; 80386 DX-25 microprocessor (SX215) by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://commons.wikimedia.org/wiki/User:Birdman86&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Pauli Rautakorpi&amp;lt;/a&amp;gt;, October 28, 2013, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Wikimedia_Commons&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Wikimedia Commons&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-1&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-1&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:4 --&gt;&lt;br /&gt;
&lt;/td&gt;
        &lt;th&gt;&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;em&gt;see &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; for x86 64-bit&lt;/em&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextTocRule:82:&amp;lt;img id=&amp;quot;wikitext@@toc@@normal&amp;quot; class=&amp;quot;WikiMedia WikiMediaToc&amp;quot; title=&amp;quot;Table of Contents&amp;quot; src=&amp;quot;/site/embedthumbnail/toc/normal?w=225&amp;amp;h=100&amp;quot;/&amp;gt; --&gt;&lt;div id=&quot;toc&quot;&gt;&lt;h1 class=&quot;nopad&quot;&gt;Table of Contents&lt;/h1&gt;&lt;!-- ws:end:WikiTextTocRule:82 --&gt;&lt;!-- ws:start:WikiTextTocRule:83: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Computer Chess&quot;&gt;Computer Chess&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:83 --&gt;&lt;!-- ws:start:WikiTextTocRule:84: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Architectures&quot;&gt;Architectures&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:84 --&gt;&lt;!-- ws:start:WikiTextTocRule:85: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Register Files&quot;&gt;Register Files&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:85 --&gt;&lt;!-- ws:start:WikiTextTocRule:86: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Register Files-General Purpose&quot;&gt;General Purpose&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:86 --&gt;&lt;!-- ws:start:WikiTextTocRule:87: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Register Files-MMX&quot;&gt;MMX&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:87 --&gt;&lt;!-- ws:start:WikiTextTocRule:88: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Register Files-3DNow!&quot;&gt;3DNow!&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:88 --&gt;&lt;!-- ws:start:WikiTextTocRule:89: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Register Files-SSE/SSE2&quot;&gt;SSE/SSE2&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:89 --&gt;&lt;!-- ws:start:WikiTextTocRule:90: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#CPUS&quot;&gt;CPUS&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:90 --&gt;&lt;!-- ws:start:WikiTextTocRule:91: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#CPUS-Intel&quot;&gt;Intel&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:91 --&gt;&lt;!-- ws:start:WikiTextTocRule:92: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#CPUS-Cyrix&quot;&gt;Cyrix&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:92 --&gt;&lt;!-- ws:start:WikiTextTocRule:93: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#CPUS-AMD&quot;&gt;AMD&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:93 --&gt;&lt;!-- ws:start:WikiTextTocRule:94: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Software&quot;&gt;Software&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:94 --&gt;&lt;!-- ws:start:WikiTextTocRule:95: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Software-Operating Systems&quot;&gt;Operating Systems&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:95 --&gt;&lt;!-- ws:start:WikiTextTocRule:96: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Software-Development&quot;&gt;Development&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:96 --&gt;&lt;!-- ws:start:WikiTextTocRule:97: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Software-Development-Assembly&quot;&gt;Assembly&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:97 --&gt;&lt;!-- ws:start:WikiTextTocRule:98: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Software-Development-Pascal&quot;&gt;Pascal&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:98 --&gt;&lt;!-- ws:start:WikiTextTocRule:99: --&gt;&lt;div style=&quot;margin-left: 3em;&quot;&gt;&lt;a href=&quot;#Software-Development-C-Compiler&quot;&gt;C-Compiler&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:99 --&gt;&lt;!-- ws:start:WikiTextTocRule:100: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Extensions&quot;&gt;Extensions&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:100 --&gt;&lt;!-- ws:start:WikiTextTocRule:101: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Manuals&quot;&gt;Manuals&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:101 --&gt;&lt;!-- ws:start:WikiTextTocRule:102: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Manuals-Intel&quot;&gt;Intel&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:102 --&gt;&lt;!-- ws:start:WikiTextTocRule:103: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#Manuals-AMD&quot;&gt;AMD&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:103 --&gt;&lt;!-- ws:start:WikiTextTocRule:104: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#Forum Posts&quot;&gt;Forum Posts&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:104 --&gt;&lt;!-- ws:start:WikiTextTocRule:105: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#External Links&quot;&gt;External Links&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:105 --&gt;&lt;!-- ws:start:WikiTextTocRule:106: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Assembly&quot;&gt;Assembly&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:106 --&gt;&lt;!-- ws:start:WikiTextTocRule:107: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Modes&quot;&gt;Modes&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:107 --&gt;&lt;!-- ws:start:WikiTextTocRule:108: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Instruction Sets&quot;&gt;Instruction Sets&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:108 --&gt;&lt;!-- ws:start:WikiTextTocRule:109: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Bugs&quot;&gt;Bugs&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:109 --&gt;&lt;!-- ws:start:WikiTextTocRule:110: --&gt;&lt;div style=&quot;margin-left: 2em;&quot;&gt;&lt;a href=&quot;#External Links-Security Vulnerability&quot;&gt;Security Vulnerability&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:110 --&gt;&lt;!-- ws:start:WikiTextTocRule:111: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#References&quot;&gt;References&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:111 --&gt;&lt;!-- ws:start:WikiTextTocRule:112: --&gt;&lt;div style=&quot;margin-left: 1em;&quot;&gt;&lt;a href=&quot;#What links here?&quot;&gt;What links here?&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:112 --&gt;&lt;!-- ws:start:WikiTextTocRule:113: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:113 --&gt;&lt;!-- ws:start:WikiTextAnchorRule:114:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@chess&amp;quot; title=&amp;quot;Anchor: chess&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;chess&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:114 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:22:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc0&quot;&gt;&lt;a name=&quot;Computer Chess&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:22 --&gt;Computer Chess&lt;/h1&gt;
A lot of commercial and amateur &lt;a class=&quot;wiki_link&quot; href=&quot;/IBM%20PC&quot;&gt;PC&lt;/a&gt; chess programs, notably under the operating systems &lt;a class=&quot;wiki_link&quot; href=&quot;/MS-DOS&quot;&gt;MS-DOS&lt;/a&gt; and later &lt;a class=&quot;wiki_link&quot; href=&quot;/Windows&quot;&gt;Windows&lt;/a&gt; and &lt;a class=&quot;wiki_link&quot; href=&quot;/Linux&quot;&gt;Linux&lt;/a&gt;, were developed for this widespread architecture, often taking advantage of 32-bit registers and new instructions, for instance &lt;strong&gt;bsf&lt;/strong&gt; and &lt;strong&gt;btr&lt;/strong&gt; for &lt;a class=&quot;wiki_link&quot; href=&quot;/BitScan&quot;&gt;bitscanning&lt;/a&gt; 2 * 32-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Bitboards&quot;&gt;Bitboards&lt;/a&gt; and 32-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Piece-Sets&quot;&gt;Piece-Sets&lt;/a&gt;. Those instructions were usually not available through high level programming languages, but through &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly&quot;&gt;Assembly&lt;/a&gt; language, later often as &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#InlineAssembly&quot;&gt;inline assembly&lt;/a&gt; of various high level language compilers, for instance &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Visual_C%2B%2B&quot; rel=&quot;nofollow&quot;&gt;Microsoft Visual C&lt;/a&gt; and the &lt;a class=&quot;wiki_link&quot; href=&quot;/Free%20Software%20Foundation#GCC&quot;&gt;GNU C Compiler&lt;/a&gt;. Under the 16-bit &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Real_mode&quot; rel=&quot;nofollow&quot;&gt;real mode&lt;/a&gt; operating system MS-DOS, it was quite common in chess programming to use the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Unreal_mode&quot; rel=&quot;nofollow&quot;&gt;unreal mode&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:7:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.programmersheaven.com/download/1364/download.aspx&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Flat real / real big / unreal mode (v1.2)&amp;lt;/a&amp;gt; from &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;http://www.programmersheaven.com/&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Programmer&#039;s Heaven&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-2&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-2&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:7 --&gt; &lt;!-- ws:start:WikiTextRefRule:10:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/6ded3c0f3241b432&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Unreal mode&amp;lt;/a&amp;gt; by Safronov&#039;s family, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://groups.google.com/group/comp.lang.asm.x86/topics&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;comp.lang.asm.x86&amp;lt;/a&amp;gt;, June 5, 2003&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-3&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-3&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:10 --&gt; to allocate much more physical &lt;a class=&quot;wiki_link&quot; href=&quot;/Memory&quot;&gt;memory&lt;/a&gt; for the &lt;a class=&quot;wiki_link&quot; href=&quot;/Transposition%20Table&quot;&gt;Transposition Table&lt;/a&gt;, the 16 bit operating system, not aware of the huge address space, could access. Other DOS programs relied on &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/DOS_extender&quot; rel=&quot;nofollow&quot;&gt;memory extenders&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:24:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc1&quot;&gt;&lt;a name=&quot;Architectures&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:24 --&gt;Architectures&lt;/h1&gt;
 While the 80386 represented the third microarchitecture (after 8086, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/80286&quot; rel=&quot;nofollow&quot;&gt;80286&lt;/a&gt;), &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_80486&quot; rel=&quot;nofollow&quot;&gt;80486&lt;/a&gt; and Pentium were the fourth and fifth, later called &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/P5_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;P5 microarchitecture&lt;/a&gt;. In 1995 with &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium_Pro&quot; rel=&quot;nofollow&quot;&gt;Pentium Pro&lt;/a&gt;, Intel introduced the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_P6_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;P6 microarchitecture&lt;/a&gt;, eventually revived in the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium_M&quot; rel=&quot;nofollow&quot;&gt;Pentium M&lt;/a&gt; line of microprocessors and the predecessor of Intel&#039;s &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_Core_2&quot; rel=&quot;nofollow&quot;&gt;Core 2 microarchitecture&lt;/a&gt;. Intel&#039;s &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_NetBurst_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;NetBurst&lt;/a&gt; microarchitecture with the advent of the &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pentium+4&quot;&gt;Pentium 4&lt;/a&gt; processor, was famous for its clock speed, but no good reputation by most chess programmers, who favored the &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; K6- and K7-architecture, namely the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Athlon&quot; rel=&quot;nofollow&quot;&gt;Athlon&lt;/a&gt; processor at that time. To begin with the rebirth of P6 and &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_Core_2&quot; rel=&quot;nofollow&quot;&gt;Intel Core 2&lt;/a&gt; architecture in 2006, things changed in favor to Intel again. In November 2008 the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Nehalem_%28microarchitecture%29&quot; rel=&quot;nofollow&quot;&gt;Nehalem&lt;/a&gt; microarchitecture appeared.&lt;br /&gt;
&lt;br /&gt;
Intel&#039;s &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/IA-64&quot; rel=&quot;nofollow&quot;&gt;IA-64&lt;/a&gt; architecture is a complete new and incompatible instruction set to IA-32. It is used by the &lt;a class=&quot;wiki_link&quot; href=&quot;/Itanium&quot;&gt;Itanium&lt;/a&gt; line of processors. The backward compatible 64-bit successor was designed by &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; with the advent of Hammer or AMD64, later cloned by Intel and together referred to the &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt; architecture.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:26:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc2&quot;&gt;&lt;a name=&quot;Register Files&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:26 --&gt;Register Files&lt;/h1&gt;
 x86 has eight 32-bit general purpose registers:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:28:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc3&quot;&gt;&lt;a name=&quot;Register Files-General Purpose&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:28 --&gt;General Purpose&lt;/h2&gt;
 The eight general purpose registers may be treated as 32-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;Double Word&lt;/a&gt;, 16-bit &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;Word&lt;/a&gt; and high and low &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;Byte&lt;/a&gt;:&lt;br /&gt;


&lt;table class=&quot;wiki_table&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;32&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;16&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;8 high&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;8 low&lt;br /&gt;
&lt;/th&gt;
        &lt;th&gt;Purpose&lt;br /&gt;
&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;EAX&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;AX&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;AH&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;AL&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;GP, Accumulator&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;EBX&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;BX&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;BH&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;BL&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;GP, Index Register&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;ECX&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;CX&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;CH&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;CL&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;GP, Counter, variable shift, rotate via CL&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;EDX&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;DX&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;DH&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;DL&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;GP, high Accumulator mul/div&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;ESI&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;SI&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;-&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;-&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;GP, Source Index&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;EDI&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;DI&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;-&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;-&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;GP, Destination Index&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;ESP&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;SP&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;-&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;-&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Stack&quot;&gt;Stack Pointer&lt;/a&gt;&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;EBP&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;BP&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;-&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;-&lt;br /&gt;
&lt;/td&gt;
        &lt;td&gt;GP, Base Pointer&lt;br /&gt;
&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:30:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc4&quot;&gt;&lt;a name=&quot;Register Files-MMX&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:30 --&gt;MMX&lt;/h2&gt;
 &lt;a class=&quot;wiki_link&quot; href=&quot;/MMX&quot;&gt;MMX&lt;/a&gt; was introduced with &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel%20P5%20%28microarchitecture%29&quot;&gt;Pentium MMX&lt;/a&gt; in 1996, adopted by &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&#039;s&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AMD_K6&quot; rel=&quot;nofollow&quot;&gt;K6&lt;/a&gt; in 1997.&lt;br /&gt;
Eight 64-bit MMX-Registers: &lt;strong&gt;MM0&lt;/strong&gt; - &lt;strong&gt;MM7&lt;/strong&gt;.&lt;br /&gt;
Treated as &lt;a class=&quot;wiki_link&quot; href=&quot;/Double&quot;&gt;Double&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;Quad Word&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;vector&lt;/a&gt; of two &lt;a class=&quot;wiki_link&quot; href=&quot;/Float&quot;&gt;Floats&lt;/a&gt; or &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;Double Words&lt;/a&gt;, and as vector if four &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;Words&lt;/a&gt; or eight &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;Bytes&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:32:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc5&quot;&gt;&lt;a name=&quot;Register Files-3DNow!&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:32 --&gt;3DNow!&lt;/h2&gt;
 An MMX-floating point extension by &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt;, introduced in the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AMD_K6-2&quot; rel=&quot;nofollow&quot;&gt;K6-2&lt;/a&gt; processor, 1998.&lt;br /&gt;
It uses the eight 64-bit &lt;strong&gt;MMX&lt;/strong&gt;-Registers: &lt;strong&gt;MM0&lt;/strong&gt; - &lt;strong&gt;MM7&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:34:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc6&quot;&gt;&lt;a name=&quot;Register Files-SSE/SSE2&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:34 --&gt;SSE/SSE2&lt;/h2&gt;
 SSE was introduced by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium_III&quot; rel=&quot;nofollow&quot;&gt;Pentium III&lt;/a&gt; in 1997, &lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt; by &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pentium+4&quot;&gt;Pentium 4&lt;/a&gt; in 2000&lt;br /&gt;
Eight 128-bit &lt;strong&gt;XMM&lt;/strong&gt;-Registers: &lt;strong&gt;XMM0&lt;/strong&gt; - &lt;strong&gt;XMM7&lt;/strong&gt;.&lt;br /&gt;
Treated as &lt;a class=&quot;wiki_link&quot; href=&quot;/Array&quot;&gt;vector&lt;/a&gt; of two &lt;a class=&quot;wiki_link&quot; href=&quot;/Double&quot;&gt;Doubles&lt;/a&gt; (SSE) or &lt;a class=&quot;wiki_link&quot; href=&quot;/Quad%20Word&quot;&gt;Quad Words&lt;/a&gt; (SSE2), as vector of four &lt;a class=&quot;wiki_link&quot; href=&quot;/Float&quot;&gt;Floats&lt;/a&gt; (SSE) or &lt;a class=&quot;wiki_link&quot; href=&quot;/Double%20Word&quot;&gt;Double Words&lt;/a&gt; (SSE2), and as vector if eight &lt;a class=&quot;wiki_link&quot; href=&quot;/Word&quot;&gt;Words&lt;/a&gt; (SSE2) or 16 &lt;a class=&quot;wiki_link&quot; href=&quot;/Byte&quot;&gt;Bytes&lt;/a&gt; (SSE2).&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:36:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc7&quot;&gt;&lt;a name=&quot;CPUS&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:36 --&gt;CPUS&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:38:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc8&quot;&gt;&lt;a name=&quot;CPUS-Intel&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:38 --&gt;Intel&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_80386&quot; rel=&quot;nofollow&quot;&gt;80386&lt;/a&gt; 1985&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_80486&quot; rel=&quot;nofollow&quot;&gt;80486&lt;/a&gt; 1989&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium&quot; rel=&quot;nofollow&quot;&gt;Pentium&lt;/a&gt; 1993 &lt;!-- ws:start:WikiTextRefRule:15:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://commons.wikimedia.org/wiki/File:Intel_Pentium_P54C_die.jpg&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Die shot&amp;lt;/a&amp;gt; of &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/Intel&amp;quot;&amp;gt;Intel&amp;lt;/a&amp;gt; Pentium with P54C core by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://commons.wikimedia.org/wiki/User:Birdman86&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Pauli Rautakorpi&amp;lt;/a&amp;gt;, June 11, 2013, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Wikimedia_Commons&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Wikimedia Commons&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-4&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-4&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:15 --&gt; &lt;!-- ws:start:WikiTextLocalImageRule:452:&amp;lt;a href=&amp;quot;https://commons.wikimedia.org/wiki/File:Intel_Pentium_P54C_die.jpg&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/260px-Intel_Pentium_P54C_die.jpg/540710814/260px-Intel_Pentium_P54C_die.jpg&amp;quot; alt=&amp;quot;Pentium with P54C core&amp;quot; title=&amp;quot;Pentium with P54C core&amp;quot; style=&amp;quot;width: 260px;&amp;quot; align=&amp;quot;right&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;table class=&quot;captionBox&quot; style=&quot;float: right;&quot;&gt;&lt;tr&gt;&lt;td class=&quot;captionedImage&quot;&gt;&lt;a href=&quot;https://commons.wikimedia.org/wiki/File:Intel_Pentium_P54C_die.jpg&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/260px-Intel_Pentium_P54C_die.jpg/540710814/260px-Intel_Pentium_P54C_die.jpg&quot; alt=&quot;260px-Intel_Pentium_P54C_die.jpg&quot; title=&quot;260px-Intel_Pentium_P54C_die.jpg&quot; style=&quot;width: 260px;&quot; align=&quot;right&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;imageCaption&quot;&gt;Pentium with P54C core&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;!-- ws:end:WikiTextLocalImageRule:452 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium_MMX&quot; rel=&quot;nofollow&quot;&gt;Pentium MMX&lt;/a&gt; 1993&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_P6&quot; rel=&quot;nofollow&quot;&gt;P6 microarchitecture&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium_Pro&quot; rel=&quot;nofollow&quot;&gt;Pentium Pro&lt;/a&gt; 1995&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium_II&quot; rel=&quot;nofollow&quot;&gt;Pentium II&lt;/a&gt; 1997&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium_III&quot; rel=&quot;nofollow&quot;&gt;Pentium III&lt;/a&gt; 1999&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/NetBurst&quot; rel=&quot;nofollow&quot;&gt;NetBurst microarchitecture&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://chessprogramming.wikispaces.com/Pentium+4&quot;&gt;Pentium 4&lt;/a&gt; 2000&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_Core_microarchitecture&quot; rel=&quot;nofollow&quot;&gt;Intel Core microarchitecture&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium_M&quot; rel=&quot;nofollow&quot;&gt;Pentium M&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;!-- ws:start:WikiTextAnchorRule:115:&amp;lt;img src=&amp;quot;/i/anchor.gif&amp;quot; class=&amp;quot;WikiAnchor&amp;quot; alt=&amp;quot;Anchor&amp;quot; id=&amp;quot;wikitext@@anchor@@Atom&amp;quot; title=&amp;quot;Anchor: Atom&amp;quot;/&amp;gt; --&gt;&lt;a name=&quot;Atom&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextAnchorRule:115 --&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_Atom&quot; rel=&quot;nofollow&quot;&gt;Intel Atom&lt;/a&gt; 2008&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:40:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc9&quot;&gt;&lt;a name=&quot;CPUS-Cyrix&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:40 --&gt;Cyrix&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Cyrix_6x86&quot; rel=&quot;nofollow&quot;&gt;Cyrix 6x86&lt;/a&gt; 1996&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:42:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc10&quot;&gt;&lt;a name=&quot;CPUS-AMD&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:42 --&gt;AMD&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AMD_K5&quot; rel=&quot;nofollow&quot;&gt;K5&lt;/a&gt; March 1996&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AMD_K6&quot; rel=&quot;nofollow&quot;&gt;K6&lt;/a&gt; 1997&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/AMD_K6-2&quot; rel=&quot;nofollow&quot;&gt;K6-2&lt;/a&gt; 1998&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Athlon&quot; rel=&quot;nofollow&quot;&gt;Athlon&lt;/a&gt; (K7) 1999&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Athlon#Athlon_XP.2FMP&quot; rel=&quot;nofollow&quot;&gt;Athlon XP&lt;/a&gt; &lt;!-- ws:start:WikiTextRefRule:20:&amp;amp;lt;ref&amp;amp;gt;&amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://commons.wikimedia.org/wiki/File:AMD_Athlon_XP_Thoroughbred_die.JPG&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Die shot&amp;lt;/a&amp;gt; of &amp;lt;a class=&amp;quot;wiki_link&amp;quot; href=&amp;quot;/AMD&amp;quot;&amp;gt;AMD&amp;lt;/a&amp;gt; Athlon XP microprocessor with Thoroughbred core (AXDA1800DLT3C) by &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://commons.wikimedia.org/wiki/User:Birdman86&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Pauli Rautakorpi&amp;lt;/a&amp;gt;, February 14, 2014, &amp;lt;a class=&amp;quot;wiki_link_ext&amp;quot; href=&amp;quot;https://en.wikipedia.org/wiki/Wikimedia_Commons&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Wikimedia Commons&amp;lt;/a&amp;gt;&amp;amp;lt;/ref&amp;amp;gt; --&gt;&lt;sup id=&quot;cite_ref-5&quot; class=&quot;reference&quot;&gt;&lt;a href=&quot;#cite_note-5&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt;&lt;!-- ws:end:WikiTextRefRule:20 --&gt; &lt;!-- ws:start:WikiTextLocalImageRule:454:&amp;lt;a href=&amp;quot;https://commons.wikimedia.org/wiki/File:AMD_Athlon_XP_Thoroughbred_die.JPG&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/file/view/AMD_Athlon_XP_Thoroughbred_die.JPG/540711194/AMD_Athlon_XP_Thoroughbred_die.JPG&amp;quot; alt=&amp;quot;AMD Athlon XP (Thoroughbred)&amp;quot; title=&amp;quot;AMD Athlon XP (Thoroughbred)&amp;quot; style=&amp;quot;width: 260px;&amp;quot; align=&amp;quot;right&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt; --&gt;&lt;table class=&quot;captionBox&quot; style=&quot;float: right;&quot;&gt;&lt;tr&gt;&lt;td class=&quot;captionedImage&quot;&gt;&lt;a href=&quot;https://commons.wikimedia.org/wiki/File:AMD_Athlon_XP_Thoroughbred_die.JPG&quot; rel=&quot;nofollow&quot;&gt;&lt;img src=&quot;/file/view/AMD_Athlon_XP_Thoroughbred_die.JPG/540711194/AMD_Athlon_XP_Thoroughbred_die.JPG&quot; alt=&quot;AMD_Athlon_XP_Thoroughbred_die.JPG&quot; title=&quot;AMD_Athlon_XP_Thoroughbred_die.JPG&quot; style=&quot;width: 260px;&quot; align=&quot;right&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;imageCaption&quot;&gt;AMD Athlon XP (Thoroughbred)&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;!-- ws:end:WikiTextLocalImageRule:454 --&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Athlon#Athlon_XP.2FMP&quot; rel=&quot;nofollow&quot;&gt;Athlon MP&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;AMD has continued the name with the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Athlon_64&quot; rel=&quot;nofollow&quot;&gt;Athlon 64&lt;/a&gt;, featuring AMD64 64-bit technology, later called &lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:44:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc11&quot;&gt;&lt;a name=&quot;Software&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:44 --&gt;Software&lt;/h1&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:46:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc12&quot;&gt;&lt;a name=&quot;Software-Operating Systems&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:46 --&gt;Operating Systems&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/MS-DOS&quot;&gt;MS-DOS&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Unix&quot;&gt;Unix&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Unix&quot;&gt;BSD&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Linux&quot;&gt;Linux&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Windows&quot;&gt;Windows&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:48:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc13&quot;&gt;&lt;a name=&quot;Software-Development&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:48 --&gt;Development&lt;/h2&gt;
 &lt;!-- ws:start:WikiTextHeadingRule:50:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc14&quot;&gt;&lt;a name=&quot;Software-Development-Assembly&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:50 --&gt;Assembly&lt;/h3&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#x86&quot;&gt;MASM&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly#x86&quot;&gt;TASM&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:52:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc15&quot;&gt;&lt;a name=&quot;Software-Development-Pascal&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:52 --&gt;Pascal&lt;/h3&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Pascal#TurboPascal&quot;&gt;Turbo Pascal&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Delphi&quot;&gt;Delphi&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:54:&amp;lt;h3&amp;gt; --&gt;&lt;h3 id=&quot;toc16&quot;&gt;&lt;a name=&quot;Software-Development-C-Compiler&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:54 --&gt;C-Compiler&lt;/h3&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Turbo%20C&quot;&gt;Turbo C&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Borland%20C&quot;&gt;Borland C&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Visual_C%2B%2B&quot; rel=&quot;nofollow&quot;&gt;MSVC&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Intel_C%2B%2B_Compiler&quot; rel=&quot;nofollow&quot;&gt;Intel-C&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Free%20Software%20Foundation#GCC&quot;&gt;GCC&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:56:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc17&quot;&gt;&lt;a name=&quot;Extensions&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:56 --&gt;Extensions&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX&quot;&gt;AVX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX2&quot;&gt;AVX2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/AVX-512&quot;&gt;AVX-512&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/MMX&quot;&gt;MMX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE2&quot;&gt;SSE2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE3&quot;&gt;SSE3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSSE3&quot;&gt;SSSE3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE4&quot;&gt;SSE4&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/SSE5&quot;&gt;SSE5&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/x86-64&quot;&gt;x86-64&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/XOP&quot;&gt;XOP&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:58:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc18&quot;&gt;&lt;a name=&quot;Manuals&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:58 --&gt;Manuals&lt;/h1&gt;
&lt;!-- ws:start:WikiTextHeadingRule:60:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc19&quot;&gt;&lt;a name=&quot;Manuals-Intel&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:60 --&gt;Intel&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://flint.cs.yale.edu/cs422/doc/24547012.pdf&quot; rel=&quot;nofollow&quot;&gt;IA-32 Intel® Architecture Software Developer’s Manual Volume 1: Basic Architecture&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://flint.cs.yale.edu/cs422/doc/24547112.pdf&quot; rel=&quot;nofollow&quot;&gt;IA-32 Intel® Architecture Software Developer’s Manual Volume 2: Instruction Set Reference&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://pdos.csail.mit.edu/6.828/2006/readings/ia32/IA32-3.pdf&quot; rel=&quot;nofollow&quot;&gt;IA-32 Intel® Architecture Software Developer’s Manual Volume 3: System Programming Guide&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:62:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc20&quot;&gt;&lt;a name=&quot;Manuals-AMD&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:62 --&gt;AMD&lt;/h2&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.ii.uib.no/~osvik/amd_opt/22007k.pdf&quot; rel=&quot;nofollow&quot;&gt;AMD Athlon Processor x86 Code Optimization Guide&lt;/a&gt; (pdf)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:64:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc21&quot;&gt;&lt;a name=&quot;Forum Posts&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:64 --&gt;Forum Posts&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=36988&quot; rel=&quot;nofollow&quot;&gt;Question for Eugene Nalimov&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/James%20Robertson&quot;&gt;James Robertson&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, December 21, 1998&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=212319&quot; rel=&quot;nofollow&quot;&gt;why loop unrolling isn&#039;t as useful on x86 as it once was&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Wylie%20Garvin&quot;&gt;Wylie Garvin&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 07, 2002&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=285555&quot; rel=&quot;nofollow&quot;&gt;Programmer challenge&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Ed%20Schroder&quot;&gt;Ed Schröder&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, February 20, 2003&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.stmintz.com/ccc/index.php?id=445557&quot; rel=&quot;nofollow&quot;&gt;Expert Assembler Question&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Ed%20Schroder&quot;&gt;Ed Schröder&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, August 26, 2005&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.talkchess.com/forum/viewtopic.php?t=66224&quot; rel=&quot;nofollow&quot;&gt;Intel CPU performance-loss by security-patch?!?&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Stefan%20Pohl&quot;&gt;Stefan Pohl&lt;/a&gt;, &lt;a class=&quot;wiki_link&quot; href=&quot;/CCC&quot;&gt;CCC&lt;/a&gt;, January 03, 2018&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:66:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc22&quot;&gt;&lt;a name=&quot;External Links&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:66 --&gt;External Links&lt;/h1&gt;
 &lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/X86&quot; rel=&quot;nofollow&quot;&gt;x86 from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/IA-32&quot; rel=&quot;nofollow&quot;&gt;IA-32 from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/X87&quot; rel=&quot;nofollow&quot;&gt;x87 from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/#manuals&quot; rel=&quot;nofollow&quot;&gt;Optimization manuals&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/blog/&quot; rel=&quot;nofollow&quot;&gt;Agner`s CPU blog&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.intel.com/museum/online/hist%5Fmicro/hof/&quot; rel=&quot;nofollow&quot;&gt;Microprocessor Hall of Fame&lt;/a&gt; from the &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.intel.com/museum/index.htm&quot; rel=&quot;nofollow&quot;&gt;Intel Museum&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/X86_memory_segmentation&quot; rel=&quot;nofollow&quot;&gt;x86 memory segmentation from Wikipedia&lt;/a&gt; » &lt;a class=&quot;wiki_link&quot; href=&quot;/Memory&quot;&gt;Memory&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/X86_calling_conventions&quot; rel=&quot;nofollow&quot;&gt;x86 calling conventions from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.azillionmonkeys.com/qed/cpujihad.shtml&quot; rel=&quot;nofollow&quot;&gt;7th generation x86 CPU Comparisons&lt;/a&gt; by &lt;a class=&quot;wiki_link&quot; href=&quot;/Paul%20Hsieh&quot;&gt;Paul Hsieh&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:68:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc23&quot;&gt;&lt;a name=&quot;External Links-Assembly&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:68 --&gt;Assembly&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://en.wikibooks.org/wiki/X86_Assembly/X86_Architecture&quot; rel=&quot;nofollow&quot;&gt;X86 Assembly/X86 Architecture from Wikibooks&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/X86_assembly_language&quot; rel=&quot;nofollow&quot;&gt;x86 assembly language from Wikipedia&lt;/a&gt; » &lt;a class=&quot;wiki_link&quot; href=&quot;/Assembly&quot;&gt;Assembly&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/X86_instruction_listings&quot; rel=&quot;nofollow&quot;&gt;x86 instruction listings from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://siyobik.info/index.php?document=x86_32bit_asm&quot; rel=&quot;nofollow&quot;&gt;x86 32-bit Assembly for Atheists&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.cs.virginia.edu/~evans/cs216/guides/x86.html&quot; rel=&quot;nofollow&quot;&gt;x86 Assembly Guide&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:70:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc24&quot;&gt;&lt;a name=&quot;External Links-Modes&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:70 --&gt;Modes&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Protected_mode&quot; rel=&quot;nofollow&quot;&gt;Protected mode from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Real_mode&quot; rel=&quot;nofollow&quot;&gt;Real mode from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Unreal_mode&quot; rel=&quot;nofollow&quot;&gt;Unreal mode from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/LOADALL&quot; rel=&quot;nofollow&quot;&gt;LOADALL from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:72:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc25&quot;&gt;&lt;a name=&quot;External Links-Instruction Sets&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:72 --&gt;Instruction Sets&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/MMX_%28instruction_set%29&quot; rel=&quot;nofollow&quot;&gt;MMX from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/3DNow&quot; rel=&quot;nofollow&quot;&gt;3DNow! from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions&quot; rel=&quot;nofollow&quot;&gt;Streaming SIMD Extensions from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/SSE2&quot; rel=&quot;nofollow&quot;&gt;SSE2 from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/optimize/instruction_tables.pdf&quot; rel=&quot;nofollow&quot;&gt;Instruction Tables&lt;/a&gt; (pdf) by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.agner.org/&quot; rel=&quot;nofollow&quot;&gt;Agner Fog&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:74:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc26&quot;&gt;&lt;a name=&quot;External Links-Bugs&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:74 --&gt;Bugs&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium_FDIV_bug&quot; rel=&quot;nofollow&quot;&gt;Pentium FDIV bug from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Pentium_F00F_bug&quot; rel=&quot;nofollow&quot;&gt;Pentium F00F bug from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;!-- ws:start:WikiTextHeadingRule:76:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id=&quot;toc27&quot;&gt;&lt;a name=&quot;External Links-Security Vulnerability&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:76 --&gt;Security Vulnerability&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Meltdown_(security_vulnerability)&quot; rel=&quot;nofollow&quot;&gt;Meltdown (security vulnerability) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)&quot; rel=&quot;nofollow&quot;&gt;Spectre (security vulnerability) from Wikipedia&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://googleprojectzero.blogspot.de/2018/01/reading-privileged-memory-with-side.html&quot; rel=&quot;nofollow&quot;&gt;Project Zero: Reading privileged memory with a side-channel&lt;/a&gt; by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://thejh.net/&quot; rel=&quot;nofollow&quot;&gt;Jann Horn&lt;/a&gt;, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Project_Zero&quot; rel=&quot;nofollow&quot;&gt;Project Zero&lt;/a&gt;, January 03, 2018&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:78:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc28&quot;&gt;&lt;a name=&quot;References&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:78 --&gt;References&lt;/h1&gt;
&lt;!-- ws:start:WikiTextReferencesRule:750:&amp;amp;lt;references /&amp;amp;gt; --&gt;&lt;ol class=&quot;references&quot;&gt;
&lt;li id=&quot;cite_note-1&quot;&gt;&lt;a href=&quot;#cite_ref-1&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://commons.wikimedia.org/wiki/File:Intel_80386_DX_die.JPG&quot; rel=&quot;nofollow&quot;&gt;Die shot&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; 80386 DX-25 microprocessor (SX215) by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://commons.wikimedia.org/wiki/User:Birdman86&quot; rel=&quot;nofollow&quot;&gt;Pauli Rautakorpi&lt;/a&gt;, October 28, 2013, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Wikimedia_Commons&quot; rel=&quot;nofollow&quot;&gt;Wikimedia Commons&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-2&quot;&gt;&lt;a href=&quot;#cite_ref-2&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.programmersheaven.com/download/1364/download.aspx&quot; rel=&quot;nofollow&quot;&gt;Flat real / real big / unreal mode (v1.2)&lt;/a&gt; from &lt;a class=&quot;wiki_link_ext&quot; href=&quot;http://www.programmersheaven.com/&quot; rel=&quot;nofollow&quot;&gt;Programmer&#039;s Heaven&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-3&quot;&gt;&lt;a href=&quot;#cite_ref-3&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/browse_frm/thread/6ded3c0f3241b432&quot; rel=&quot;nofollow&quot;&gt;Unreal mode&lt;/a&gt; by Safronov&#039;s family, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://groups.google.com/group/comp.lang.asm.x86/topics&quot; rel=&quot;nofollow&quot;&gt;comp.lang.asm.x86&lt;/a&gt;, June 5, 2003&lt;/li&gt;
&lt;li id=&quot;cite_note-4&quot;&gt;&lt;a href=&quot;#cite_ref-4&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://commons.wikimedia.org/wiki/File:Intel_Pentium_P54C_die.jpg&quot; rel=&quot;nofollow&quot;&gt;Die shot&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/Intel&quot;&gt;Intel&lt;/a&gt; Pentium with P54C core by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://commons.wikimedia.org/wiki/User:Birdman86&quot; rel=&quot;nofollow&quot;&gt;Pauli Rautakorpi&lt;/a&gt;, June 11, 2013, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Wikimedia_Commons&quot; rel=&quot;nofollow&quot;&gt;Wikimedia Commons&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;cite_note-5&quot;&gt;&lt;a href=&quot;#cite_ref-5&quot;&gt;^&lt;/a&gt; &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://commons.wikimedia.org/wiki/File:AMD_Athlon_XP_Thoroughbred_die.JPG&quot; rel=&quot;nofollow&quot;&gt;Die shot&lt;/a&gt; of &lt;a class=&quot;wiki_link&quot; href=&quot;/AMD&quot;&gt;AMD&lt;/a&gt; Athlon XP microprocessor with Thoroughbred core (AXDA1800DLT3C) by &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://commons.wikimedia.org/wiki/User:Birdman86&quot; rel=&quot;nofollow&quot;&gt;Pauli Rautakorpi&lt;/a&gt;, February 14, 2014, &lt;a class=&quot;wiki_link_ext&quot; href=&quot;https://en.wikipedia.org/wiki/Wikimedia_Commons&quot; rel=&quot;nofollow&quot;&gt;Wikimedia Commons&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;!-- ws:end:WikiTextReferencesRule:750 --&gt;&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:80:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id=&quot;toc29&quot;&gt;&lt;a name=&quot;What links here?&quot;&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:80 --&gt;What links here?&lt;/h1&gt;
&lt;!-- ws:start:WikiTextIncludeRule:00:&amp;lt;img src=&amp;quot;https://www.wikispaces.com/site/embedthumbnail/include/backlinks?w=200&amp;amp;h=100&amp;quot; class=&amp;quot;WikiMedia WikiMediaInclude&amp;quot; id=&amp;quot;wikitext@@include@@component=&amp;amp;quot;backlinks&amp;amp;quot; page=&amp;amp;quot;x86&amp;amp;quot; limit=&amp;amp;quot;200&amp;amp;quot;&amp;quot; title=&amp;quot;Include backlinks: component=&amp;amp;quot;backlinks&amp;amp;quot; page=&amp;amp;quot;x86&amp;amp;quot; limit=&amp;amp;quot;200&amp;amp;quot;&amp;quot; /&amp;gt; --&gt;&lt;div class=&quot;includeBody-x86 includeBody-x86 includeBody&quot;&gt;&lt;table class=&quot;includeBacklinks&quot;&gt;
  &lt;thead&gt;
    &lt;tr class=&quot;includeBacklinksHeading&quot;&gt;
      &lt;th class=&quot;includeBacklinksPageHeading&quot;&gt;Page&lt;/th&gt;
      &lt;th class=&quot;includeBacklinksDateHeading&quot;&gt;Date Edited&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/14th+Computer+Olympiad&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;14th Computer Olympiad&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/2nd+Computer+Olympiad&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;2nd Computer Olympiad&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 12, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/4th+Computer+Olympiad&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;4th Computer Olympiad&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 15, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/68000&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;68000&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/68030&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;68030&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/8086&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;8086&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 18, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Aart+Bik&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Aart Bik&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 1, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ABK&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ABK&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ACM+1987&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ACM 1987&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ACM+1988&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ACM 1988&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ACM+1989&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ACM 1989&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ACM+1990&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ACM 1990&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ACM+1991&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ACM 1991&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ACM+1993&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ACM 1993&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ACM+1994&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ACM 1994&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Acorn+Atom&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Acorn Atom&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Adam&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Adam&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 24, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Alexander+Naumov&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Alexander Naumov&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 19, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AltiVec&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AltiVec&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Alybadix&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Alybadix&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AMD&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AMD&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 9, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AnMon&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AnMon&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 17, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Artem+Petakov&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Artem Petakov&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Assembly&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Assembly&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Aubervilliers+Rapid+Open&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Aubervilliers Rapid Open&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Avoiding+Branches&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Avoiding Branches&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/AVX2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;AVX2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Awari&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Awari&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Axon&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Axon&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 14, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bareev+versus+Hiarcs+2003&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bareev versus Hiarcs 2003&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 18, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BB&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BB&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboard+Board-Definition&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboard Board-Definition&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 23, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bitboards&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bitboards&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BitScan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BitScan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bookup&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bookup&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BootChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BootChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bouquet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bouquet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/BP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;BP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Bruno+Bras&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Bruno Bras&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Buzz&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Buzz&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 22, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Byte&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Byte&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Carey+Bloodworth&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Carey Bloodworth&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Center+Manhattan-Distance&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Center Manhattan-Distance&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Check+Check&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Check Check&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chess+Genius&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chess Genius&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 26, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Chess+Wizard&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Chess Wizard&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 22, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ChessBase+%28Database%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ChessBase (Database)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 26, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/ChessLin&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;ChessLin&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 17, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Color+of+a+Square&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Color of a Square&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 24, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Crafty&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Crafty&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 28, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dappet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dappet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 12, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Debugging&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Debugging&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Delfi&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Delfi&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Delphi&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Delphi&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 16, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Dictionary&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Dictionary&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 24, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DOCCC+1992&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DOCCC 1992&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 12, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DOCCC+1993&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DOCCC 1993&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 12, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DOCCC+1995&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DOCCC 1995&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/DOCCC+1996&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;DOCCC 1996&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 30, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Double+Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Double Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Ed+Schroder&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Ed Schroder&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 26, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Efficient+Generation+of+Sliding+Piece+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Efficient Generation of Sliding Piece Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Encoding+Moves&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Encoding Moves&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Eric+van+Riet+Paap&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Eric van Riet Paap&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 14, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Eugen&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Eugen&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Evaluator&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Evaluator&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Explorer&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Explorer&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/FCCC+1995&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;FCCC 1995&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 27, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Fencer&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Fencer&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Float&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Float&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Freccia&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Freccia&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gambiet&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gambiet&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gandalf&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gandalf&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 21, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/General+Setwise+Operations&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;General Setwise Operations&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Genesis+NL&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Genesis NL&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 12, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gk&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gk&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 9, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Gunda-1&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Gunda-1&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 8, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hardware&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hardware&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 20, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hiarcs&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hiarcs&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Houdini&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Houdini&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 14, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Huib-Jan+Imbens&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Huib-Jan Imbens&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 20, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Hydra+97&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Hydra 97&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 1, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/i860&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;i860&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 21, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/IBM+PC&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;IBM PC&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 9, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Intel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Intel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/IPCCC+1991&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;IPCCC 1991&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 9, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Itanium&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Itanium&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 29, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Joker+IT&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Joker IT&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kallisto&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kallisto&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 28, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kasparov%27s+Gambit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kasparov&amp;#039;s Gambit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/KBNK+Endgame&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;KBNK Endgame&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kim+Walisch&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kim Walisch&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 10, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Knight-Distance&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Knight-Distance&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 20, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Kristy+Lenix&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Kristy Lenix&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 28, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/LChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;LChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Leonid+Liberman&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Leonid Liberman&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 23, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Linux&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Linux&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 21, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Little-endian&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Little-endian&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/LL+Chess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;LL Chess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 23, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mac+OS&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mac OS&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 25, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Macintosh&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Macintosh&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Matt+Taylor&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Matt Taylor&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 17, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Matthias+Engelbach&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Matthias Engelbach&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Memory&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Memory&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mephisto&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mephisto&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 18, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mephisto+Genius+68030&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mephisto Genius 68030&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 2, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Mephisto+Wundermaschine&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Mephisto Wundermaschine&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 2, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Milobarus&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Milobarus&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 23, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MMX&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MMX&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/MS-DOS&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;MS-DOS&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 3, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Naum&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Naum&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nero&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nero&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Nightmare+GER&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Nightmare GER&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 12, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/NUMA&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;NUMA&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 29, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/OliThink&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;OliThink&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 19, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Olivier+Poudade&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Olivier Poudade&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 16, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Oracle&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Oracle&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 4, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/P.ConNerS&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;P.ConNerS&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 22, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pandix&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pandix&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Papa&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Papa&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 11, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pascal&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pascal&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 28, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pastime&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pastime&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 3, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Paul+Hsieh&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Paul Hsieh&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 14, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Petunia&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Petunia&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 21, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Philippe+Fabiani&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Philippe Fabiani&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 15, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/PicoChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;PicoChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 12, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pioneer&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pioneer&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Population+Count&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Population Count&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 3, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/PowerPC&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;PowerPC&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 6, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Prochess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Prochess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Psycho&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Psycho&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Pulsar&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Pulsar&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Quad+Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Quad Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rabbit&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rabbit&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 5, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/RDChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;RDChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;May 3, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rebel&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rebel&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Requiem&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Requiem&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 5, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Rex&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Rex&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/RexChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;RexChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Robert+Cullum&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Robert Cullum&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Schach&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Schach&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Schach+%28US%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Schach (US)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 21, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Scid+on+the+Go&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Scid on the Go&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 26, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shared+Hash+Table&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shared Hash Table&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 11, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Shrike&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Shrike&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 30, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+and+SWAR+Techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD and SWAR Techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 27, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SIMD+techniques&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SIMD techniques&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 26, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Socrates&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Socrates&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 3, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Spector&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Spector&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 11, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 7, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE2+Instructions+to+Include&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE2 Instructions to Include&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 17, 2011&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE4&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE4&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSE5&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSE5&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jun 5, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/SSSE3&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;SSSE3&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Stack&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Stack&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 18, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Stan+Arts&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Stan Arts&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 21, 2014&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/TascBase&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;TascBase&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Terra&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Terra&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 11, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/The+King&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;The King&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 21, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Thomas+Kreitmair&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Thomas Kreitmair&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 12, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Thor%27s+Hammer&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Thor&amp;#039;s Hammer&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 23, 2013&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Titan&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Titan&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 3, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Toledo&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Toledo&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 23, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Turning+Point&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Turning Point&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 6, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/UPCCC+1992&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;UPCCC 1992&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 9, 2012&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/USOCCC+1987&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;USOCCC 1987&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Vector+Attacks&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Vector Attacks&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 15, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Warrior&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Warrior&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 23, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WCCC+1989&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WCCC 1989&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 5, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WCCC+1992&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WCCC 1992&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 26, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WCCC+1995&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WCCC 1995&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 12, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WCCC+1999&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WCCC 1999&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jul 13, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Wilhelm&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Wilhelm&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 6, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Windows&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Windows&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Nov 2, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WMCCC+1986&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WMCCC 1986&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 7, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WMCCC+1989&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WMCCC 1989&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WMCCC+1990&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WMCCC 1990&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Oct 27, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WMCCC+1991&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WMCCC 1991&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 18, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WMCCC+1993&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WMCCC 1993&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 30, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WMCCC+1995&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WMCCC 1995&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 3, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WMCCC+1996&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WMCCC 1996&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Sep 15, 2016&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WMCCC+1997&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WMCCC 1997&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Apr 4, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/WMCCC+2000&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;WMCCC 2000&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 27, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Word&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Word&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 25, 2015&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Jan 4, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/x86-64&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;x86-64&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Mar 6, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/XOP&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;XOP&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Aug 8, 2017&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/YChess&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;YChess&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Feb 25, 2018&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr class=&quot;includeBacklinksLink&quot;&gt;
      &lt;td class=&quot;includeBacklinksLinkPage&quot;&gt;
        &lt;a href=&quot;https://chessprogramming.wikispaces.com/Zugzwang+%28Program%29&quot; class=&quot;includeBacklinksLinkUrl&quot;&gt;Zugzwang (Program)&lt;/a&gt;
      &lt;/td&gt;
      &lt;td class=&quot;includeBacklinksLinkDate&quot;&gt;Dec 19, 2016&lt;/td&gt;
    &lt;/tr&gt;
      &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;&lt;!-- ws:end:WikiTextIncludeRule:00 --&gt;&lt;br /&gt;
&lt;strong&gt;&lt;a class=&quot;wiki_link&quot; href=&quot;/Hardware&quot;&gt;Up one Level&lt;/a&gt;&lt;/strong&gt;</description>
          </item>

  </channel>
</rss>