https://bugs.llvm.org/show_bug.cgi?id=35208

            Bug ID: 35208
           Summary: Hosts.cpp: calls xgetbv before detecting xsave support
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Support Libraries
          Assignee: unassignedb...@nondot.org
          Reporter: gonzalob...@gmail.com
                CC: llvm-bugs@lists.llvm.org

In Hosts.cpp, the following code:

   bool HasAVXSave = ((ECX >> 27) & 1) && ((ECX >> 28) & 1) &&
                      !getX86XCR0(&EAX, &EDX) && ((EAX & 0x6) == 0x6);

indirectly calls xgetbv through getX86XCR0 without checking whether the CPU
supports XSAVE before doing so. XSAVE is detected a bit after in: 

    // Only enable XSAVE if OS has enabled support for saving YMM state.
    Features["xsave"] = HasAVXSave && (ECX >> 26) & 1;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to