Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: media/base/vector_math.cc

Issue 12478002: Break out SSE functions into new media_sse target. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix presubmit. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/vector_math.cc
diff --git a/media/base/vector_math.cc b/media/base/vector_math.cc
index edd95cd5e9c0d3b4114bf47142b097d2a37d77f2..5e640878898d82133975b23333e8f8cc63acd497 100644
--- a/media/base/vector_math.cc
+++ b/media/base/vector_math.cc
@@ -9,10 +9,6 @@
#include "base/logging.h"
#include "build/build_config.h"
-#if defined(ARCH_CPU_X86_FAMILY) && defined(__SSE__)
-#include <xmmintrin.h>
-#endif
-
namespace media {
namespace vector_math {
@@ -25,7 +21,7 @@ void FMAC(const float src[], float scale, int len, float dest[]) {
// selection thread safe.
typedef void (*VectorFMACProc)(const float src[], float scale, int len,
float dest[]);
-#if defined(ARCH_CPU_X86_FAMILY) && defined(__SSE__)
+#if defined(ARCH_CPU_X86_FAMILY)
static const VectorFMACProc kVectorFMACProc =
Mark Mentovai 2013/03/05 21:32:31 #if defined(OS_MACOSX), you can use FMAC_SSE direc
DaleCurtis 2013/03/05 21:51:37 Done w/ __SSE__.
base::CPU().has_sse() ? FMAC_SSE : FMAC_C;
#else
@@ -40,20 +36,5 @@ void FMAC_C(const float src[], float scale, int len, float dest[]) {
dest[i] += src[i] * scale;
}
-#if defined(ARCH_CPU_X86_FAMILY) && defined(__SSE__)
-void FMAC_SSE(const float src[], float scale, int len, float dest[]) {
- __m128 m_scale = _mm_set_ps1(scale);
- int rem = len % 4;
- for (int i = 0; i < len - rem; i += 4) {
- _mm_store_ps(dest + i, _mm_add_ps(_mm_load_ps(dest + i),
- _mm_mul_ps(_mm_load_ps(src + i), m_scale)));
- }
-
- // Handle any remaining values that wouldn't fit in an SSE pass.
- if (rem)
- FMAC_C(src + len - rem, scale, rem, dest + len - rem);
-}
-#endif
-
} // namespace vector_math
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698