<?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 Re: -=k or +=-k ? in Intel® MPI Library</title>
    <link>https://community.intel.com/t5/Intel-MPI-Library/k-or-k/m-p/930821#M2558</link>
    <description>&lt;DIV&gt;Tim, I'm not using the compiler for this one, just plain assembly.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;My question is whether the SUB requires additional uops for the 2-complement (ie performs negation and then a regular ADD), or the SUB has own silicon in the ALU.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks,&lt;/DIV&gt;
&lt;DIV&gt; Daniel.&lt;/DIV&gt;</description>
    <pubDate>Thu, 28 Oct 2004 01:42:19 GMT</pubDate>
    <dc:creator>dgutson</dc:creator>
    <dc:date>2004-10-28T01:42:19Z</dc:date>
    <item>
      <title>-=k or +=-k ?</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/k-or-k/m-p/930819#M2556</link>
      <description>&lt;DIV&gt;Hi there, sorry if this question is too easy :)&lt;/DIV&gt;
&lt;DIV&gt;Has the addition of a negative constant better or same performance than the substraction of the positive constant?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;In other words, does the ALU need to perform the ~2 or it resolves it by truth-table, so exactly the same clocktics are required?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks!&lt;/DIV&gt;
&lt;DIV&gt; Daniel.&lt;/DIV&gt;</description>
      <pubDate>Wed, 27 Oct 2004 22:18:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/k-or-k/m-p/930819#M2556</guid>
      <dc:creator>dgutson</dc:creator>
      <dc:date>2004-10-27T22:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: -=k or +=-k ?</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/k-or-k/m-p/930820#M2557</link>
      <description>This looks very hypothetical.  Since you appear to be expecting the compiler to treat both k and -k equally as constants, it's unlikely to make a difference.  I can imagine related situations where the negation might be an additional operation, or where it might pay off by enabling commutation optimizations.</description>
      <pubDate>Thu, 28 Oct 2004 01:24:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/k-or-k/m-p/930820#M2557</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2004-10-28T01:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: -=k or +=-k ?</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/k-or-k/m-p/930821#M2558</link>
      <description>&lt;DIV&gt;Tim, I'm not using the compiler for this one, just plain assembly.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;My question is whether the SUB requires additional uops for the 2-complement (ie performs negation and then a regular ADD), or the SUB has own silicon in the ALU.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks,&lt;/DIV&gt;
&lt;DIV&gt; Daniel.&lt;/DIV&gt;</description>
      <pubDate>Thu, 28 Oct 2004 01:42:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/k-or-k/m-p/930821#M2558</guid>
      <dc:creator>dgutson</dc:creator>
      <dc:date>2004-10-28T01:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: -=k or +=-k ?</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/k-or-k/m-p/930822#M2559</link>
      <description>As far as I know, the number of micro-ops, clock cycles, etc are identical in your cases.  If you're working at such a low level, and don't want to rely on documents, you ought to be able to time things and find out if there's any measurable difference.  If there isn't, why would anyone care?</description>
      <pubDate>Thu, 28 Oct 2004 02:32:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/k-or-k/m-p/930822#M2559</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2004-10-28T02:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: -=k or +=-k ?</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/k-or-k/m-p/930823#M2560</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;&lt;FONT face="Times New Roman" size="2"&gt;Dear Daniel,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Times New Roman" size="2"&gt;On the P4, instructions ADD and SUB both have a latency and throughput of 0.5cycle (executing on the ALU), which implies that no penalty is paid for subtractingvs. adding (constants or otherwise).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Times New Roman" size="2"&gt;Aart&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 28 Oct 2004 03:30:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/k-or-k/m-p/930823#M2560</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2004-10-28T03:30:36Z</dc:date>
    </item>
  </channel>
</rss>

