diff --git a/include/libyuv/cpu_id.h b/include/libyuv/cpu_id.h index 64d1e7418..a83edd501 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 42995fc8f..2fdb82ab0 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 b084c0a1f..1ec876a24 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); }