<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - AVX code is generated even if OS doesn't support AVX"
   href="http://llvm.org/bugs/show_bug.cgi?id=16674">16674</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>AVX code is generated even if OS doesn't support AVX
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows XP
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>a.heider@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The MSVC case in OSHasAVXSupport() in lib/Support/Host.cpp and
lib/Target/X86/X86Subtarget.cpp uses _xgetbv(_XCR_XFEATURE_ENABLED_MASK) to
detect if the OS supports saving and restoring of AVX registers on context
switches.

But this test also succeeds in vSphere and KVM guests if the host CPU supports
AVX and the extension is enabled for the guest CPU. If the guest OS doesn't
support this (everything < Windows 7 SP1), a generated AVX insn then triggers
an invalid opcode exception.

Tested this with Mesa's llvmpipe OpenGL driver on:
* LLVM 3.2 + Mesa 9.1.2
* LLVM 3.3 + Mesa 9.1.5

Both trigger said exception on a XP SP3 guest.</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>