byteorder: allow arch to opt to use GCC intrinsics for byteswapping
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / compiler-gcc4.h
index 412bc6c2b02358bd48f87cc0d029bd753dbae613..dc16a858e77c7870ad0a103a1e50a58b636a0b64 100644 (file)
 #define __compiletime_warning(message) __attribute__((warning(message)))
 #define __compiletime_error(message) __attribute__((error(message)))
 #endif
+
+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
+#if __GNUC_MINOR__ >= 4
+#define __HAVE_BUILTIN_BSWAP32__
+#define __HAVE_BUILTIN_BSWAP64__
+#endif
+#if __GNUC_MINOR__ >= 8 || (defined(__powerpc__) && __GNUC_MINOR__ >= 6)
+#define __HAVE_BUILTIN_BSWAP16__
+#endif
+#endif