Header files for x86 SIMD intrinsics

前端 未结 5 599
借酒劲吻你
借酒劲吻你 2020-11-28 17:17

Which header files provide the intrinsics for the different x86 SIMD instruction set extensions (MMX, SSE, AVX, ...)? It seems impossible to find such a list online. Correct

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 17:46

    On GCC/clang, if you use just

    #include 
    

    it will include all SSE/AVX headers which are enabled according to compiler switches like -march=haswell or just -march=native. Additionally some x86 specific instructions like bswap or ror become available as intrinsics.


    The MSVC equivalent of this header


    If you just want portable SIMD, use #include

    MSVC, ICC, and gcc/clang (and other compilers like Sun I think) all support this header for the SIMD intrinsics documented by Intel's only intrinsics finder / search tool: https://software.intel.com/sites/landingpage/IntrinsicsGuide/

提交回复
热议问题