[PATCH] CPUID for Win64

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,

Nicolas

__cpuid.patch (2.99 KB)

Applied, thanks!
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090420/076691.html

-Chris