<?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 Insted of worring about loss in Intel® ISA Extensions</title>
    <link>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984336#M4696</link>
    <description>&lt;P&gt;Insted of worring about loss of 8 MMX registers, think about how to best&amp;nbsp;use the other half of the 16 ymm registers.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jun 2013 11:48:24 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2013-06-10T11:48:24Z</dc:date>
    <item>
      <title>Mixing AVX and MMX code</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984329#M4689</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;hope this hasn't been asked before, but I couldn't find a way to search the forum..?&lt;/P&gt;
&lt;P&gt;In high performance code I'm using MMX and SSE together, since this gives me 8 additional very valuable registers. Looking at the AVX docs, this seems no longer possible with AVX code, since all MMX-related SSE instructions have not been promoted with a VEX prefix, and are therefore legacy instructions which I may no longer use (or face the deadly mixing penalty that requires VZEROUPPER etc.).&lt;/P&gt;
&lt;P&gt;Is is correct that it's no longer possible to make heavy use of MMX registers in AVX code? &lt;/P&gt;
&lt;P&gt;Can I at least continue using MMX registers without performance impact as long as there is no data transfer between MMX and SSE registers?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Elmar&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 12:05:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984329#M4689</guid>
      <dc:creator>Elmar</dc:creator>
      <dc:date>2013-06-07T12:05:46Z</dc:date>
    </item>
    <item>
      <title>It is Not clear if you're</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984330#M4690</link>
      <description>It is Not clear if you're using assembler language ( inline in C/C++ codes ) or Intel intrinsic functions. If you're using Intel C++ compiler take a look at &lt;STRONG&gt;sse2mmx.h&lt;/STRONG&gt; header file in a &lt;STRONG&gt;..\Compiler\Include&lt;/STRONG&gt; folder.</description>
      <pubDate>Fri, 07 Jun 2013 13:13:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984330#M4690</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-06-07T13:13:11Z</dc:date>
    </item>
    <item>
      <title>Quote:Elmar wrote:</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984331#M4691</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Elmar wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;hope this hasn't been asked before, but I couldn't find a way to search the forum..?&lt;/P&gt;
&lt;P&gt;In high performance code I'm using MMX and SSE together, since this gives me 8 additional very valuable registers. Looking at the AVX docs, this seems no longer possible with AVX code, since all MMX-related SSE instructions have not been promoted with a VEX prefix, and are therefore legacy instructions which I may no longer use (or face the deadly mixing penalty that requires VZEROUPPER etc.).&lt;/P&gt;
&lt;P&gt;Is is correct that it's no longer possible to make heavy use of MMX registers in AVX code?&lt;/P&gt;
&lt;P&gt;Can I at least continue using MMX registers without performance impact as long as there is no data transfer between MMX and SSE registers?&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Elmar&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;not a direct answer to your question, sorry, but I'll strongly suggest to port your MMX code to SSE2, even if you have less logical registers than with your 8 MMX + 8 XMM &amp;nbsp;combination (or 8 MMX +&amp;nbsp;16 XMM&amp;nbsp;&amp;nbsp;in 64-bit mode) you should measure good speedups thanks to the doubled throughput, it easily offsets the fact that you have less logical registers, I have experimented just that, a long time ago&lt;/P&gt;
&lt;P&gt;then, you'll be able to compile your code (the very same source code if you use intrinsics) for&amp;nbsp;AVX, if you want the same source code for AVX2 targets (with a doubled throughput again) it will be&amp;nbsp;more challenging with intrinsics though&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 14:04:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984331#M4691</guid>
      <dc:creator>bronxzv</dc:creator>
      <dc:date>2013-06-07T14:04:00Z</dc:date>
    </item>
    <item>
      <title>Quote:Sergey Kostrov wrote:</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984332#M4692</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Sergey Kostrov wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;It is Not clear if you're using assembler language ( inline in C/C++ codes ) or Intel intrinsic functions. If you're using Intel C++ compiler take a look at &lt;STRONG&gt;sse2mmx.h&lt;/STRONG&gt; header file in a &lt;STRONG&gt;..\Compiler\Include&lt;/STRONG&gt; folder.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Many thanks for your quick reply. I'm actually using my own code generator that creates assembly code for NASM. I'm now adding code paths for AVX and AVX2, and I hoped that an Intel insider could tell me what is and is not allowed regarding MMX.&lt;/P&gt;
