Commit e0578d1e authored by Tom Finegan's avatar Tom Finegan

Enable build of some sse2, ssse3, and sse4.1 tests via cmake.

Applies only to the tests that require only the presence of
compiler support. Tests that require an instrinsic flag and an
enabled experiment not included.

BUG=https://bugs.chromium.org/p/aomedia/issues/detail?id=76

Change-Id: I1ba6ee80cadc3064068db04c15caf8cc2384ab3b
parent 9412ec39
......@@ -627,11 +627,6 @@ set(AOM_UNIT_TEST_SOURCES
# requires CONFIG_ADAPT_SCAN
#"${AOM_ROOT}/test/scan_test.cc"
"${AOM_ROOT}/test/simd_cmp_impl.h"
# requires the obvious assembly flavor.
#"${AOM_ROOT}/test/simd_cmp_neon.cc"
#"${AOM_ROOT}/test/simd_cmp_sse2.cc"
#"${AOM_ROOT}/test/simd_cmp_sse4.cc"
#"${AOM_ROOT}/test/simd_cmp_ssse3.cc"
"${AOM_ROOT}/test/subtract_test.cc"
"${AOM_ROOT}/test/sum_squares_test.cc"
"${AOM_ROOT}/test/superframe_test.cc"
......@@ -649,6 +644,11 @@ set(AOM_UNIT_TEST_SOURCES
"${AOM_ROOT}/test/y4m_video_source.h"
"${AOM_ROOT}/test/yuv_video_source.h")
set(AOM_UNIT_TEST_INTRIN_NEON "${AOM_ROOT}/test/simd_cmp_neon.cc")
set(AOM_UNIT_TEST_INTRIN_SSE2 "${AOM_ROOT}/test/simd_cmp_sse2.cc")
set(AOM_UNIT_TEST_INTRIN_SSSE3 "${AOM_ROOT}/test/simd_cmp_ssse3.cc")
set(AOM_UNIT_TEST_INTRIN_SSE4_1 "${AOM_ROOT}/test/simd_cmp_sse4.cc")
set(AOM_GTEST_SOURCES
"${AOM_ROOT}/third_party/googletest/src/src/gtest-all.cc"
"${AOM_ROOT}/third_party/googletest/src/include/gtest/gtest.h")
......@@ -899,6 +899,18 @@ if (CONFIG_UNIT_TESTS)
target_sources(test_libaom PUBLIC ${AOM_UNIT_TEST_WEBM_SOURCES}
$<TARGET_OBJECTS:webm>)
endif ()
if (HAVE_SSE2)
add_intrinsics_source_to_target("-msse2" "test_libaom"
"AOM_UNIT_TEST_INTRIN_SSE2")
endif ()
if (HAVE_SSSE3)
add_intrinsics_source_to_target("-mssse3" "test_libaom"
"AOM_UNIT_TEST_INTRIN_SSSE3")
endif ()
if (HAVE_SSE4_1)
add_intrinsics_source_to_target("-msse4.1" "test_libaom"
"AOM_UNIT_TEST_INTRIN_SSE4_1")
endif ()
endif ()
if (XCODE)
......
......@@ -32,6 +32,18 @@ function (add_intrinsics_object_library flag opt_name target_to_update sources)
set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} PARENT_SCOPE)
endfunction ()
# Adds sources in list named by $sources to $target and adds $flag to the
# compile flags for each source file.
function (add_intrinsics_source_to_target flag target sources)
if (MSVC)
message(FATAL_ERROR "MSVC instrinics support not implemented.")
endif ()
target_sources(${target} PUBLIC ${${sources}})
foreach (source ${${sources}})
set_property(SOURCE ${source} APPEND PROPERTY COMPILE_FLAGS ${flag})
endforeach ()
endfunction ()
# Adds build commands for ASM files in $sources and uses $asm_build_name to
# build an output directory path. Adds ASM objects to libaom directly. $sources
# must be the name of a variable containing a list of sources.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment