You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

intrin.h 1.3 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef _INTRIN_H_
  2. #define _INTRIN_H_
  3. #if defined(_MSC_VER)
  4. #define BLAS_INLINE __inline
  5. #elif defined(__GNUC__)
  6. #if defined(__STRICT_ANSI__)
  7. #define BLAS_INLINE __inline__
  8. #else
  9. #define BLAS_INLINE inline
  10. #endif
  11. #else
  12. #define BLAS_INLINE
  13. #endif
  14. #ifdef _MSC_VER
  15. #define BLAS_FINLINE static __forceinline
  16. #elif defined(__GNUC__)
  17. #define BLAS_FINLINE static BLAS_INLINE __attribute__((always_inline))
  18. #else
  19. #define BLAS_FINLINE static
  20. #endif
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. // include head
  25. /** SSE **/
  26. #ifdef HAVE_SSE
  27. #include <xmmintrin.h>
  28. #endif
  29. /** SSE2 **/
  30. #ifdef HAVE_SSE2
  31. #include <emmintrin.h>
  32. #endif
  33. /** SSE3 **/
  34. #ifdef HAVE_SSE3
  35. #include <pmmintrin.h>
  36. #endif
  37. /** SSSE3 **/
  38. #ifdef HAVE_SSSE3
  39. #include <tmmintrin.h>
  40. #endif
  41. /** SSE41 **/
  42. #ifdef HAVE_SSE4_1
  43. #include <smmintrin.h>
  44. #endif
  45. /** AVX **/
  46. #ifdef HAVE_AVX
  47. #include <immintrin.h>
  48. #endif
  49. /** NEON **/
  50. #ifdef HAVE_NEON
  51. #include <arm_neon.h>
  52. #endif
  53. // distribute
  54. #if defined(HAVE_AVX512VL) || defined(HAVE_AVX512BF16)
  55. #include "intrin_avx512.h"
  56. #elif defined(HAVE_AVX2)
  57. #include "intrin_avx.h"
  58. #elif defined(HAVE_SSE2)
  59. #include "intrin_sse.h"
  60. #endif
  61. #ifdef HAVE_NEON
  62. #include "intrin_neon.h"
  63. #endif
  64. #ifndef V_SIMD
  65. #define V_SIMD 0
  66. #define V_SIMD_F64 0
  67. #endif
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71. #endif // _INTRIN_H_