<?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 CPU not executing instructions in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/CPU-not-executing-instructions/m-p/1073431#M5367</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I writing a program that should be able to read and write bytes from and to memory. To be more precise, I am trying to reach a certain average on the IntelPCM READ/WRITE counters through a C++ program. To increase the counters independently i wrote a simple function that takes a pointer and moves the byte value at the given location into a register (the value is than never used because i do not want to increase the WRITE counter at this point). The function is as follows:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;void mem_read(int8_t* read_from) 
{
    asm("mov rax, QWORD PTR [rbp-8]\n\t"
        "mov al, BYTE PTR [rax]");
}&lt;/PRE&gt;

&lt;P&gt;The problem is that it seems the CPU (Xeon E3-1230 v5) does never execute the move operation because the PCM counter for READ stays at 0. The function is called repeatedly with a fixed amount of cycles. The address is from a large array (512MB) that contains random data. Each iteration the pointer is moved 64 bytes (which should be the cache line size) plus a random amount between [0, 1024] to not have regular patterns in accessing the memory.&lt;/P&gt;

&lt;P&gt;Can the CPU determine if an instruction is in his opinion unnecessary and retire it without actually executing it? If so can this behavior be switched off somehow or do I miss an important point?&lt;/P&gt;

&lt;P&gt;I tried looking into the Software Developers Manual but could not find a functionality that would result in the described behavior or something that would point me in the right direction.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jul 2016 10:19:35 GMT</pubDate>
    <dc:creator>Norbert_S_</dc:creator>
    <dc:date>2016-07-27T10:19:35Z</dc:date>
    <item>
      <title>CPU not executing instructions</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/CPU-not-executing-instructions/m-p/1073431#M5367</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I writing a program that should be able to read and write bytes from and to memory. To be more precise, I am trying to reach a certain average on the IntelPCM READ/WRITE counters through a C++ program. To increase the counters independently i wrote a simple function that takes a pointer and moves the byte value at the given location into a register (the value is than never used because i do not want to increase the WRITE counter at this point). The function is as follows:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;void mem_read(int8_t* read_from) 
{
    asm("mov rax, QWORD PTR [rbp-8]\n\t"
        "mov al, BYTE PTR [rax]");
}&lt;/PRE&gt;

&lt;P&gt;The problem is that it seems the CPU (Xeon E3-1230 v5) does never execute the move operation because the PCM counter for READ stays at 0. The function is called repeatedly with a fixed amount of cycles. The address is from a large array (512MB) that contains random data. Each iteration the pointer is moved 64 bytes (which should be the cache line size) plus a random amount between [0, 1024] to not have regular patterns in accessing the memory.&lt;/P&gt;

&lt;P&gt;Can the CPU determine if an instruction is in his opinion unnecessary and retire it without actually executing it? If so can this behavior be switched off somehow or do I miss an important point?&lt;/P&gt;

&lt;P&gt;I tried looking into the Software Developers Manual but could not find a functionality that would result in the described behavior or something that would point me in the right direction.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2016 10:19:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/CPU-not-executing-instructions/m-p/1073431#M5367</guid>
      <dc:creator>Norbert_S_</dc:creator>
      <dc:date>2016-07-27T10:19:35Z</dc:date>
    </item>
  </channel>
</rss>

