#ifndef WTF_CPU_h
#define WTF_CPU_h
#include "wtf/Compiler.h"
#define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATURE)
#if defined(__i386__) \
|| defined(i386) \
|| defined(_M_IX86) \
|| defined(_X86_) \
|| defined(__THW_INTEL)
#define WTF_CPU_X86 1
#endif
#if defined(__x86_64__) \
|| defined(_M_X64)
#define WTF_CPU_X86_64 1
#define WTF_CPU_64BIT 1
#endif
#define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && defined(WTF_ARM_ARCH_VERSION) && WTF_ARM_ARCH_VERSION >= N)
#if defined(arm) \
|| defined(__arm__) \
|| defined(ARM) \
|| defined(_ARM_)
#define WTF_CPU_ARM 1
#if defined(__ARMEB__)
#define WTF_CPU_BIG_ENDIAN 1
#elif !defined(__ARM_EABI__) \
&& !defined(__EABI__) \
&& !defined(__VFP_FP__) \
&& !defined(_WIN32_WCE) \
&& !defined(ANDROID)
#define WTF_CPU_MIDDLE_ENDIAN 1
#endif
#if defined(__ARM_ARCH_4__) \
|| defined(__ARM_ARCH_4T__) \
|| defined(__MARM_ARMV4__)
#define WTF_ARM_ARCH_VERSION 4
#elif defined(__ARM_ARCH_5__) \
|| defined(__ARM_ARCH_5T__) \
|| defined(__MARM_ARMV5__)
#define WTF_ARM_ARCH_VERSION 5
#elif defined(__ARM_ARCH_5E__) \
|| defined(__ARM_ARCH_5TE__) \
|| defined(__ARM_ARCH_5TEJ__)
#define WTF_ARM_ARCH_VERSION 5
#elif defined(__ARM_ARCH_6__) \
|| defined(__ARM_ARCH_6J__) \
|| defined(__ARM_ARCH_6K__) \
|| defined(__ARM_ARCH_6Z__) \
|| defined(__ARM_ARCH_6ZK__) \
|| defined(__ARM_ARCH_6T2__) \
|| defined(__ARMV6__)
#define WTF_ARM_ARCH_VERSION 6
#elif defined(__ARM_ARCH_7A__) \
|| defined(__ARM_ARCH_7R__) \
|| defined(__ARM_ARCH_7S__)
#define WTF_ARM_ARCH_VERSION 7
#elif defined(_M_ARM)
#define WTF_ARM_ARCH_VERSION _M_ARM
#else
#define WTF_ARM_ARCH_VERSION 0
#endif
#if defined(__ARM_ARCH_4T__)
#define WTF_THUMB_ARCH_VERSION 1
#elif defined(__ARM_ARCH_5T__) \
|| defined(__ARM_ARCH_5TE__) \
|| defined(__ARM_ARCH_5TEJ__)
#define WTF_THUMB_ARCH_VERSION 2
#elif defined(__ARM_ARCH_6J__) \
|| defined(__ARM_ARCH_6K__) \
|| defined(__ARM_ARCH_6Z__) \
|| defined(__ARM_ARCH_6ZK__) \
|| defined(__ARM_ARCH_6M__)
#define WTF_THUMB_ARCH_VERSION 3
#elif defined(__ARM_ARCH_6T2__) \
|| defined(__ARM_ARCH_7__) \
|| defined(__ARM_ARCH_7A__) \
|| defined(__ARM_ARCH_7M__) \
|| defined(__ARM_ARCH_7R__) \
|| defined(__ARM_ARCH_7S__)
#define WTF_THUMB_ARCH_VERSION 4
#else
#define WTF_THUMB_ARCH_VERSION 0
#endif
#if !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2)
# if defined(thumb2) || defined(__thumb2__) \
|| ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4)
# define WTF_CPU_ARM_TRADITIONAL 0
# define WTF_CPU_ARM_THUMB2 1
# elif WTF_ARM_ARCH_AT_LEAST(4)
# define WTF_CPU_ARM_TRADITIONAL 1
# define WTF_CPU_ARM_THUMB2 0
# else
# error "Not supported ARM architecture"
# endif
#elif CPU(ARM_TRADITIONAL) && CPU(ARM_THUMB2)
# error "Cannot use both of WTF_CPU_ARM_TRADITIONAL and WTF_CPU_ARM_THUMB2 platforms"
#endif
#if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON)
#define WTF_CPU_ARM_NEON 1
#endif
#if CPU(ARM_NEON) && (!COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 7, 0))
#define HAVE_ARM_NEON_INTRINSICS 1
#endif
#if defined(__ARM_ARCH_7S__)
#define WTF_CPU_APPLE_ARMV7S 1
#endif
#if !defined(WTF_CPU_64BIT)
#define WTF_CPU_32BIT 1
#endif
#endif
#if defined(__aarch64__)
#define WTF_CPU_ARM64 1
#define WTF_CPU_64BIT 1
#endif
#endif