[LLVMbugs] [Bug 16674] New: AVX code is generated even if OS doesn't support AVX

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jul 22 10:48:02 PDT 2013


            Bug ID: 16674
           Summary: AVX code is generated even if OS doesn't support AVX
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: a.heider at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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

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.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130722/e153303d/attachment.html>

More information about the llvm-bugs mailing list