MIPS SIMD: Always honor JSIMD_FORCE* env vars
Previously, these environment variables were not honored unless a 74K
CPU was detected, but this detection doesn't work properly with QEMU's
user mode emulation. With all other CPU types, libjpeg-turbo honors
JSIMD_FORCE* regardless of CPU detection.
diff --git a/simd/mips/jsimd.c b/simd/mips/jsimd.c
index 454cc99..790e91f 100644
--- a/simd/mips/jsimd.c
+++ b/simd/mips/jsimd.c
@@ -2,7 +2,7 @@
* jsimd_mips.c
*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
- * Copyright (C) 2009-2011, 2014, 2016, 2018, D. R. Commander.
+ * Copyright (C) 2009-2011, 2014, 2016, 2018, 2020, D. R. Commander.
* Copyright (C) 2013-2014, MIPS Technologies, Inc., California.
* Copyright (C) 2015-2016, 2018, Matthieu Darbois.
*
@@ -31,7 +31,7 @@
#if defined(__linux__)
-LOCAL(int)
+LOCAL(void)
parse_proc_cpuinfo(const char *search_string)
{
const char *file_name = "/proc/cpuinfo";
@@ -45,13 +45,12 @@
if (strstr(cpuinfo_line, search_string) != NULL) {
fclose(f);
simd_support |= JSIMD_DSPR2;
- return 1;
+ return;
}
}
fclose(f);
}
/* Did not find string in the proc file, or not Linux ELF. */
- return 0;
}
#endif
@@ -79,8 +78,7 @@
/* We still have a chance to use MIPS DSPR2 regardless of globally used
* -mdspr2 options passed to gcc by performing runtime detection via
* /proc/cpuinfo parsing on linux */
- if (!parse_proc_cpuinfo("MIPS 74K"))
- return;
+ parse_proc_cpuinfo("MIPS 74K");
#endif
#ifndef NO_GETENV