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

Unified Diff: media/base/vector_math_unittest.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_unittest.cc
diff --git a/media/base/vector_math_unittest.cc b/media/base/vector_math_unittest.cc
index 153378e7c0d4d3747fd4d9b989d9edd9c116cea1..e64c7c9061be5c1c2cc132e5fd3395e3e26ea15c 100644
--- a/media/base/vector_math_unittest.cc
+++ b/media/base/vector_math_unittest.cc
@@ -7,6 +7,7 @@
#include <cmath>
#include "base/command_line.h"
+#include "base/cpu.h"
#include "base/memory/aligned_memory.h"
#include "base/memory/scoped_ptr.h"
#include "base/string_number_conversions.h"
@@ -90,8 +91,9 @@ TEST_F(VectorMathTest, FMAC) {
VerifyOutput(kResult);
}
-#if defined(ARCH_CPU_X86_FAMILY) && defined(__SSE__)
+#if defined(ARCH_CPU_X86_FAMILY)
{
+ ASSERT_TRUE(base::CPU().has_sse());
SCOPED_TRACE("FMAC_SSE");
FillTestVectors(kInputFillValue, kOutputFillValue);
vector_math::FMAC_SSE(
@@ -118,7 +120,9 @@ TEST_F(VectorMathTest, FMACBenchmark) {
double total_time_c_ms = (TimeTicks::HighResNow() - start).InMillisecondsF();
printf("FMAC_C took %.2fms.\n", total_time_c_ms);
-#if defined(ARCH_CPU_X86_FAMILY) && defined(__SSE__)
+#if defined(ARCH_CPU_X86_FAMILY)
+ ASSERT_TRUE(base::CPU().has_sse());
+
// Benchmark FMAC_SSE() with unaligned size.
ASSERT_NE((kVectorSize - 1) % (vector_math::kRequiredAlignment /
sizeof(float)), 0U);

Powered by Google App Engine
This is Rietveld 408576698