<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Intel c++ or c will check its in Intel® ISA Extensions</title>
    <link>https://community.intel.com/t5/Intel-ISA-Extensions/Check-arrays-for-equality-with-SIMD/m-p/1182467#M6779</link>
    <description>Intel c++ or c will check its own built-in and cstring or string.h (according to your #include) before dropping down to the vs or Linux headers.  If my crude description is misleading, I hope a compiler expert will weigh in.</description>
    <pubDate>Sun, 17 Sep 2017 21:01:00 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2017-09-17T21:01:00Z</dc:date>
    <item>
      <title>Check arrays for equality with SIMD</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Check-arrays-for-equality-with-SIMD/m-p/1182464#M6776</link>
      <description>&lt;P&gt;What's the fastest way to check 2 unsigned char arrays of indeterminate size for equality in C++?&lt;/P&gt;

&lt;P&gt;I'm using Visual Studio 2017 and Intel Compiler 2017.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 17:28:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Check-arrays-for-equality-with-SIMD/m-p/1182464#M6776</guid>
      <dc:creator>DLake1</dc:creator>
      <dc:date>2017-09-14T17:28:50Z</dc:date>
    </item>
    <item>
      <title>This seems to be a case for</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Check-arrays-for-equality-with-SIMD/m-p/1182465#M6777</link>
      <description>This seems to be a case for Intel c++ memcmp()</description>
      <pubDate>Thu, 14 Sep 2017 18:00:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Check-arrays-for-equality-with-SIMD/m-p/1182465#M6777</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2017-09-14T18:00:00Z</dc:date>
    </item>
    <item>
      <title>Thanks, how am I supposed to</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Check-arrays-for-equality-with-SIMD/m-p/1182466#M6778</link>
      <description>&lt;P&gt;Thanks, how am I supposed to know what header to include for these things?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 18:30:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Check-arrays-for-equality-with-SIMD/m-p/1182466#M6778</guid>
      <dc:creator>DLake1</dc:creator>
      <dc:date>2017-09-14T18:30:41Z</dc:date>
    </item>
    <item>
      <title>Intel c++ or c will check its</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Check-arrays-for-equality-with-SIMD/m-p/1182467#M6779</link>
      <description>Intel c++ or c will check its own built-in and cstring or string.h (according to your #include) before dropping down to the vs or Linux headers.  If my crude description is misleading, I hope a compiler expert will weigh in.</description>
      <pubDate>Sun, 17 Sep 2017 21:01:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Check-arrays-for-equality-with-SIMD/m-p/1182467#M6779</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2017-09-17T21:01:00Z</dc:date>
    </item>
    <item>
      <title>Hi Commander Lake, </title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Check-arrays-for-equality-with-SIMD/m-p/1182468#M6780</link>
      <description>&lt;P&gt;Hi Commander Lake,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You could use&amp;nbsp;&lt;SPAN class="name" style="color: rgb(0, 0, 0); font-family: &amp;quot;Oxygen Mono&amp;quot;, Monaco, monospace; font-size: 12.8px;"&gt;_mm256_mpsadbw_epu8&lt;/SPAN&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: &amp;quot;Oxygen Mono&amp;quot;, Monaco, monospace; font-size: 12.8px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;to find the sum of absolute difference of 8 quadruplets and use a&amp;nbsp;&lt;SPAN class="name" style="color: rgb(0, 0, 0); font-family: &amp;quot;Oxygen Mono&amp;quot;, Monaco, monospace; font-size: 16px;"&gt;_mm256_testz_si256&lt;/SPAN&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: &amp;quot;Oxygen Mono&amp;quot;, Monaco, monospace; font-size: 16px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;instruction to see if all the elements are zero or not, if it is nonzero , the strings are not the same.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;However in my experience, these types of code totally depends on memory access performance, try to use the memory streaming operations for better performance ( I did achieve some performance boost this way). Secondly visual studio 2017 compiler is very efficient at vectorizing this type of code so you could check the disassembly of your non vectorized code, may be it is already vectorizing for you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You could also try the string comparison instructions given in the intrinsics guide but I do not know how they perform&amp;nbsp; and remember they have only 128 bit variants.&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;A href="https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=3643,5519&amp;amp;cats=String%252520Compare" target="_blank"&gt;https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=3643,5519&amp;amp;cats=String%252520Compare&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;- Anil&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;Edit: I realize you could just read 256 bit integers and compare them instead of using those Sum of Absolute value instructions.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px;"&gt;The comparison and zero checking instructions together take around 7-10 cycles whereas the string compare instructions take 10-15 cycles even while working on 128 bits of data as seen in the instruction tables in&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;BR /&gt;
	&lt;A href="https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-optimization-manual.pdf" target="_blank"&gt;https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-optimization-manual.pdf&lt;/A&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2017 10:02:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Check-arrays-for-equality-with-SIMD/m-p/1182468#M6780</guid>
      <dc:creator>Anil_M_</dc:creator>
      <dc:date>2017-09-30T10:02:00Z</dc:date>
    </item>
  </channel>
</rss>

