mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-01-01 03:12:16 +08:00
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 .
This commit is contained in:
parent
ce4c2fad1d
commit
1f1d140bb6
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user