util: Add cpuid for Solaris Studio.
authorVinson Lee <vlee@freedesktop.org>
Sat, 1 Sep 2012 06:30:35 +0000 (23:30 -0700)
committerVinson Lee <vlee@freedesktop.org>
Mon, 3 Sep 2012 19:28:07 +0000 (12:28 -0700)
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/util/u_cpu_detect.c
src/gallium/include/pipe/p_config.h

index e0c8f73c7d32d8852037d39bd3267f9dbc001465..945f0b0a91050846a189c4c5f02988ffc5f3f7d7 100644 (file)
@@ -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]),
index d63eccdc447bbeb2d16be360c935a822b9940fcf..9a09cee8fb964dcc5e890cebb1ca82cb7e1afa57 100644 (file)
 #define PIPE_CC_ICL
 #endif
 
+#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+#define PIPE_CC_SUNPRO
+#endif
+
 
 /*
  * Processor architecture