about summary refs log tree commit diff
path: root/pm_config.in.h
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-09-08 17:24:34 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-09-08 17:24:34 +0000
commitf5eb91e2b344759255b0962d177952c537e8cd32 (patch)
tree10cb76d699606e2aba77cf8ae9e659b47d0595e2 /pm_config.in.h
parent9c12bca3576ff0ec9d316199133e73285e9a59e8 (diff)
downloadnetpbm-mirror-f5eb91e2b344759255b0962d177952c537e8cd32.tar.gz
netpbm-mirror-f5eb91e2b344759255b0962d177952c537e8cd32.tar.xz
netpbm-mirror-f5eb91e2b344759255b0962d177952c537e8cd32.zip
Don't do SSE2 on Apple/Clang because it doesn't work
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1728 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'pm_config.in.h')
-rw-r--r--pm_config.in.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/pm_config.in.h b/pm_config.in.h
index 684d60a1..c8b3df05 100644
--- a/pm_config.in.h
+++ b/pm_config.in.h
@@ -242,7 +242,28 @@
    and up.
 */
 #if GCCVERSION >=402 && defined(__SSE__) && defined(__SSE2__)
+
+/* Apple, in Mac OSX 10.8, ships:
+
+   > cc --version
+     Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)
+
+   which masquerades as GCC 4.2.1, but it fails on pamflip_sse.c:
+
+     pamflip_sse.c:136:39: error: use of unknown builtin
+     '__builtin_ia32_pcmpeqb128' [-Wimplicit-function-declaration]
+     register v16qi const compare =__builtin_ia32_pcmpeqb128(vReg,zero128);
+
+   so we disable SSE2 for Apple cc.  The gcc compiler Apple ships is
+   llvm-based and also defines APPLE_CC, and it works fine, so we disable
+   SSE2 only on Clang compilers.
+*/
+#if defined(__APPLE_CC__) && defined(__clang__)
+  #define HAVE_GCC_SSE2 0
+#else
   #define HAVE_GCC_SSE2 1
+#endif
+
 #else
   #define HAVE_GCC_SSE2 0
 #endif