<?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 Hi James, in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Intel-Xeon-Phi-assembly-code/m-p/1118285#M74953</link>
    <description>&lt;P&gt;Hi James,&lt;/P&gt;

&lt;P&gt;Thanks for your reply. Below is the class declaration. The surfaceList is a std::vector&amp;lt;Surface&amp;lt;double&amp;gt;*&amp;gt; of pointers each pointing to a derived-class surface. Please let me know if other code snippets are necessary.&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;enum class SurfaceType
{
    SXPlane,
    SYPlane,
    SZPlane,
    SXCylinder,
    SYCylinder,
    SZCylinder,
    SSphere,
};

template&amp;lt;typename T&amp;gt;
class Surface
{
public:
    int index;
    int innerIndex;
    SurfaceType surfaceType;
    std::vector&amp;lt;int&amp;gt; positiveCellInnerIndexList; 
    std::vector&amp;lt;int&amp;gt; negativeCellInnerIndexList; 

    Sense CalculateSense(const Vector3&amp;lt;T&amp;gt;&amp;amp; position, const Vector3&amp;lt;T&amp;gt;&amp;amp; direction);
    virtual T CalculateDistance(const Vector3&amp;lt;T&amp;gt;&amp;amp; position, const Vector3&amp;lt;T&amp;gt;&amp;amp; direction, bool isCoincident) = 0;
    virtual T EvaluateSurfaceEquation(const Vector3&amp;lt;T&amp;gt;&amp;amp; position) = 0;
    virtual Vector3&amp;lt;T&amp;gt; CalculateNormal(const Vector3&amp;lt;T&amp;gt;&amp;amp; position) = 0;
    virtual size_t GetClassSize();
};

&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2016 13:59:00 GMT</pubDate>
    <dc:creator>King_Crimson</dc:creator>
    <dc:date>2016-09-01T13:59:00Z</dc:date>
    <item>
      <title>Intel Xeon Phi assembly code</title>
      <link>https://community.intel.com/t5/Software-Archive/Intel-Xeon-Phi-assembly-code/m-p/1118283#M74951</link>
      <description>&lt;P&gt;Dear experts,&lt;/P&gt;

&lt;P&gt;I'm not experienced in assembly, so I would appreciate it if you could help correlate the following assembly to the oneliner source.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;source:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;T localDistance = surfaceList[surfaceInnerIndex - 1]-&amp;gt;CalculateDistance(attr-&amp;gt;position, attr-&amp;gt;direction, isCoincident);&lt;/PRE&gt;

&lt;PRE class="brush:cpp;" style="font-size: 16.26px; line-height: 24.39px;"&gt;// each element of the surfaceList is a surface object&lt;/PRE&gt;

&lt;PRE class="brush:cpp;" style="font-size: 16.26px; line-height: 24.39px;"&gt;// &lt;SPAN style="font-size: 16.26px; line-height: 24.39px;"&gt;CalculateDistance() is a virtual function&lt;/SPAN&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;corresponding assembly:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:;"&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; movq &amp;nbsp;0x20(%r13), %r10
2 &amp;nbsp; &amp;nbsp; &amp;nbsp; movq &amp;nbsp;-0x8(%r10,%r9,8), %rdi
3 &amp;nbsp; &amp;nbsp; &amp;nbsp; lea 0x1b0(%rsp), %rsi
4 &amp;nbsp; &amp;nbsp; &amp;nbsp; movq &amp;nbsp;(%rdi), %r11 &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;
5 &amp;nbsp; &amp;nbsp; &amp;nbsp; lea 0x1c8(%rsp), %rdx
6 &amp;nbsp; &amp;nbsp; &amp;nbsp; callq &amp;nbsp;(%r11) &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;
	        
&lt;/PRE&gt;

&lt;P&gt;I understand that, for example, line 2 is copying mem[r10 - 8 + 8 * r9] to rdi, but what is the corresponding operation in the source? Thanks for any hints.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 16:59:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Intel-Xeon-Phi-assembly-code/m-p/1118283#M74951</guid>
      <dc:creator>King_Crimson</dc:creator>
      <dc:date>2016-08-31T16:59:54Z</dc:date>
    </item>
    <item>
      <title>I understand that, for</title>
      <link>https://community.intel.com/t5/Software-Archive/Intel-Xeon-Phi-assembly-code/m-p/1118284#M74952</link>
      <description>&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;I understand that, for example, line 2 is copying mem[r10 - 8 + 8 * r9] to rdi, but what is the corresponding operation in the source?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Without seeing the class declarations and a bit more of the code so that we can work out what is in which register it's a bit hard to tell, but my guess (based on the -8 offset) is that that is the load of&amp;nbsp;&lt;SPAN style="color: rgb(0, 0, 0); font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 13.008px; line-height: 14.3088px;"&gt;surfaceList[surfaceInnerIndex - 1]&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 08:25:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Intel-Xeon-Phi-assembly-code/m-p/1118284#M74952</guid>
      <dc:creator>James_C_Intel2</dc:creator>
      <dc:date>2016-09-01T08:25:39Z</dc:date>
    </item>
    <item>
      <title>Hi James,</title>
      <link>https://community.intel.com/t5/Software-Archive/Intel-Xeon-Phi-assembly-code/m-p/1118285#M74953</link>
      <description>&lt;P&gt;Hi James,&lt;/P&gt;

&lt;P&gt;Thanks for your reply. Below is the class declaration. The surfaceList is a std::vector&amp;lt;Surface&amp;lt;double&amp;gt;*&amp;gt; of pointers each pointing to a derived-class surface. Please let me know if other code snippets are necessary.&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;enum class SurfaceType
{
    SXPlane,
    SYPlane,
    SZPlane,
    SXCylinder,
    SYCylinder,
    SZCylinder,
    SSphere,
};

template&amp;lt;typename T&amp;gt;
class Surface
{
public:
    int index;
    int innerIndex;
    SurfaceType surfaceType;
    std::vector&amp;lt;int&amp;gt; positiveCellInnerIndexList; 
    std::vector&amp;lt;int&amp;gt; negativeCellInnerIndexList; 

    Sense CalculateSense(const Vector3&amp;lt;T&amp;gt;&amp;amp; position, const Vector3&amp;lt;T&amp;gt;&amp;amp; direction);
    virtual T CalculateDistance(const Vector3&amp;lt;T&amp;gt;&amp;amp; position, const Vector3&amp;lt;T&amp;gt;&amp;amp; direction, bool isCoincident) = 0;
    virtual T EvaluateSurfaceEquation(const Vector3&amp;lt;T&amp;gt;&amp;amp; position) = 0;
    virtual Vector3&amp;lt;T&amp;gt; CalculateNormal(const Vector3&amp;lt;T&amp;gt;&amp;amp; position) = 0;
    virtual size_t GetClassSize();
};

&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 13:59:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Intel-Xeon-Phi-assembly-code/m-p/1118285#M74953</guid>
      <dc:creator>King_Crimson</dc:creator>
      <dc:date>2016-09-01T13:59:00Z</dc:date>
    </item>
  </channel>
</rss>

