[LLVMdev] [PATCH] CPUID for Win64

Nicolas Capens nicolas at capens.net
Fri Apr 24 04:16:18 PDT 2009

Hi all,


Please consider applying the attached patch. Currently on Windows x86-64 the
processor features are not detected because the inline assembly (which
Visual C++ deprecated for x64) does not have an alternative that uses
intrinsics. Later tests for x86-64 then only enable SSE2, leaving any more
recent instruction set unused.


The patch uses the __cpuid intrinsic that compile under 32-bit as well as
64-bit. I've only tested it with my own experimental project on Windows x64
but I see no potential issues for other platforms. A potential additional
improvement would be to cause a compiler error when the GetCpuIDAndInfo does
not compile to the intended code, and to remove the test that follows right
after AutoDetectSubtargetFeatures() has been called.


Kind regards,



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090424/df096752/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: __cpuid.patch
Type: application/octet-stream
Size: 2951 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090424/df096752/attachment.obj>

More information about the llvm-dev mailing list