&lt;P&gt;For example, if I read the AVX docs correctly, the instruction MOVQ2DQ XMM0,MM0 is no longer allowed in AVX code because there is no VEX prefix version (and thus a huge penalty for mixing AVX and legacy code).&lt;/P&gt;
&lt;P&gt;If this is correct, is it at least allowed to mix MMX-only code with AVX code? (I.e. code that runs entirely in MMX registers and never transfers data to an SSE register, or goes through memory for the transfer) Or are there other hidden pitfalls?&lt;/P&gt;
&lt;P&gt;(Please don't suggest to simply stop using MMX, I'm gaining a lot of performance by using MMX for short vectors up to 8 bytes long, which would otherwise have to be spilled to memory, since my SSE/AVX registers are always full to the limit, especially in 32bit mode).&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Elmar&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 17:12:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984332#M4692</guid>
      <dc:creator>Elmar</dc:creator>
      <dc:date>2013-06-07T17:12:06Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...Please don't suggest to</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984333#M4693</link>
      <description>&amp;gt;&amp;gt;...&lt;STRONG&gt;Please don't suggest to simply stop using MMX&lt;/STRONG&gt;, I'm gaining a lot of performance by using MMX for short vectors

I support that firm position.

&amp;gt;&amp;gt;up to 8 bytes long, which would otherwise have to be spilled to memory, since my SSE/AVX registers are always full to
&amp;gt;&amp;gt;the limit, especially in 32bit mode)...

Please take a look at a very good article &lt;STRONG&gt;Avoiding AVX-SSE Transition Penalties&lt;/STRONG&gt; ( attached ). Even if it is Not related to AVX-to-MMX transitions it has lots of technical details and recommendations.</description>
      <pubDate>Sat, 08 Jun 2013 00:30:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984333#M4693</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-06-08T00:30:42Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;&gt;Is is correct that it's no</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984334#M4694</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;Is is correct that it's no longer possible to make heavy use of MMX registers in AVX code?&amp;gt;&amp;gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;I wonder if is it even possible?&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2013 07:18:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984334#M4694</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2013-06-09T07:18:29Z</dc:date>
    </item>
    <item>
      <title>Quote:iliyapolak wrote:</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984335#M4695</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;iliyapolak wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;Is is correct that it's no longer possible to make heavy use of MMX registers in AVX code?&amp;gt;&amp;gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;I wonder if is it even possible?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;there is no reason it isn't possible since only the physical registers are shared, the 8 MMX architected registers and the 16 (8 in 32-bit mode) YMM architected registers are fully separated (when modifying one kind of register&amp;nbsp;there is no side effect to a register in the other set), the transition occurs for SSE to/from AVX though, since the XMM&amp;nbsp;architected state is aliasing the YMM state (much like the MMX state is aliasing the x87 stack)&lt;/P&gt;
&lt;P&gt;based on this, I don't see&amp;nbsp;why there can be a "transition penalty" since there is actually no&amp;nbsp;transition, just like when you mix x87 code and AVX code, I know it works with no problem (no issues reported by VTune Amplifier&amp;nbsp;for example)&amp;nbsp;from hand-on experience, I suppose it's exactly the same with MMX code since the MMX&amp;nbsp;state&amp;nbsp;is aliasing the x87 state but has&amp;nbsp;no intersection with the&amp;nbsp;XMM/YMM state, but in this case I miss&amp;nbsp;first hand experience since I don't have&amp;nbsp;MMX code in my code base anymore&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2013 09:14:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984335#M4695</guid>
      <dc:creator>bronxzv</dc:creator>
      <dc:date>2013-06-09T09:14:00Z</dc:date>
    </item>
    <item>
      <title>Insted of worring about loss</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984336#M4696</link>
      <description>&lt;P&gt;Insted of worring about loss of 8 MMX registers, think about how to best&amp;nbsp;use the other half of the 16 ymm registers.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2013 11:48:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984336#M4696</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2013-06-10T11:48:24Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;&gt;Insted of worring about</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984337#M4697</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;Insted of worring about loss of 8 MMX registers, think about how to best&amp;nbsp;use the other half of the 16 ymm registers.&amp;gt;&amp;gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;Very true.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2013 12:11:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/Mixing-AVX-and-MMX-code/m-p/984337#M4697</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2013-06-10T12:11:14Z</dc:date>
    </item>
  </channel>
</rss>

