cpu_dispatch, cpu_specific
Provides the ability to write one or
more versions of a function that execute only on a list of targeted processors
(cpu_dispatch). Provides the ability to declare that a version of a function is
targeted at particular types of processors (cpu_specific).
Syntax
Windows:
__declspec(cpu_dispatch
(
cpuid, cpuid, ...
)
)
__declspec(cpu_specific
(
cpuid
)
)
Linux:
__attribute__((cpu_dispatch
(
cpuid, cpuid, ...
)
)
)
__attribute__((cpu_specific
(
cpuid
)
)
)
Arguments
- cpuid
- Possible values are:atom: Intel® Atom™ processors with Intel® Supplemental Streaming SIMD Extensions 3 (Intel® SSSE3)atom_sse4_2: Intel® Atom™ processors with Intel® Streaming SIMD Extensions 4.2 (Intel® SSE4.2)atom_sse4_2_movbe: Intel® Atom™ processors with Intel® Streaming SIMD Extensions 4.2 (Intel® SSE4.2) with MOVBE instructions enabledbroadwell: This is a synonym forcore_5th_gen_avxcore_2nd_gen_avx: 2nd generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions (Intel® AVX)core_3rd_gen_avx: 3rd generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions (Intel® AVX) including the RDRND instructioncore_4th_gen_avx: 4th generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions 2 (Intel® AVX2) including the RDRND instructioncore_4th_gen_avx_tsx: 4th generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions 2 (Intel® AVX2) including the RDRND instruction, and support for Intel® Transactional Synchronization Extensions (Intel® TSX)core_5th_gen_avx: 5th generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions 2 (Intel® AVX2) including the RDSEED and Multi-Precision Add-Carry Instruction Extensions (ADX) instructionscore_5th_gen_avx_tsx: 5th generation Intel® Core™ processor family with support for Intel® Advanced Vector Extensions 2 (Intel® AVX2) including the RDSEED and Multi-Precision Add-Carry Instruction Extensions (ADX) instructions, and support for Intel® Transactional Synchronization Extensions (Intel® TSX)core_aes_pclmulqdq: Intel® Core™ processors with support for Advanced Encryption Standard (AES) instructions and carry-less multiplication instructioncore_i7_sse4_2: Intel® Core™ i7 processors with Intel® Streaming SIMD Extensions 4.2 (Intel® SSE4.2) instructionsgeneric: Other Intel processors for Intel® 64 architecture or compatible processors not provided by Intel Corporationhaswell: This is a synonym forcore_4th_gen_avxpentium: Intel® Pentium® processorpentium_4: Intel® Pentium® 4 processorspentium_4_sse3: Intel® Pentium® 4 processor with Intel® Streaming SIMD Extensions 3 (Intel® SSE3) instructions, Intel® Core™ Duo processors, Intel® Core™ Solo processorspentium_ii: Intel® Pentium® II processorspentium_iii: Intel® Pentium® III processorspentium_iii_no_xmm_regs: Intel® Pentium® III processors with no XMM registerspentium_m: Intel® Pentium® M processorspentium_mmx: Intel® Pentium® processors with MMX™ technologypentium_pro: Intel® Pentium® Pro processors
Description
Use the
cpu_dispatch
keyword to provide a list of targeted
processors, along with an empty function body/function stub.
Use the
cpu_specific
keyword to declare each function version
targeted at particular type of processor.
These features are available only for Intel processors
based on Intel® 64 architecture. They are not available
for non-Intel processors. Applications built using the manual processor
dispatch feature may be more highly optimized for Intel processors than for
non-Intel processors.