title: Is movndq works?
body: <p>My task is to calculate RAM Read/Write speed. 
  I using asm inserts to avoid compiler optimizations. To measure time I use TSC and CPU frequency. To move data I use asm instruction MOVNTDQ which doesn't use cache hierarchy. </p>
  
  <p>Problem is in results. Data rate (by datasheet) is 800 Mbps, and I got by my test > 2000 Mbps write speed.</p>
  
  <pre><code>void memory_notCache_write_128(void* src, long blocks_amount) 
  {
      _asm    
      {
          mov ecx, blocks_amount
          mov     esi, src
      a20:
          movntdq [esi], xmm0
          movntdq [esi + 16], xmm1
          movntdq [esi + 32], xmm2
          movntdq [esi + 48], xmm3
          movntdq [esi + 64], xmm4
          movntdq [esi + 80], xmm5
          movntdq [esi + 96], xmm6
          movntdq [esi + 112], xmm7
          add esi,  128
          loop    a20;
      }
  }
  
  int main()
  { 
      unsigned __int64 tick1, tick2;
      const long nBytes = 32*KByte;   
  
      char* source = (char*)_mm_malloc(nBytes*sizeof(char),16);
  
      tick1 =  getTicks();
      memory_notCache_write_128(source, current_times.t128);
      tick2 =  getTicks();
  
      double time = (double)(tick2-tick1)/(ProcSpeedCalc());
      cout &lt;&lt; "Time WRITE_128[seconds]:" &lt;&lt; time &lt;&lt; endl;
      cout &lt;&lt; (double) nBytes / time / MByte &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  
  <p>Datasheet of RAM, that I used - <a href="http://www.alldatasheet.com/datasheet-pdf/pdf/308537/ELPIDA/EBE11UE6ACUA-8G-E.html" rel="nofollow">http://www.alldatasheet.com/datasheet-pdf/pdf/308537/ELPIDA/EBE11UE6ACUA-8G-E.html</a></p>
  
  <p>Source code (was written for Win patform): <a href="https://bitbucket.org/closed_eyes/ram_speed_for_win/downloads/memory_test.cpp" rel="nofollow">https://bitbucket.org/closed_eyes/ram_speed_for_win/downloads/memory_test.cpp</a></p>