Vc  0.7.5-dev
SIMD Vector Classes for C++
Vc Documentation
logo.png

The Vc library is a collection of SIMD vector classes with existing implementations for SSE, AVX, and a scalar fallback. An implementation for the Intel Xeon Phi is expected to be ready for Vc 0.8.

Background information and learning material

API documentation

Per default, code compiled against the Vc headers will use the instruction set that the compiler says is available. For example compiling with "g++ -mssse3" will enable compilation against the SSE implementation using SSE the instruction sets SSE, SSE2, SSE3 and SSSE3. If you want to force compilation against a specific implementation of the vector classes you can set the macro VC_IMPL to either "Scalar", "SSE", "SSE2", "SSE3", "SSSE3", "SSE4_1", "SSE4_2", or "AVX". You may additionally append "+XOP", "+FMA4", "+SSE4a", "+F16C", and "+POPCNT", e.g. "-D VC_IMPL=SSE+XOP+FMA4" Setting VC_IMPL to "SSE" will force the SSE instruction set, but lets the headers figure out the version to use or, if that fails, uses SSE4.1. After you include a Vc header, you will have the following macros available, which you can (but normally should not) use to determine the implementation Vc uses:

  • VC_IMPL_Scalar
  • VC_IMPL_SSE (shorthand for SSE2 || SSE3 || SSSE3 || SSE4_1. SSE1 alone is not supported.)
  • VC_IMPL_SSE2
  • VC_IMPL_SSE3
  • VC_IMPL_SSSE3
  • VC_IMPL_SSE4_1
  • VC_IMPL_SSE4_2
  • VC_IMPL_AVX

Another set of macros you may use for target specific implementations are the VC_*_V_SIZE macros: Utilities