[Mesa-dev] [PATCH][RFC] mesa/main: Clamp rgba with streamed sse

Jose Fonseca jfonseca at vmware.com
Fri Oct 31 04:12:17 PDT 2014


On 31/10/14 10:13, Juha-Pekka Heikkila wrote:
>   defined(__SSE2__) && defined(__GNUC__)

Instead of duplicate this expression everywhere lets create a 
"HAVE_SSE2_INTRIN" define.  Not only this expression is complex, it will 
become even more when we updated it for MSVC.

See src/gallium/include/pipe/p_config.h:

/*
  * Processor architecture
  */

#if defined(__i386__) /* gcc */ || defined(_M_IX86) /* msvc */ || 
defined(_X86_) || defined(__386__) || defined(i386) || defined(__i386) 
/* Sun cc */
#define PIPE_ARCH_X86
#endif

#if defined(__x86_64__) /* gcc */ || defined(_M_X64) /* msvc */ || 
defined(_M_AMD64) /* msvc */ || defined(__x86_64) /* Sun cc */
#define PIPE_ARCH_X86_64
#endif

#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
#if defined(PIPE_CC_GCC) && !defined(__SSE2__)
/* #warning SSE2 support requires -msse -msse2 compiler options */
#else
#define PIPE_ARCH_SSE
#endif
#if defined(PIPE_CC_GCC) && !defined(__SSSE3__)
/* #warning SSE3 support requires -msse3 compiler options */
#else
#define PIPE_ARCH_SSSE3
#endif
#endif



I'm more than fine moving this sort of portability helpers/defines to 
mesa/src/util where it can be shared between mesa and gallium


Jose


More information about the mesa-dev mailing list