[Mesa-dev] [PATCH] util: Add cpuid for Solaris Studio.
Brian Paul
brian.e.paul at gmail.com
Mon Sep 3 07:04:23 PDT 2012
On Sat, Sep 1, 2012 at 11:41 PM, Vinson Lee <vlee at freedesktop.org> wrote:
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
> src/gallium/auxiliary/util/u_cpu_detect.c | 4 ++--
> src/gallium/include/pipe/p_config.h | 4 ++++
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c
> index e0c8f73..945f0b0 100644
> --- a/src/gallium/auxiliary/util/u_cpu_detect.c
> +++ b/src/gallium/auxiliary/util/u_cpu_detect.c
> @@ -182,7 +182,7 @@ static int has_cpuid(void)
> static INLINE void
> cpuid(uint32_t ax, uint32_t *p)
> {
> -#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)
> +#if (defined(PIPE_CC_GCC) || defined(PIPE_CC_SUNPRO)) && defined(PIPE_ARCH_X86)
> __asm __volatile (
> "xchgl %%ebx, %1\n\t"
> "cpuid\n\t"
> @@ -193,7 +193,7 @@ cpuid(uint32_t ax, uint32_t *p)
> "=d" (p[3])
> : "0" (ax)
> );
> -#elif defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86_64)
> +#elif (defined(PIPE_CC_GCC) || defined(PIPE_CC_SUNPRO)) && defined(PIPE_ARCH_X86_64)
> __asm __volatile (
> "cpuid\n\t"
> : "=a" (p[0]),
> diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h
> index d63eccd..9a09cee 100644
> --- a/src/gallium/include/pipe/p_config.h
> +++ b/src/gallium/include/pipe/p_config.h
> @@ -73,6 +73,10 @@
> #define PIPE_CC_ICL
> #endif
>
> +#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
> +#define PIPE_CC_SUNPRO
> +#endif
> +
>
> /*
> * Processor architecture
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list