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