February, 2012

  • February 9, 2012

    Processor macros are predefined by all C/C++ compilers to enable #if/#endif sets to wrap processor-specific code, such as in-line assembly for SSE instructions on x86 processors. But there are no standards for processor macros. The same compiler may have different macros on different operating systems, and different compilers for the same processor may have different macros. This article surveys common compilers and shows how to use predefined macros to detect common desktop and server processors at compile time.

Syndicate content
Nadeau software consulting
Nadeau software consulting