Merge "Add cpu detection for Android x86"

This commit is contained in:
Johann 2013-05-01 22:58:41 -07:00 committed by Gerrit Code Review
commit a288c928ae

View File

@ -33,7 +33,7 @@ typedef enum {
VPX_CPU_LAST VPX_CPU_LAST
} vpx_cpu_t; } vpx_cpu_t;
#if defined(__GNUC__) && __GNUC__ #if defined(__GNUC__) && __GNUC__ || defined(__ANDROID__)
#if ARCH_X86_64 #if ARCH_X86_64
#define cpuid(func,ax,bx,cx,dx)\ #define cpuid(func,ax,bx,cx,dx)\
__asm__ __volatile__ (\ __asm__ __volatile__ (\
@ -49,7 +49,7 @@ typedef enum {
: "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \ : "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \
: "a" (func)); : "a" (func));
#endif #endif
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* end __GNUC__ or __ANDROID__*/
#if ARCH_X86_64 #if ARCH_X86_64
#define cpuid(func,ax,bx,cx,dx)\ #define cpuid(func,ax,bx,cx,dx)\
asm volatile (\ asm volatile (\
@ -69,7 +69,7 @@ typedef enum {
: "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \ : "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \
: "a" (func)); : "a" (func));
#endif #endif
#else #else /* end __SUNPRO__ */
#if ARCH_X86_64 #if ARCH_X86_64
void __cpuid(int CPUInfo[4], int info_type); void __cpuid(int CPUInfo[4], int info_type);
#pragma intrinsic(__cpuid) #pragma intrinsic(__cpuid)
@ -86,7 +86,7 @@ void __cpuid(int CPUInfo[4], int info_type);
__asm mov c, ecx\ __asm mov c, ecx\
__asm mov d, edx __asm mov d, edx
#endif #endif
#endif #endif /* end others */
#define HAS_MMX 0x01 #define HAS_MMX 0x01
#define HAS_SSE 0x02 #define HAS_SSE 0x02