about summary refs log tree commit diff
path: root/pm_config.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'pm_config.in.h')
-rw-r--r--pm_config.in.h43
1 files changed, 20 insertions, 23 deletions
diff --git a/pm_config.in.h b/pm_config.in.h
index 9459be02..fd651e3a 100644
--- a/pm_config.in.h
+++ b/pm_config.in.h
@@ -187,22 +187,14 @@
 /* CONFIGURE: GNU Compiler extensions are used in performance critical places
    when available.  Test whether they exist.
 
-   Turn off by defining NO_GCC_BUILTINS.
-
-   Note that though these influence the resulting Netpbm machine code, the
-   compiler setting ultimately decides what instruction set the compiler uses.
-   If you want a generic build, check the manual and adjust CFLAGS in
-   config.mk accordingly.
-
-   For example, if you want binaries that run on all Intel x86-32
-   family CPUs back to 80386, adding "-march=i386" to CFLAGS in
-   config.mk is much better than setting NO_GCC_BUILTINS to 1.
-   If you want to be extra sure use:
-   "-march=i386 -mno-mmx -mno-sse -DNO_GCC_BUILTINS"
-
-   Gcc uses SSE and SSE2 instructions by default for AMD/Intel x86-64.
-   Tinkering with "-mno-sse" is not recommended for these machines.  If you
-   don't want SSE code, set NO_GCC_BUILTINS to 1.
+   Prevent the build from exploiting these extensions by defining
+   NO_GCC_UNIQUE.
+
+   Before Netpbm 10.65 (December 2013), Netpbm used GCC compiler extensions
+   to generate SSE code in Pamflip.  Starting in 10.65, Netpbm instead uses
+   the more standard operators defined in <emmtrins.h>.  To prevent Netpbm
+   from explicitly using any SSE instructions, set WANT_SSE to N in
+   config.mk.
 */
 
 /*
@@ -214,7 +206,7 @@
    > 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 does not have SSE2 function
+   which masquerades as GCC 4.2.1, but it does not have SSE2 operator
    __builtin_ia32_pcmpeqb128 .
 
   On the other hand, research by Prophet of the Way in September 2012
@@ -222,18 +214,24 @@
   compiled successfully with SSE exploitation), but 3.1 does not.  He did
   not find any mention in documentation of that change.
 
+  At least some versions of Clang that do not have __builtin_ia32_pcmpeqb128
+  nonetheless have other GCC SSE2 operators, such as __builtin_ia32_pcmpgtb128.
+  We did not detect a pattern.
+
   See below on compilers other than GCC that set __GNUC__:
   http://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers
 */
-#if defined(__GNUC__) && !defined(__clang__) && !defined(NO_GCC_BUILTINS)
+#if defined(__GNUC__) && !defined(__clang__) && !defined(NO_GCC_UNIQUE)
   #define GCCVERSION __GNUC__*100 + __GNUC_MINOR__
 #else
   #define GCCVERSION 0
 #endif
 
-/* HAVE_GCC_SSE2 means the compiler has GCC builtins to directly access
-   SSE/SSE2 features.  This is different from whether the compiler generates
-   code that uses these features at all.
+/* HAVE_GCC_SSE2 means the compiler has all of the GCC-specific builtins to
+   directly access SSE/SSE2 features.  This is different from whether the
+   compiler generates code that uses these features at all.  It is also
+   different from whether the compiler has the more standard operators defined
+   in <emmintrins.h>.
 */
 
 #ifndef HAVE_GCC_SSE2
@@ -260,10 +258,9 @@
 #endif
 
 #ifndef HAVE_GCC_BSWAP
-#if GCCVERSION >=403
+#if GCCVERSION >=403 || defined(__clang__)
   #define HAVE_GCC_BSWAP 1
   /* Use __builtin_bswap32(), __builtin_bswap64() for endian conversion.
-     Available from GCC v 4.3 onward.
      NOTE: On intel CPUs this may produce the bswap operand which is not
      available on 80386. */
 #else