# if defined (__i386__) || defined (__x86_64__)
# define HAVE_FPU 1
-# define VLC_CPU_MMX 8
-# define VLC_CPU_3dNOW 16
-# define VLC_CPU_MMXEXT 32
-# define VLC_CPU_SSE 64
-# define VLC_CPU_SSE2 128
-# define VLC_CPU_SSE3 256
-# define VLC_CPU_SSSE3 512
-# define VLC_CPU_SSE4_1 1024
-# define VLC_CPU_SSE4_2 2048
-# define VLC_CPU_SSE4A 4096
-# define VLC_CPU_AVX 8192
-# define VLC_CPU_AVX2 16384
-# define VLC_CPU_XOP 32768
-# define VLC_CPU_FMA4 65536
+# define VLC_CPU_MMX 0x00000008
+# define VLC_CPU_3dNOW 0x00000010
+# define VLC_CPU_MMXEXT 0x00000020
+# define VLC_CPU_SSE 0x00000040
+# define VLC_CPU_SSE2 0x00000080
+# define VLC_CPU_SSE3 0x00000100
+# define VLC_CPU_SSSE3 0x00000200
+# define VLC_CPU_SSE4_1 0x00000400
+# define VLC_CPU_SSE4_2 0x00000800
+# define VLC_CPU_SSE4A 0x00001000
+# define VLC_CPU_AVX 0x00002000
+# define VLC_CPU_AVX2 0x00004000
+# define VLC_CPU_XOP 0x00008000
+# define VLC_CPU_FMA4 0x00010000
# if defined (__MMX__)
# define vlc_CPU_MMX() (1)
# define VLC_MMX
# else
# define vlc_CPU_MMX() ((vlc_CPU() & VLC_CPU_MMX) != 0)
-# if VLC_GCC_VERSION(4, 4)
+# if VLC_GCC_VERSION(4, 4) || defined(__clang__)
# define VLC_MMX __attribute__ ((__target__ ("mmx")))
# else
# define VLC_MMX VLC_MMX_is_not_implemented_on_this_compiler
# else
# define vlc_CPU_MMXEXT() ((vlc_CPU() & VLC_CPU_MMXEXT) != 0)
# define vlc_CPU_SSE() ((vlc_CPU() & VLC_CPU_SSE) != 0)
-# if VLC_GCC_VERSION(4, 4)
+# if VLC_GCC_VERSION(4, 4) || defined(__clang__)
# define VLC_SSE __attribute__ ((__target__ ("sse")))
# else
# define VLC_SSE VLC_SSE_is_not_implemented_on_this_compiler
# else
# define HAVE_FPU 0
# endif
+# define VLC_CPU_ARMv6 4
# define VLC_CPU_ARM_NEON 2
+# if defined (__ARM_ARCH_7A__)
+# define VLC_CPU_ARM_ARCH 7
+# elif defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6T2__)
+# define VLC_CPU_ARM_ARCH 6
+# else
+# define VLC_CPU_ARM_ARCH 4
+# endif
+
+# if (VLC_CPU_ARM_ARCH >= 6)
+# define vlc_CPU_ARMv6() (1)
+# else
+# define vlc_CPU_ARMv6() ((vlc_CPU() & VLC_CPU_ARMv6) != 0)
+# endif
+
# ifdef __ARM_NEON__
# define vlc_CPU_ARM_NEON() (1)
# else
# define vlc_CPU_ARM_NEON() ((vlc_CPU() & VLC_CPU_ARM_NEON) != 0)
# endif
+# elif defined (__aarch64__)
+# define HAVE_FPU 1
+
# elif defined (__sparc__)
# define HAVE_FPU 1
+# elif defined (__mips_hard_float)
+# define HAVE_FPU 1
+
# else
/**
* Are single precision floating point operations "fast"?