[Pixman] [PATCH 08/10] Cleanups and simplifications in x86 CPU feature detection

Alan Coopersmith alan.coopersmith at oracle.com
Fri Jun 29 14:22:59 PDT 2012


On 06/29/12 01:44 PM, Søren Sandmann Pedersen wrote:
>  typedef enum
>  {
> -    NO_FEATURES = 0,
> -    MMX = 0x1,
> -    MMX_EXTENSIONS = 0x2,
> -    SSE = 0x6,
> -    SSE2 = 0x8,
> -    CMOV = 0x10
> +    X86_MMX			= (1 << 0),
> +    X86_MMX_EXTENSIONS		= (1 << 1),
> +    X86_SSE			= (1 << 2) | X86_MMX_EXTENSIONS,
> +    X86_SSE2			= (1 << 3),
> +    X86_CMOV			= (1 << 4)
>  } cpu_features_t;
>  
> +#ifdef HAVE_GETISAX
>  
> -static unsigned int
> +#include <sys/auxv.h>
> +
> +static cpu_features_t
>  detect_cpu_features (void)
>  {
> -    unsigned int features = 0;
> -    unsigned int result = 0;
> -    
> -#ifdef HAVE_GETISAX
> +    cpu_features_t features;
> +
>      if (getisax (&result, 1))
>      {
>  	if (result & AV_386_CMOV)
> @@ -69,15 +64,47 @@ detect_cpu_features (void)
>  	if (result & AV_386_SSE2)
>  	    features |= SSE2;
>      }
> +

Don't you need to update the feature flags set in the getisax code to match
the renaming you did to cpu_features_t ?

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the Pixman mailing list