Bug 522440 QCMS: Make sse/sse2 code built with Sun Studio 12 on Solaris r=jmuizelaar, ted.mielczarek

This commit is contained in:
Ginn Chen 2009-11-20 14:15:39 +08:00
parent 998ced8623
commit 8042e8805d
6 changed files with 18 additions and 5 deletions

View File

@ -362,6 +362,9 @@ endif # WINNT
ifeq ($(SOLARIS_SUNPRO_CXX),1)
CXXFLAGS += -features=extensions -D__FUNCTION__=__func__
ifeq (86,$(findstring 86,$(OS_TEST)))
OS_LDFLAGS += -M $(topsrcdir)/config/solaris_ia32.map
endif # x86
endif # Solaris Sun Studio C++
ifeq (,$(filter-out WINNT WINCE,$(HOST_OS_ARCH)))

1
config/solaris_ia32.map Normal file
View File

@ -0,0 +1 @@
hwcap_1 = OVERRIDE;

View File

@ -20,11 +20,16 @@ ifeq (86,$(findstring 86,$(OS_TEST)))
ifdef GNU_CC
SSE1_FLAGS=-msse
SSE2_FLAGS=-msse2
else
ifeq ($(SOLARIS_SUNPRO_CC),1)
SSE1_FLAGS=-xarch=sse
SSE2_FLAGS=-xarch=sse2
else
SSE1_FLAGS=
SSE2_FLAGS=
endif
endif
endif
FORCE_STATIC_LIB = 1
# This library is used by other shared libs

View File

@ -25,10 +25,10 @@
#include <assert.h>
#include "qcmsint.h"
/* for MSVC, GCC, and Intel compilers */
#if defined(_M_IX86) || defined(__i386__) || defined(_M_AMD64) || defined(__x86_64__)
/* for MSVC, GCC, Intel, and Sun compilers */
#if defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_M_AMD64) || defined(__x86_64__) || defined(__x86_64)
#define X86
#endif /* _M_IX86 || __i386__ || _M_AMD64 || __x86_64__ */
#endif /* _M_IX86 || __i386__ || __i386 || _M_AMD64 || __x86_64__ || __x86_64 */
//XXX: could use a bettername
typedef uint16_t uint16_fract_t;
@ -1062,7 +1062,7 @@ static void cpuid(uint32_t fxn, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t
*c = c_;
*d = d_;
}
#elif defined(__GNUC__) && defined(__i386__)
#elif (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(__i386__) || defined(__i386))
#define HAS_CPUID
/* Get us a CPUID function. We can't use ebx because it's the PIC register on
some platforms, so we use ESI instead and save ebx to avoid clobbering it. */
@ -1088,7 +1088,7 @@ static void cpuid(uint32_t fxn, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t
static int sse_version_available(void)
{
#if defined(__x86_64__) || defined(_M_AMD64)
#if defined(__x86_64__) || defined(__x86_64) || defined(_M_AMD64)
/* we know at build time that 64-bit CPUs always have SSE2
* this tells the compiler that non-SSE2 branches will never be
* taken (i.e. OK to optimze away the SSE1 and non-SIMD code */

View File

@ -362,6 +362,9 @@ endif # WINNT
ifeq ($(SOLARIS_SUNPRO_CXX),1)
CXXFLAGS += -features=extensions -D__FUNCTION__=__func__
ifeq (86,$(findstring 86,$(OS_TEST)))
OS_LDFLAGS += -M $(topsrcdir)/config/solaris_ia32.map
endif # x86
endif # Solaris Sun Studio C++
ifeq (,$(filter-out WINNT WINCE,$(HOST_OS_ARCH)))

View File

@ -0,0 +1 @@
hwcap_1 = OVERRIDE;