From f78ce4e966c07019758ce13d56ebf2cb25a70d85 Mon Sep 17 00:00:00 2001 From: riccardom Date: Sat, 19 Sep 2009 19:07:59 +0000 Subject: [PATCH] Enable sse/sse2 fast path Apply patch from cwitty to enable sse/sse2 fast path with gcc. Patch #2860351 --- desmume/src/matrix.h | 2 +- desmume/src/types.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/desmume/src/matrix.h b/desmume/src/matrix.h index a9ec857ea..9478fab4c 100644 --- a/desmume/src/matrix.h +++ b/desmume/src/matrix.h @@ -126,7 +126,7 @@ FORCEINLINE void memset_u16_le(void* dst, u16 val) T1WriteWord((u8*)&u32val,2,val); ////const __m128i temp = _mm_set_epi32(u32val,u32val,u32val,u32val); -#ifdef __INTEL_COMPILER +#if defined(__GNUC__) || defined(__INTEL_COMPILER) const __m128i temp = _mm_set_epi32(u32val,u32val,u32val,u32val); MACRODO_N(NUM/8,_mm_store_si128((__m128i*)((u8*)dst+(X)*16), temp)); #else diff --git a/desmume/src/types.h b/desmume/src/types.h index 27c6e28f6..0fc41753c 100644 --- a/desmume/src/types.h +++ b/desmume/src/types.h @@ -31,6 +31,15 @@ #define ENABLE_SSE2 #endif +#ifdef __GNUC__ +#ifdef __SSE__ +#define ENABLE_SSE +#endif +#ifdef __SSE2__ +#define ENABLE_SSE2 +#endif +#endif + #ifdef NOSSE #undef ENABLE_SSE #endif