Always compile all SIMD code

Protect all SIMD implementations with the according defines and
let the compiler decide if it supports the intructions.

Linux will still use Simd_Generic because CPU feature runtime
detection is missing.
This commit is contained in:
dhewg 2011-12-13 01:06:39 +01:00
parent c17b80e950
commit 8023bc5d56
11 changed files with 17 additions and 11 deletions

View file

@ -47,7 +47,7 @@ If you have questions concerning this license or the applicable additional terms
//
//===============================================================
#if defined(MACOS_X) && defined(__ppc__)
#if defined(__GNUC__) && defined(__ALTIVEC__)
#ifdef PPC_INTRINSICS
// for square root estimate instruction

View file

@ -106,7 +106,7 @@ If you have questions concerning this license or the applicable additional terms
//#define DRAWVERT_PADDED
class idSIMD_AltiVec : public idSIMD_Generic {
#if defined(MACOS_X) && defined(__ppc__)
#if defined(__GNUC__) && defined(__ALTIVEC__)
public:
virtual const char * VPCALL GetName( void ) const;

View file

@ -39,7 +39,7 @@ If you have questions concerning this license or the applicable additional terms
//
//===============================================================
#if defined(MACOS_X) && defined(__i386__)
#if defined(__GNUC__) && defined(__MMX__)
/*
============
idSIMD_MMX::GetName

View file

@ -39,7 +39,7 @@ If you have questions concerning this license or the applicable additional terms
class idSIMD_MMX : public idSIMD_Generic {
public:
#if defined(MACOS_X) && defined(__i386__)
#if defined(__GNUC__) && defined(__MMX__)
virtual const char * VPCALL GetName( void ) const;
#elif defined(_WIN32)

View file

@ -48,7 +48,7 @@ If you have questions concerning this license or the applicable additional terms
#define DRAWVERT_TANGENT1_OFFSET (ptrdiff_t(src) - ptrdiff_t(&src->tangents[1]))
#define DRAWVERT_COLOR_OFFSET (ptrdiff_t(src) - ptrdiff_t(&src->color))
#if defined(MACOS_X) && defined(__i386__)
#if defined(__GNUC__) && defined(__SSE__)
#include <xmmintrin.h>

View file

@ -39,7 +39,7 @@ If you have questions concerning this license or the applicable additional terms
class idSIMD_SSE : public idSIMD_MMX {
public:
#if defined(MACOS_X) && defined(__i386__)
#if defined(__GNUC__) && defined(__SSE__)
virtual const char * VPCALL GetName( void ) const;
virtual void VPCALL Dot( float *dst, const idPlane &constant,const idDrawVert *src, const int count );
virtual void VPCALL MinMax( idVec3 &min, idVec3 &max, const idDrawVert *src, const int *indexes, const int count );

View file

@ -40,9 +40,9 @@ If you have questions concerning this license or the applicable additional terms
// SSE2 implementation of idSIMDProcessor
//
//===============================================================
#if defined(MACOS_X) && defined(__i386__)
#if defined(__GNUC__) && defined(__SSE2__)
#include <xmmintrin.h>
#include <emmintrin.h>
#define SHUFFLEPS( x, y, z, w ) (( (x) & 3 ) << 6 | ( (y) & 3 ) << 4 | ( (z) & 3 ) << 2 | ( (w) & 3 ))
#define R_SHUFFLEPS( x, y, z, w ) (( (w) & 3 ) << 6 | ( (z) & 3 ) << 4 | ( (y) & 3 ) << 2 | ( (x) & 3 ))

View file

@ -39,7 +39,7 @@ If you have questions concerning this license or the applicable additional terms
class idSIMD_SSE2 : public idSIMD_SSE {
public:
#if defined(MACOS_X) && defined(__i386__)
#if defined(__GNUC__) && defined(__SSE2__)
virtual const char * VPCALL GetName( void ) const;
virtual void VPCALL CmpLT( byte *dst, const byte bitNum, const float *src0, const float constant, const int count );

View file

@ -42,7 +42,7 @@ If you have questions concerning this license or the applicable additional terms
//
//===============================================================
#if defined(MACOS_X) && defined(__i386__)
#if defined(__GNUC__) && defined(__SSE3__)
/*
============

View file

@ -39,7 +39,7 @@ If you have questions concerning this license or the applicable additional terms
class idSIMD_SSE3 : public idSIMD_SSE2 {
public:
#if defined(MACOS_X) && defined(__i386__)
#if defined(__GNUC__) && defined(__SSE3__)
virtual const char * VPCALL GetName( void ) const;
#elif defined(_WIN32)

View file

@ -36,6 +36,12 @@ idlib_string = ' \
math/Rotation.cpp \
math/Simd.cpp \
math/Simd_Generic.cpp \
math/Simd_AltiVec.cpp \
math/Simd_MMX.cpp \
math/Simd_3DNow.cpp \
math/Simd_SSE.cpp \
math/Simd_SSE2.cpp \
math/Simd_SSE3.cpp \
math/Vector.cpp \
BitMsg.cpp \
LangDict.cpp \