<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Windows: Cannot compile code that includes ppl.h with SSE2 disabled due to _mm_pause usage"
   href="https://bugs.llvm.org/show_bug.cgi?id=34079">34079</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Windows: Cannot compile code that includes ppl.h with SSE2 disabled due to _mm_pause usage
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>reupenllvm@forward.cat
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If SSE2 is disabled (/arch:IA32 in VC), with an X86 target compiling code that
includes VC header ppl.h will result in errors such as: 

       (ClCompile target) -> 
         C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\include\concrt.h(636,21): error : '_mm_pause' needs target feature sse2
[F:\foobar2000\columns_ui\ui_helpers\ui_helpers.vcxproj]
         C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\include\concrt.h(710,17): error : '_mm_pause' needs target feature sse2
[F:\foobar2000\columns_ui\ui_helpers\ui_helpers.vcxproj]

I was about to report this problem to Microsoft, but on reading the Intel and
AMD docs for the PAUSE instruction, they say (respectively):

>From <a href="https://software.intel.com/en-us/node/524249">https://software.intel.com/en-us/node/524249</a>:

Since PAUSE is backwards compatible to all existing IA-32 architecture-based
processor generations, a test for processor type (a CPUID test) is not needed.
All legacy processors execute PAUSE instruction as a NOP, but in processors
that use the PAUSE instruction as a hint there can be significant performance
benefit.

>From <a href="https://support.amd.com/TechDocs/24594.pdf">https://support.amd.com/TechDocs/24594.pdf</a>:

Processors that do not support PAUSE treat this opcode as a NOP instruction


The Microsoft compiler doesn't complain about the use of _mm_pause() with SSE2
disabled (and it generates PAUSE instructions).</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>