1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef __ASM_NEON_INTRINSICS_H 4 #define __ASM_NEON_INTRINSICS_H 5 6 #ifndef __ARM_NEON__ 7 #error You should compile this file with '-march=armv7-a -mfloat-abi=softfp -mfpu=neon' 8 #endif 9 10 #include <asm-generic/int-ll64.h> 11 12 /* 13 * The C99 types uintXX_t that are usually defined in 'stdint.h' are not as 14 * unambiguous on ARM as you would expect. For the types below, there is a 15 * difference on ARM between GCC built for bare metal ARM, GCC built for glibc 16 * and the kernel itself, which results in build errors if you try to build 17 * with -ffreestanding and include 'stdint.h' (such as when you include 18 * 'arm_neon.h' in order to use NEON intrinsics) 19 * 20 * As the typedefs for these types in 'stdint.h' are based on builtin defines 21 * supplied by GCC, we can tweak these to align with the kernel's idea of those 22 * types, so 'linux/types.h' and 'stdint.h' can be safely included from the 23 * same source file (provided that -ffreestanding is used). 24 * 25 * int32_t uint32_t intptr_t uintptr_t 26 * bare metal GCC long unsigned long int unsigned int 27 * glibc GCC int unsigned int int unsigned int 28 * kernel int unsigned int long unsigned long 29 */ 30 31 #ifdef __INT32_TYPE__ 32 #undef __INT32_TYPE__ 33 #define __INT32_TYPE__ int 34 #endif 35 36 #ifdef __UINT32_TYPE__ 37 #undef __UINT32_TYPE__ 38 #define __UINT32_TYPE__ unsigned int 39 #endif 40 41 #ifdef __INTPTR_TYPE__ 42 #undef __INTPTR_TYPE__ 43 #define __INTPTR_TYPE__ long 44 #endif 45 46 #ifdef __UINTPTR_TYPE__ 47 #undef __UINTPTR_TYPE__ 48 #define __UINTPTR_TYPE__ unsigned long 49 #endif 50 51 /* 52 * genksyms chokes on the ARM NEON instrinsics system header, but we 53 * don't export anything it defines anyway, so just disregard when 54 * genksyms execute. 55 */ 56 #ifndef __GENKSYMS__ 57 #include <arm_neon.h> 58 #endif 59 60 #endif /* __ASM_NEON_INTRINSICS_H */ 61