From 3224e43e250dcb45c6725fa1bdcdd0a749c38bb2 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Thu, 4 Sep 2014 00:25:19 +0000 Subject: [PATCH] Add a test that indicates the compiler is able to generate avx2 code. BUG=none TESTED=out\release_x64\libyuv_unittest --gtest_filter=libyuvTest.TestCompilerHasAVX2 R=tpsiaki@google.com Review URL: https://webrtc-codereview.appspot.com/24439004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1074 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- unit_test/cpu_test.cc | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.chromium b/README.chromium index b57517f79..c60075290 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1069 +Version: 1074 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 4ddd276fb..c6952040b 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1069 +#define LIBYUV_VERSION 1074 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/unit_test/cpu_test.cc b/unit_test/cpu_test.cc index 7f8b7485e..4eea38799 100644 --- a/unit_test/cpu_test.cc +++ b/unit_test/cpu_test.cc @@ -51,6 +51,15 @@ TEST_F(libyuvTest, TestCpuHas) { printf("Has MIPS DSPR2 %x\n", has_mips_dspr2); } +TEST_F(libyuvTest, TestCompilerHasAVX2) { +#if defined(GCC_HAS_AVX2) || defined(CLANG_HAS_AVX2) || \ + defined(VISUALC_HAS_AVX2) + printf("Has AVX2 1\n"); +#else + printf("Has AVX2 0\n"); +#endif +} + #if defined(__i386__) || defined(__x86_64__) || \ defined(_M_IX86) || defined(_M_X64) TEST_F(libyuvTest, TestCpuId) {