aboutsummaryrefslogtreecommitdiff
path: root/files/unit_test/cpu_test.cc
diff options
context:
space:
mode:
authorFrank Barchard <fbarchard@google.com>2017-02-22 18:01:07 -0800
committerFrank Barchard <fbarchard@google.com>2017-03-06 09:54:15 -0800
commitb83bb38f0a92bedeb52baa31e515220927ef53bb (patch)
treea31c9da19db3f909cad22293ad2964d1c41c953a /files/unit_test/cpu_test.cc
parent04676c9f110180a5ae1fa259a38fab17101c6b5b (diff)
downloadlibyuv-b83bb38f0a92bedeb52baa31e515220927ef53bb.tar.gz
libyuv r1645 to fix android build warnings
r1602 under android.mk had unused parameter build warnings. The warnings were disabled. This CL fixes the source and re-enables the warning. Bug: 35099807 Test: mm for libyuv builds cleanly. Change-Id: If6b344ca39b2c321e277421cdeb817a5b1cc2514
Diffstat (limited to 'files/unit_test/cpu_test.cc')
-rw-r--r--files/unit_test/cpu_test.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/files/unit_test/cpu_test.cc b/files/unit_test/cpu_test.cc
index 0cd06f9b..048ed31a 100644
--- a/files/unit_test/cpu_test.cc
+++ b/files/unit_test/cpu_test.cc
@@ -11,10 +11,10 @@
#include <stdlib.h>
#include <string.h>
+#include "../unit_test/unit_test.h"
#include "libyuv/basic_types.h"
#include "libyuv/cpu_id.h"
#include "libyuv/version.h"
-#include "../unit_test/unit_test.h"
namespace libyuv {
@@ -45,10 +45,14 @@ TEST_F(LibYUVBaseTest, TestCpuHas) {
printf("Has FMA3 %x\n", has_fma3);
int has_avx3 = TestCpuFlag(kCpuHasAVX3);
printf("Has AVX3 %x\n", has_avx3);
+ int has_f16c = TestCpuFlag(kCpuHasF16C);
+ printf("Has F16C %x\n", has_f16c);
int has_mips = TestCpuFlag(kCpuHasMIPS);
printf("Has MIPS %x\n", has_mips);
int has_dspr2 = TestCpuFlag(kCpuHasDSPR2);
printf("Has DSPR2 %x\n", has_dspr2);
+ int has_msa = TestCpuFlag(kCpuHasMSA);
+ printf("Has MSA %x\n", has_msa);
}
TEST_F(LibYUVBaseTest, TestCpuCompilerEnabled) {
@@ -62,19 +66,20 @@ TEST_F(LibYUVBaseTest, TestCpuCompilerEnabled) {
printf("x64 build\n");
#endif
#ifdef _MSC_VER
-printf("_MSC_VER %d\n", _MSC_VER);
+ printf("_MSC_VER %d\n", _MSC_VER);
#endif
-#if !defined(LIBYUV_DISABLE_X86) && (defined(GCC_HAS_AVX2) || \
- defined(CLANG_HAS_AVX2) || defined(VISUALC_HAS_AVX2))
+#if !defined(LIBYUV_DISABLE_X86) && \
+ (defined(GCC_HAS_AVX2) || defined(CLANG_HAS_AVX2) || \
+ defined(VISUALC_HAS_AVX2))
printf("Has AVX2 1\n");
#else
printf("Has AVX2 0\n");
- // If compiler does not support AVX2, the following function not expected:
+// If compiler does not support AVX2, the following function not expected:
#endif
}
-#if defined(__i386__) || defined(__x86_64__) || \
- defined(_M_IX86) || defined(_M_X64)
+#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || \
+ defined(_M_X64)
TEST_F(LibYUVBaseTest, TestCpuId) {
int has_x86 = TestCpuFlag(kCpuHasX86);
if (has_x86) {
@@ -96,7 +101,7 @@ TEST_F(LibYUVBaseTest, TestCpuId) {
cpu_info[3] = 0;
printf("Cpu Vendor: %s %x %x %x\n", reinterpret_cast<char*>(&cpu_info[0]),
cpu_info[0], cpu_info[1], cpu_info[2]);
- EXPECT_EQ(12, strlen(reinterpret_cast<char*>(&cpu_info[0])));
+ EXPECT_EQ(12u, strlen(reinterpret_cast<char*>(&cpu_info[0])));
// CPU Family and Model
// 3:0 - Stepping
@@ -108,8 +113,8 @@ TEST_F(LibYUVBaseTest, TestCpuId) {
CpuId(1, 0, cpu_info);
int family = ((cpu_info[0] >> 8) & 0x0f) | ((cpu_info[0] >> 16) & 0xff0);
int model = ((cpu_info[0] >> 4) & 0x0f) | ((cpu_info[0] >> 12) & 0xf0);
- printf("Cpu Family %d (0x%x), Model %d (0x%x)\n", family, family,
- model, model);
+ printf("Cpu Family %d (0x%x), Model %d (0x%x)\n", family, family, model,
+ model);
}
}
#endif