Boost logo

Boost :

Subject: Re: [boost] [GSoC] SIMD proposal
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-03-24 08:07:42


On 24/03/2011 01:16, Gruenke, Matt wrote:
> cpuid? It seems to me that the *only* thing that should determine how the program gets compiled is the compiler flags, since the target platform might have either less or more capability than the build machine. I've experienced both cases, firsthand.
>
> GCC will define the following preprocessor macros, depending on which code generation flags you specify:
>
> __MMX__
> __SSE__
> __SSE2__
> __SSE3__
> __SSSE3__
> __SSE4A__
> __SSE4_1__
> __SSE4_2__
> __AES__
> __PCLMUL__
> __AVX__

Alright, I just looked into how other compilers do it.

On GCC, SSEx built-ins are only available if the suitable -mssex option
is set, which you can detect with __SSEx__.
On MSVC, SSE built-ins are always available but may result in a runtime
error. There are only the /arch:SSE and /arch:AVX option used to tell
the compiler that it can generate SSE or AVX instructions automatically,
there are no /arch:SSEx options.

Therefore there is no way to do the kind of thing you suggest with MSVC.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk