[Mesa-dev] [PATCH 2/2] Remove Sun CC specific code.

Jose Fonseca jfonseca at vmware.com
Tue Dec 1 15:07:42 PST 2015


---
 include/c99_compat.h                      |  6 ------
 src/gallium/auxiliary/util/u_cpu_detect.c | 10 +++++-----
 src/gallium/include/pipe/p_compiler.h     |  6 +-----
 src/gallium/include/pipe/p_config.h       |  4 ----
 src/glsl/ir_constant_expression.cpp       |  8 --------
 src/glsl/nir/nir_constant_expressions.py  |  8 --------
 src/mapi/glapi/gen/gl_XML.py              |  6 +++---
 src/mapi/glapi/glapi.h                    |  2 +-
 src/mesa/main/compiler.h                  | 14 --------------
 src/util/macros.h                         |  2 +-
 10 files changed, 11 insertions(+), 55 deletions(-)

diff --git a/include/c99_compat.h b/include/c99_compat.h
index 4fc91bc..4be5b7e 100644
--- a/include/c99_compat.h
+++ b/include/c99_compat.h
@@ -81,8 +81,6 @@
      /* Intel compiler supports inline keyword */
 #  elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
 #    define inline __inline
-#  elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
-     /* C99 supports inline keyword */
 #  elif (__STDC_VERSION__ >= 199901L)
      /* C99 supports inline keyword */
 #  else
@@ -100,8 +98,6 @@
 #ifndef restrict
 #  if (__STDC_VERSION__ >= 199901L)
      /* C99 */
-#  elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
-     /* C99 */
 #  elif defined(__GNUC__)
 #    define restrict __restrict__
 #  elif defined(_MSC_VER)
@@ -118,8 +114,6 @@
 #ifndef __func__
 #  if (__STDC_VERSION__ >= 199901L)
      /* C99 */
-#  elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
-     /* C99 */
 #  elif defined(__GNUC__)
 #    define __func__ __FUNCTION__
 #  elif defined(_MSC_VER)
diff --git a/src/gallium/auxiliary/util/u_cpu_detect.c b/src/gallium/auxiliary/util/u_cpu_detect.c
index d1f9e97..c719d3a 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_CC_SUNPRO)) && defined(PIPE_ARCH_X86)
+#if defined(PIPE_CC_GCC) && 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_CC_SUNPRO)) && defined(PIPE_ARCH_X86_64)
+#elif defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86_64)
    __asm __volatile (
      "cpuid\n\t"
      : "=a" (p[0]),
@@ -219,7 +219,7 @@ cpuid(uint32_t ax, uint32_t *p)
 static inline void
 cpuid_count(uint32_t ax, uint32_t cx, uint32_t *p)
 {
-#if (defined(PIPE_CC_GCC) || defined(PIPE_CC_SUNPRO)) && defined(PIPE_ARCH_X86)
+#if defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86)
    __asm __volatile (
      "xchgl %%ebx, %1\n\t"
      "cpuid\n\t"
@@ -230,7 +230,7 @@ cpuid_count(uint32_t ax, uint32_t cx, uint32_t *p)
        "=d" (p[3])
      : "0" (ax), "2" (cx)
    );
-#elif (defined(PIPE_CC_GCC) || defined(PIPE_CC_SUNPRO)) && defined(PIPE_ARCH_X86_64)
+#elif defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86_64)
    __asm __volatile (
      "cpuid\n\t"
      : "=a" (p[0]),
@@ -281,7 +281,7 @@ PIPE_ALIGN_STACK static inline boolean sse2_has_daz(void)
    } PIPE_ALIGN_VAR(16) fxarea;
 
    fxarea.mxcsr_mask = 0;
-#if (defined(PIPE_CC_GCC) || defined(PIPE_CC_SUNPRO))
+#if defined(PIPE_CC_GCC)
    __asm __volatile ("fxsave %0" : "+m" (fxarea));
 #elif (defined(PIPE_CC_MSVC) && _MSC_VER >= 1700) || defined(PIPE_CC_ICL)
    /* 1700 = Visual Studio 2012 */
diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h
index 7eed570..c48a55e 100644
--- a/src/gallium/include/pipe/p_compiler.h
+++ b/src/gallium/include/pipe/p_compiler.h
@@ -132,7 +132,7 @@ typedef unsigned char boolean;
 
 
 /* Macros for data alignment. */
-#if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) || defined(__SUNPRO_CC)
+#if defined(__GNUC__)
 
 /* See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Type-Attributes.html */
 #define PIPE_ALIGN_TYPE(_alignment, _type) _type __attribute__((aligned(_alignment)))
@@ -178,10 +178,6 @@ void _ReadWriteBarrier(void);
 #pragma intrinsic(_ReadWriteBarrier)
 #define PIPE_READ_WRITE_BARRIER() _ReadWriteBarrier()
 
-#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-
-#define PIPE_READ_WRITE_BARRIER() __machine_rw_barrier()
-
 #else
 
 #warning "Unsupported compiler"
diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h
index ac14f86..0b570c7 100644
--- a/src/gallium/include/pipe/p_config.h
+++ b/src/gallium/include/pipe/p_config.h
@@ -77,10 +77,6 @@
 #define PIPE_CC_ICL
 #endif
 
-#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-#define PIPE_CC_SUNPRO
-#endif
-
 
 /*
  * Processor architecture
diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
index 67ed360..ef70585 100644
--- a/src/glsl/ir_constant_expression.cpp
+++ b/src/glsl/ir_constant_expression.cpp
@@ -41,14 +41,6 @@
 #include "glsl_types.h"
 #include "program/hash_table.h"
 
-#if defined(__SUNPRO_CC) && !defined(isnormal)
-#include <ieeefp.h>
-static int isnormal(double x)
-{
-   return fpclass(x) == FP_NORMAL;
-}
-#endif
-
 static float
 dot_f(ir_constant *op0, ir_constant *op1)
 {
diff --git a/src/glsl/nir/nir_constant_expressions.py b/src/glsl/nir/nir_constant_expressions.py
index b16ef50..32784f6 100644
--- a/src/glsl/nir/nir_constant_expressions.py
+++ b/src/glsl/nir/nir_constant_expressions.py
@@ -32,14 +32,6 @@ template = """\
 #include "util/half_float.h"
 #include "nir_constant_expressions.h"
 
-#if defined(__SUNPRO_CC)
-#include <ieeefp.h>
-static int isnormal(double x)
-{
-   return fpclass(x) == FP_NORMAL;
-}
-#endif
-
 /**
  * Evaluate one component of packSnorm4x8.
  */
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index 67aba81..2e7123e 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -183,7 +183,7 @@ class gl_print_base(object):
         The name is also added to the file's undef_list.
         """
         self.undef_list.append("PURE")
-        print """#  if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+        print """#  if defined(__GNUC__)
 #    define PURE __attribute__((pure))
 #  else
 #    define PURE
@@ -223,7 +223,7 @@ class gl_print_base(object):
         """
 
         self.undef_list.append(S)
-        print """#  if (defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) && defined(__ELF__))
+        print """#  if defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
 #    define %s  __attribute__((visibility("%s")))
 #  else
 #    define %s
@@ -243,7 +243,7 @@ class gl_print_base(object):
         """
 
         self.undef_list.append("NOINLINE")
-        print """#  if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+        print """#  if defined(__GNUC__)
 #    define NOINLINE __attribute__((noinline))
 #  else
 #    define NOINLINE
diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h
index 673295b..f269b17 100644
--- a/src/mapi/glapi/glapi.h
+++ b/src/mapi/glapi/glapi.h
@@ -61,7 +61,7 @@ extern "C" {
 #    else
 #      define _GLAPI_EXPORT __declspec(dllimport)
 #    endif
-#  elif defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+#  elif defined(__GNUC__)
 #    define _GLAPI_EXPORT __attribute__((visibility("default")))
 #  else
 #    define _GLAPI_EXPORT
diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h
index 93b4e6f..c5ee741 100644
--- a/src/mesa/main/compiler.h
+++ b/src/mesa/main/compiler.h
@@ -47,20 +47,6 @@ extern "C" {
 
 
 /**
-  * Sun compilers define __i386 instead of the gcc-style __i386__
- */
-#ifdef __SUNPRO_C
-# if !defined(__i386__) && defined(__i386)
-#  define __i386__
-# elif !defined(__amd64__) && defined(__amd64)
-#  define __amd64__
-# elif !defined(__sparc__) && defined(__sparc)
-#  define __sparc__
-# endif
-#endif
-
-
-/**
  * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN, and CPU_TO_LE32.
  * Do not use these unless absolutely necessary!
  * Try to use a runtime test instead.
diff --git a/src/util/macros.h b/src/util/macros.h
index 5014b91..0c8958f 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -186,7 +186,7 @@ do {                       \
  * inline a static function that we later use in an alias. - ajax
  */
 #ifndef PUBLIC
-#  if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+#  if defined(__GNUC__)
 #    define PUBLIC __attribute__((visibility("default")))
 #    define USED __attribute__((used))
 #  elif defined(_MSC_VER)
-- 
2.5.0



More information about the mesa-dev mailing list