http://llvm.org/bugs/show_bug.cgi?id=16674

            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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to