47 #define Vc_ICC __INTEL_COMPILER_BUILD_DATE 56 #define Vc_CLANG (__clang_major__ * 0x10000 + __clang_minor__ * 0x100 + __clang_patchlevel__) 65 #define Vc_APPLECLANG (__clang_major__ * 0x10000 + __clang_minor__ * 0x100 + __clang_patchlevel__) 74 #define Vc_GCC (__GNUC__ * 0x10000 + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) 82 #define Vc_MSVC _MSC_FULL_VER 89 #ifdef __INTEL_COMPILER 90 #define Vc_ICC __INTEL_COMPILER_BUILD_DATE 91 #elif defined(__OPENCC__) 93 #elif defined(__clang__) && defined(__APPLE__) && __clang_major__ >= 6 95 #define Vc_APPLECLANG (__clang_major__ * 0x10000 + __clang_minor__ * 0x100 + __clang_patchlevel__) 96 #elif defined(__clang__) 97 #define Vc_CLANG (__clang_major__ * 0x10000 + __clang_minor__ * 0x100 + __clang_patchlevel__) 98 #elif defined(__GNUC__) 99 #define Vc_GCC (__GNUC__ * 0x10000 + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) 100 #elif defined(_MSC_VER) 101 #define Vc_MSVC _MSC_FULL_VER 103 #define Vc_UNSUPPORTED_COMPILER 1 106 #if __cplusplus < 201103 && (!defined Vc_MSVC || _MSC_VER < 1900) 107 # error "Vc requires support for C++11." 108 #elif __cplusplus >= 201402L 110 # if __cplusplus > 201700L 115 #if defined(__GNUC__) && !defined(Vc_NO_INLINE_ASM) 120 # define Vc_HAVE_MAX_ALIGN_T 1 121 #elif !defined(Vc_CLANG) && !defined(Vc_ICC) 123 # define Vc_HAVE_STD_MAX_ALIGN_T 1 126 #if defined(Vc_GCC) || defined(Vc_CLANG) || defined Vc_APPLECLANG 127 #define Vc_USE_BUILTIN_VECTOR_TYPES 1 131 # define Vc_CDECL __cdecl 132 # define Vc_VDECL __vectorcall 142 #define Scalar 0x00100000 143 #define SSE 0x00200000 144 #define SSE2 0x00300000 145 #define SSE3 0x00400000 146 #define SSSE3 0x00500000 147 #define SSE4_1 0x00600000 148 #define SSE4_2 0x00700000 149 #define AVX 0x00800000 150 #define AVX2 0x00900000 151 #define MIC 0x00A00000 153 #define XOP 0x00000001 154 #define FMA4 0x00000002 155 #define F16C 0x00000004 156 #define POPCNT 0x00000008 157 #define SSE4a 0x00000010 158 #define FMA 0x00000020 159 #define BMI2 0x00000040 161 #define IMPL_MASK 0xFFF00000 162 #define EXT_MASK 0x000FFFFF 176 # elif defined(_M_AMD64) 187 #if defined Vc_ICC && !defined __POPCNT__ 188 # if defined __SSE4_2__ || defined __SSE4A__ 189 # define __POPCNT__ 1 194 #error "You are using the old VC_IMPL macro. Since Vc 1.0 all Vc macros start with Vc_, i.e. a lower-case 'c'" 199 # if defined(__MIC__) 200 # define Vc_IMPL_MIC 1 201 # elif defined(__AVX2__) 202 # define Vc_IMPL_AVX2 1 203 # define Vc_IMPL_AVX 1 204 # elif defined(__AVX__) 205 # define Vc_IMPL_AVX 1 207 # if defined(__SSE4_2__) 208 # define Vc_IMPL_SSE 1 209 # define Vc_IMPL_SSE4_2 1 211 # if defined(__SSE4_1__) 212 # define Vc_IMPL_SSE 1 213 # define Vc_IMPL_SSE4_1 1 215 # if defined(__SSE3__) 216 # define Vc_IMPL_SSE 1 217 # define Vc_IMPL_SSE3 1 219 # if defined(__SSSE3__) 220 # define Vc_IMPL_SSE 1 221 # define Vc_IMPL_SSSE3 1 223 # if defined(__SSE2__) 224 # define Vc_IMPL_SSE 1 225 # define Vc_IMPL_SSE2 1 228 # if defined(Vc_IMPL_SSE) 231 # define Vc_IMPL_Scalar 1 234 # if !defined(Vc_IMPL_Scalar) 236 # define Vc_IMPL_FMA4 1 239 # define Vc_IMPL_XOP 1 242 # define Vc_IMPL_F16C 1 245 # define Vc_IMPL_POPCNT 1 248 # define Vc_IMPL_SSE4a 1 251 # define Vc_IMPL_FMA 1 254 # define Vc_IMPL_BMI2 1 260 # if (Vc_IMPL & IMPL_MASK) == MIC // MIC supersedes everything else 261 # define Vc_IMPL_MIC 1 263 # define Vc_IMPL_POPCNT 1 265 # elif (Vc_IMPL & IMPL_MASK) == AVX2 // AVX2 supersedes SSE 266 # define Vc_IMPL_AVX2 1 267 # define Vc_IMPL_AVX 1 268 # elif (Vc_IMPL & IMPL_MASK) == AVX // AVX supersedes SSE 269 # define Vc_IMPL_AVX 1 270 # elif (Vc_IMPL & IMPL_MASK) == Scalar 271 # define Vc_IMPL_Scalar 1 272 # elif (Vc_IMPL & IMPL_MASK) == SSE4_2 273 # define Vc_IMPL_SSE4_2 1 274 # define Vc_IMPL_SSE4_1 1 275 # define Vc_IMPL_SSSE3 1 276 # define Vc_IMPL_SSE3 1 277 # define Vc_IMPL_SSE2 1 278 # define Vc_IMPL_SSE 1 279 # elif (Vc_IMPL & IMPL_MASK) == SSE4_1 280 # define Vc_IMPL_SSE4_1 1 281 # define Vc_IMPL_SSSE3 1 282 # define Vc_IMPL_SSE3 1 283 # define Vc_IMPL_SSE2 1 284 # define Vc_IMPL_SSE 1 285 # elif (Vc_IMPL & IMPL_MASK) == SSSE3 286 # define Vc_IMPL_SSSE3 1 287 # define Vc_IMPL_SSE3 1 288 # define Vc_IMPL_SSE2 1 289 # define Vc_IMPL_SSE 1 290 # elif (Vc_IMPL & IMPL_MASK) == SSE3 291 # define Vc_IMPL_SSE3 1 292 # define Vc_IMPL_SSE2 1 293 # define Vc_IMPL_SSE 1 294 # elif (Vc_IMPL & IMPL_MASK) == SSE2 295 # define Vc_IMPL_SSE2 1 296 # define Vc_IMPL_SSE 1 297 # elif (Vc_IMPL & IMPL_MASK) == SSE 298 # define Vc_IMPL_SSE 1 299 # if defined(__SSE4_2__) 300 # define Vc_IMPL_SSE4_2 1 302 # if defined(__SSE4_1__) 303 # define Vc_IMPL_SSE4_1 1 305 # if defined(__SSE3__) 306 # define Vc_IMPL_SSE3 1 308 # if defined(__SSSE3__) 309 # define Vc_IMPL_SSSE3 1 311 # if defined(__SSE2__) 312 # define Vc_IMPL_SSE2 1 314 # elif (Vc_IMPL & IMPL_MASK) == 0 && (Vc_IMPL & SSE4a) 317 # define Vc_IMPL_SSE3 1 318 # define Vc_IMPL_SSE2 1 319 # define Vc_IMPL_SSE 1 322 # define Vc_IMPL_XOP 1 324 # if (Vc_IMPL & FMA4) 325 # define Vc_IMPL_FMA4 1 327 # if (Vc_IMPL & F16C) 328 # define Vc_IMPL_F16C 1 330 # if (!defined(Vc_IMPL_Scalar) && defined(__POPCNT__)) || (Vc_IMPL & POPCNT) 331 # define Vc_IMPL_POPCNT 1 333 # if (Vc_IMPL & SSE4a) 334 # define Vc_IMPL_SSE4a 1 337 # define Vc_IMPL_FMA 1 339 # if (Vc_IMPL & BMI2) 340 # define Vc_IMPL_BMI2 1 348 # define Vc_USE_VEX_CODING 1 353 # define Vc_IMPL_SSE4_2 1 354 # define Vc_IMPL_SSE4_1 1 355 # define Vc_IMPL_SSSE3 1 356 # define Vc_IMPL_SSE3 1 357 # define Vc_IMPL_SSE2 1 358 # define Vc_IMPL_SSE 1 361 #if defined(Vc_CLANG) && Vc_CLANG >= 0x30600 && Vc_CLANG < 0x30700 362 # if defined(Vc_IMPL_AVX) 363 # warning "clang 3.6.x miscompiles AVX code, frequently losing 50% of the data. Vc will fall back to SSE4 instead." 365 # if defined(Vc_IMPL_AVX2) 371 # if !defined(Vc_IMPL_Scalar) && !defined(Vc_IMPL_SSE) && !defined(Vc_IMPL_AVX) && !defined(Vc_IMPL_MIC) 372 # error "No suitable Vc implementation was selected! Probably Vc_IMPL was set to an invalid value." 373 # elif defined(Vc_IMPL_SSE) && !defined(Vc_IMPL_SSE2) 374 # error "SSE requested but no SSE2 support. Vc needs at least SSE2!" 400 #define Vc_DEFAULT_IMPL_MIC 401 #elif defined Vc_IMPL_AVX2 402 #define Vc_DEFAULT_IMPL_AVX2 403 #elif defined Vc_IMPL_AVX 404 #define Vc_DEFAULT_IMPL_AVX 405 #elif defined Vc_IMPL_SSE 406 #define Vc_DEFAULT_IMPL_SSE 407 #elif defined Vc_IMPL_Scalar 408 #define Vc_DEFAULT_IMPL_Scalar 410 #error "Preprocessor logic broken. Please report a bug." 413 #define Vc_VERSIONED_NAMESPACE Vc_1 415 namespace Vc_VERSIONED_NAMESPACE {}
416 namespace Vc = Vc_VERSIONED_NAMESPACE;
420 namespace Vc_VERSIONED_NAMESPACE
423 typedef signed char int8_t;
424 typedef unsigned char uint8_t;
425 typedef signed short int16_t;
426 typedef unsigned short uint16_t;
427 typedef signed int int32_t;
428 typedef unsigned int uint32_t;
429 typedef signed long long int64_t;
430 typedef unsigned long long uint64_t;
487 ImplementationMask = 0xfff
520 ExtraInstructionsMask = 0xfffff000u
536 return static_cast<Implementation>(Features & ImplementationMask);
541 return static_cast<unsigned int>(impl) == current();
549 return static_cast<unsigned int>(low) <= current() &&
550 static_cast<unsigned int>(high) >= current();
555 static constexpr
bool runs_on(
unsigned int extraInstructions)
557 return (extraInstructions & Features & ExtraInstructionsMask) ==
558 (Features & ExtraInstructionsMask);
568 #ifdef Vc_IMPL_Scalar 570 #elif defined(Vc_IMPL_MIC) 572 #elif defined(Vc_IMPL_AVX2) 574 #elif defined(Vc_IMPL_AVX) 576 #elif defined(Vc_IMPL_SSE4_2) 578 #elif defined(Vc_IMPL_SSE4_1) 580 #elif defined(Vc_IMPL_SSSE3) 582 #elif defined(Vc_IMPL_SSE3) 584 #elif defined(Vc_IMPL_SSE2) 596 #ifdef Vc_IMPL_POPCNT 605 #ifdef Vc_USE_VEX_CODING 614 #endif // VC_GLOBAL_H_
ExtraInstructions
The list of available instructions is not easily described by a linear list of instruction sets...
Align on boundary of page sizes (e.g.
static constexpr bool is_between(Implementation low, Implementation high)
Returns whether the current Vc::Implementation implements at least low and at most high...
Support for FMA instructions (3 operand variant)
Implementation
Enum to identify a certain SIMD instruction set.
static constexpr bool runs_on(unsigned int extraInstructions)
Returns whether the current code would run on a CPU providing extraInstructions.
This class identifies the specific implementation Vc uses in the current translation unit in terms of...
Support for BMI2 instructions.
Support for XOP instructions.
MallocAlignment
Enum that specifies the alignment and padding restrictions to use for memory allocation with Vc::mall...
Support for the population count instruction.
Support for SSE4a instructions.
static constexpr bool is(Implementation impl)
Returns whether impl is the current Vc::Implementation.
x86 SSE + SSE2 + SSE3 + SSSE3 + SSE4.1 + SSE4.2
Align on boundary of cache line sizes (e.g.
Support for ternary instruction coding (VEX)
x86 SSE + SSE2 + SSE3 + SSSE3
Support for FMA4 instructions.
Vector Classes Namespace.
static constexpr Implementation current()
Returns the currently used Vc::Implementation.
uses only fundamental types
Align on boundary of vector sizes (e.g.
Support for float16 conversions in hardware.
x86 SSE + SSE2 + SSE3 + SSSE3 + SSE4.1