From 86b85db67e7fa72fa9141137ef573058cb80c184 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Mon, 19 Sep 2011 18:48:25 +0000 Subject: [PATCH] Add missing intrinsic casts for VS 2005. Allows re-enabling SSE optimization on Windows. Review URL: http://webrtc-codereview.appspot.com/161003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@623 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/audio_processing/aec/main/source/aec_rdft.h | 8 ++++++++ src/typedefs.h | 5 +---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modules/audio_processing/aec/main/source/aec_rdft.h b/src/modules/audio_processing/aec/main/source/aec_rdft.h index 5f4085bdb2..91bedc9fc7 100644 --- a/src/modules/audio_processing/aec/main/source/aec_rdft.h +++ b/src/modules/audio_processing/aec/main/source/aec_rdft.h @@ -11,6 +11,14 @@ #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_ #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC_MAIN_SOURCE_AEC_RDFT_H_ +// These intrinsics were unavailable before VS 2008. +// TODO(andrew): move to a common file. +#if defined(_MSC_VER) && _MSC_VER < 1500 +#include +static __inline __m128 _mm_castsi128_ps(__m128i a) { return *(__m128*)&a; } +static __inline __m128i _mm_castps_si128(__m128 a) { return *(__m128i*)&a; } +#endif + #ifdef _MSC_VER /* visual c++ */ # define ALIGN16_BEG __declspec(align(16)) # define ALIGN16_END diff --git a/src/typedefs.h b/src/typedefs.h index 58952336ef..ca3b509c00 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -80,10 +80,7 @@ #error Please add support for your architecture in typedefs.h #endif -// TODO(andrew): Enable on Windows. Temporarily disabled again until we can -// build on VS 2005... -//#if defined(__SSE2__) || defined(_MSC_VER) -#if defined(__SSE2__) +#if defined(__SSE2__) || defined(_MSC_VER) #define WEBRTC_USE_SSE2 #endif