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 defined Vc_GCC && Vc_GCC >= 0x60000 107 #define Vc_RESET_DIAGNOSTICS _Pragma("GCC diagnostic pop") 108 #pragma GCC diagnostic push 109 #pragma GCC diagnostic ignored "-Wignored-attributes" 111 #define Vc_RESET_DIAGNOSTICS 114 #if __cplusplus < 201103 && (!defined Vc_MSVC || _MSC_VER < 1900) 115 # error "Vc requires support for C++11." 116 #elif __cplusplus >= 201402L 118 # if __cplusplus > 201700L 123 #if defined(__GNUC__) && !defined(Vc_NO_INLINE_ASM) 128 # define Vc_HAVE_MAX_ALIGN_T 1 129 #elif !defined(Vc_CLANG) && !defined(Vc_ICC) 131 # define Vc_HAVE_STD_MAX_ALIGN_T 1 134 #if defined(Vc_GCC) || defined(Vc_CLANG) || defined Vc_APPLECLANG 135 #define Vc_USE_BUILTIN_VECTOR_TYPES 1 139 # define Vc_CDECL __cdecl 140 # define Vc_VDECL __vectorcall 150 #define Scalar 0x00100000 151 #define SSE 0x00200000 152 #define SSE2 0x00300000 153 #define SSE3 0x00400000 154 #define SSSE3 0x00500000 155 #define SSE4_1 0x00600000 156 #define SSE4_2 0x00700000 157 #define AVX 0x00800000 158 #define AVX2 0x00900000 159 #define MIC 0x00A00000 161 #define XOP 0x00000001 162 #define FMA4 0x00000002 163 #define F16C 0x00000004 164 #define POPCNT 0x00000008 165 #define SSE4a 0x00000010 166 #define FMA 0x00000020 167 #define BMI2 0x00000040 169 #define IMPL_MASK 0xFFF00000 170 #define EXT_MASK 0x000FFFFF 184 # elif defined(_M_AMD64) 195 #if defined Vc_ICC && !defined __POPCNT__ 196 # if defined __SSE4_2__ || defined __SSE4A__ 197 # define __POPCNT__ 1 202 #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'" 207 # if defined(__MIC__) 208 # define Vc_IMPL_MIC 1 209 # elif defined(__AVX2__) 210 # define Vc_IMPL_AVX2 1 211 # define Vc_IMPL_AVX 1 212 # elif defined(__AVX__) 213 # define Vc_IMPL_AVX 1 215 # if defined(__SSE4_2__) 216 # define Vc_IMPL_SSE 1 217 # define Vc_IMPL_SSE4_2 1 219 # if defined(__SSE4_1__) 220 # define Vc_IMPL_SSE 1 221 # define Vc_IMPL_SSE4_1 1 223 # if defined(__SSE3__) 224 # define Vc_IMPL_SSE 1 225 # define Vc_IMPL_SSE3 1 227 # if defined(__SSSE3__) 228 # define Vc_IMPL_SSE 1 229 # define Vc_IMPL_SSSE3 1 231 # if defined(__SSE2__) 232 # define Vc_IMPL_SSE 1 233 # define Vc_IMPL_SSE2 1 236 # if defined(Vc_IMPL_SSE) 239 # define Vc_IMPL_Scalar 1 242 # if !defined(Vc_IMPL_Scalar) 244 # define Vc_IMPL_FMA4 1 247 # define Vc_IMPL_XOP 1 250 # define Vc_IMPL_F16C 1 253 # define Vc_IMPL_POPCNT 1 256 # define Vc_IMPL_SSE4a 1 259 # define Vc_IMPL_FMA 1 262 # define Vc_IMPL_BMI2 1 268 # if (Vc_IMPL & IMPL_MASK) == MIC // MIC supersedes everything else 269 # define Vc_IMPL_MIC 1 271 # define Vc_IMPL_POPCNT 1 273 # elif (Vc_IMPL & IMPL_MASK) == AVX2 // AVX2 supersedes SSE 274 # define Vc_IMPL_AVX2 1 275 # define Vc_IMPL_AVX 1 276 # elif (Vc_IMPL & IMPL_MASK) == AVX // AVX supersedes SSE 277 # define Vc_IMPL_AVX 1 278 # elif (Vc_IMPL & IMPL_MASK) == Scalar 279 # define Vc_IMPL_Scalar 1 280 # elif (Vc_IMPL & IMPL_MASK) == SSE4_2 281 # define Vc_IMPL_SSE4_2 1 282 # define Vc_IMPL_SSE4_1 1 283 # define Vc_IMPL_SSSE3 1 284 # define Vc_IMPL_SSE3 1 285 # define Vc_IMPL_SSE2 1 286 # define Vc_IMPL_SSE 1 287 # elif (Vc_IMPL & IMPL_MASK) == SSE4_1 288 # define Vc_IMPL_SSE4_1 1 289 # define Vc_IMPL_SSSE3 1 290 # define Vc_IMPL_SSE3 1 291 # define Vc_IMPL_SSE2 1 292 # define Vc_IMPL_SSE 1 293 # elif (Vc_IMPL & IMPL_MASK) == SSSE3 294 # define Vc_IMPL_SSSE3 1 295 # define Vc_IMPL_SSE3 1 296 # define Vc_IMPL_SSE2 1 297 # define Vc_IMPL_SSE 1 298 # elif (Vc_IMPL & IMPL_MASK) == SSE3 299 # define Vc_IMPL_SSE3 1 300 # define Vc_IMPL_SSE2 1 301 # define Vc_IMPL_SSE 1 302 # elif (Vc_IMPL & IMPL_MASK) == SSE2 303 # define Vc_IMPL_SSE2 1 304 # define Vc_IMPL_SSE 1 305 # elif (Vc_IMPL & IMPL_MASK) == SSE 306 # define Vc_IMPL_SSE 1 307 # if defined(__SSE4_2__) 308 # define Vc_IMPL_SSE4_2 1 310 # if defined(__SSE4_1__) 311 # define Vc_IMPL_SSE4_1 1 313 # if defined(__SSE3__) 314 # define Vc_IMPL_SSE3 1 316 # if defined(__SSSE3__) 317 # define Vc_IMPL_SSSE3 1 319 # if defined(__SSE2__) 320 # define Vc_IMPL_SSE2 1 322 # elif (Vc_IMPL & IMPL_MASK) == 0 && (Vc_IMPL & SSE4a) 325 # define Vc_IMPL_SSE3 1 326 # define Vc_IMPL_SSE2 1 327 # define Vc_IMPL_SSE 1 330 # define Vc_IMPL_XOP 1 332 # if (Vc_IMPL & FMA4) 333 # define Vc_IMPL_FMA4 1 335 # if (Vc_IMPL & F16C) 336 # define Vc_IMPL_F16C 1 338 # if (!defined(Vc_IMPL_Scalar) && defined(__POPCNT__)) || (Vc_IMPL & POPCNT) 339 # define Vc_IMPL_POPCNT 1 341 # if (Vc_IMPL & SSE4a) 342 # define Vc_IMPL_SSE4a 1 345 # define Vc_IMPL_FMA 1 347 # if (Vc_IMPL & BMI2) 348 # define Vc_IMPL_BMI2 1 356 # define Vc_USE_VEX_CODING 1 361 # define Vc_IMPL_SSE4_2 1 362 # define Vc_IMPL_SSE4_1 1 363 # define Vc_IMPL_SSSE3 1 364 # define Vc_IMPL_SSE3 1 365 # define Vc_IMPL_SSE2 1 366 # define Vc_IMPL_SSE 1 369 #if defined(Vc_CLANG) && Vc_CLANG >= 0x30600 && Vc_CLANG < 0x30700 370 # if defined(Vc_IMPL_AVX) 371 # warning "clang 3.6.x miscompiles AVX code, frequently losing 50% of the data. Vc will fall back to SSE4 instead." 373 # if defined(Vc_IMPL_AVX2) 379 # if !defined(Vc_IMPL_Scalar) && !defined(Vc_IMPL_SSE) && !defined(Vc_IMPL_AVX) && !defined(Vc_IMPL_MIC) 380 # error "No suitable Vc implementation was selected! Probably Vc_IMPL was set to an invalid value." 381 # elif defined(Vc_IMPL_SSE) && !defined(Vc_IMPL_SSE2) 382 # error "SSE requested but no SSE2 support. Vc needs at least SSE2!" 408 #define Vc_DEFAULT_IMPL_MIC 409 #elif defined Vc_IMPL_AVX2 410 #define Vc_DEFAULT_IMPL_AVX2 411 #elif defined Vc_IMPL_AVX 412 #define Vc_DEFAULT_IMPL_AVX 413 #elif defined Vc_IMPL_SSE 414 #define Vc_DEFAULT_IMPL_SSE 415 #elif defined Vc_IMPL_Scalar 416 #define Vc_DEFAULT_IMPL_Scalar 418 #error "Preprocessor logic broken. Please report a bug." 421 #define Vc_VERSIONED_NAMESPACE Vc_1 423 namespace Vc_VERSIONED_NAMESPACE {}
424 namespace Vc = Vc_VERSIONED_NAMESPACE;
428 namespace Vc_VERSIONED_NAMESPACE
431 typedef signed char int8_t;
432 typedef unsigned char uint8_t;
433 typedef signed short int16_t;
434 typedef unsigned short uint16_t;
435 typedef signed int int32_t;
436 typedef unsigned int uint32_t;
437 typedef signed long long int64_t;
438 typedef unsigned long long uint64_t;
495 ImplementationMask = 0xfff
528 ExtraInstructionsMask = 0xfffff000u
544 return static_cast<Implementation>(Features & ImplementationMask);
549 return static_cast<unsigned int>(impl) == current();
557 return static_cast<unsigned int>(low) <= current() &&
558 static_cast<unsigned int>(high) >= current();
563 static constexpr
bool runs_on(
unsigned int extraInstructions)
565 return (extraInstructions & Features & ExtraInstructionsMask) ==
566 (Features & ExtraInstructionsMask);
576 #ifdef Vc_IMPL_Scalar 578 #elif defined(Vc_IMPL_MIC) 580 #elif defined(Vc_IMPL_AVX2) 582 #elif defined(Vc_IMPL_AVX) 584 #elif defined(Vc_IMPL_SSE4_2) 586 #elif defined(Vc_IMPL_SSE4_1) 588 #elif defined(Vc_IMPL_SSSE3) 590 #elif defined(Vc_IMPL_SSE3) 592 #elif defined(Vc_IMPL_SSE2) 604 #ifdef Vc_IMPL_POPCNT 613 #ifdef Vc_USE_VEX_CODING 622 #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