Intrinsics.h 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
  3. /* Clang-compatible compiler, targeting x86/x86-64 */
  4. #include <x86intrin.h>
  5. #elif defined(_MSC_VER)
  6. /* Microsoft C/C++-compatible compiler */
  7. #include <intrin.h>
  8. #if _MSC_VER <= 1900
  9. #define _mm256_extract_epi64(X, Y) (((uint64_t*)&X)[Y])
  10. #endif
  11. #elif defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
  12. /* GCC-compatible compiler, targeting x86/x86-64 */
  13. #include <x86intrin.h>
  14. #elif defined(__GNUC__) && defined(__ARM_NEON__)
  15. /* GCC-compatible compiler, targeting ARM with NEON */
  16. #include <arm_neon.h>
  17. #elif defined(__GNUC__) && defined(__IWMMXT__)
  18. /* GCC-compatible compiler, targeting ARM with WMMX */
  19. #include <mmintrin.h>
  20. #elif (defined(__GNUC__) || defined(__xlC__)) && \
  21. (defined(__VEC__) || defined(__ALTIVEC__))
  22. /* XLC or GCC-compatible compiler, targeting PowerPC with VMX/VSX */
  23. #include <altivec.h>
  24. /* We need to undef those tokens defined by <altivec.h> to avoid conflicts
  25. with the C++ types. => Can still use __bool/__vector */
  26. #undef bool
  27. #undef vector
  28. #undef pixel
  29. #elif defined(__GNUC__) && defined(__SPE__)
  30. /* GCC-compatible compiler, targeting PowerPC with SPE */
  31. #include <spe.h>
  32. #endif