]> granicus.if.org Git - libjpeg-turbo/commitdiff
Add environment variables to force MMX/SSE2 code path selection
authorDRC <dcommander@users.sourceforge.net>
Fri, 3 Apr 2009 11:27:17 +0000 (11:27 +0000)
committerDRC <dcommander@users.sourceforge.net>
Fri, 3 Apr 2009 11:27:17 +0000 (11:27 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@34 632fc199-4ca6-4c93-a231-07263d6284db

jsimd.c

diff --git a/jsimd.c b/jsimd.c
index 32489116021fe9dd51b077d62eb7390c8278dc20..7f81ddad34870016ee51ed211095da3d7a6dba46 100644 (file)
--- a/jsimd.c
+++ b/jsimd.c
@@ -40,11 +40,18 @@ static unsigned int simd_support = ~0;
 LOCAL(void)
 init_simd (void)
 {
+#ifdef WITH_SIMD
+  char *env = NULL;
+#endif
   if (simd_support != ~0)
     return;
 
 #ifdef WITH_SIMD
   simd_support = jpeg_simd_cpu_support();
+  if((env=getenv("JSIMD_FORCEMMX"))!=NULL && !strcmp(env, "1"))
+    simd_support = JSIMD_MMX;
+  else if((env=getenv("JSIMD_FORCESSE2"))!=NULL && !strcmp(env, "1"))
+    simd_support = JSIMD_SSE2;
 #else
   simd_support = JSIMD_NONE;
 #endif