diff options
author | Frank Barchard <fbarchard@google.com> | 2015-11-03 16:57:40 -0800 |
---|---|---|
committer | Frank Barchard <fbarchard@google.com> | 2015-11-03 16:57:40 -0800 |
commit | 1f1d140bb6b15360219e2746f83f13f73e95169f (patch) | |
tree | 5abd13097ebe22a27a8404599565dee49e7497bf | |
parent | ce4c2fad1d71f6e4bed20e3a7e518397a44a7e04 (diff) | |
download | libyuv-1f1d140bb6b15360219e2746f83f13f73e95169f.tar.gz |
remove mips dsp detect
DSP code is not actually used, only DSPR2. Remove the detect.
TBR=harryjin@google.com
BUG=none
Review URL: https://codereview.chromium.org/1405043008 .
-rw-r--r-- | include/libyuv/cpu_id.h | 3 | ||||
-rw-r--r-- | source/cpu_id.cc | 26 | ||||
-rw-r--r-- | unit_test/cpu_test.cc | 2 |
3 files changed, 1 insertions, 30 deletions
diff --git a/include/libyuv/cpu_id.h b/include/libyuv/cpu_id.h index 64d1e741..a83edd50 100644 --- a/include/libyuv/cpu_id.h +++ b/include/libyuv/cpu_id.h @@ -41,8 +41,7 @@ static const int kCpuHasAVX3 = 0x2000; // These flags are only valid on MIPS processors. static const int kCpuHasMIPS = 0x10000; -static const int kCpuHasMIPS_DSP = 0x20000; -static const int kCpuHasMIPS_DSPR2 = 0x40000; +static const int kCpuHasMIPS_DSPR2 = 0x20000; // Internal function used to auto-init. LIBYUV_API diff --git a/source/cpu_id.cc b/source/cpu_id.cc index 42995fc8..2fdb82ab 100644 --- a/source/cpu_id.cc +++ b/source/cpu_id.cc @@ -151,27 +151,6 @@ int ArmCpuCaps(const char* cpuinfo_name) { return 0; } -#if defined(__mips__) && defined(__linux__) -static int MipsCpuCaps(const char* search_string) { - char cpuinfo_line[512]; - const char* file_name = "/proc/cpuinfo"; - FILE* f = fopen(file_name, "r"); - if (!f) { - // Assume DSP if /proc/cpuinfo is unavailable. - // This will occur for Chrome sandbox for Pepper or Render process. - return kCpuHasMIPS_DSP; - } - while (fgets(cpuinfo_line, sizeof(cpuinfo_line) - 1, f) != NULL) { - if (strstr(cpuinfo_line, search_string) != NULL) { - fclose(f); - return kCpuHasMIPS_DSP; - } - } - fclose(f); - return 0; -} -#endif - // CPU detect function for SIMD instruction sets. LIBYUV_API int cpu_info_ = 0; // cpu_info is not initialized yet. @@ -262,8 +241,6 @@ int InitCpuFlags(void) { } #endif #if defined(__mips__) && defined(__linux__) - // Linux mips parse text file for dsp detect. - cpu_info = MipsCpuCaps("dsp"); // set kCpuHasMIPS_DSP. #if defined(__mips_dspr2) cpu_info |= kCpuHasMIPS_DSPR2; #endif @@ -272,9 +249,6 @@ int InitCpuFlags(void) { if (getenv("LIBYUV_DISABLE_MIPS")) { cpu_info &= ~kCpuHasMIPS; } - if (getenv("LIBYUV_DISABLE_MIPS_DSP")) { - cpu_info &= ~kCpuHasMIPS_DSP; - } if (getenv("LIBYUV_DISABLE_MIPS_DSPR2")) { cpu_info &= ~kCpuHasMIPS_DSPR2; } diff --git a/unit_test/cpu_test.cc b/unit_test/cpu_test.cc index b084c0a1..1ec876a2 100644 --- a/unit_test/cpu_test.cc +++ b/unit_test/cpu_test.cc @@ -48,8 +48,6 @@ TEST_F(LibYUVBaseTest, TestCpuHas) { printf("Has AVX3 %x\n", has_avx3); int has_mips = TestCpuFlag(kCpuHasMIPS); printf("Has MIPS %x\n", has_mips); - int has_mips_dsp = TestCpuFlag(kCpuHasMIPS_DSP); - printf("Has MIPS DSP %x\n", has_mips_dsp); int has_mips_dspr2 = TestCpuFlag(kCpuHasMIPS_DSPR2); printf("Has MIPS DSPR2 %x\n", has_mips_dspr2); } |