[libpng16] Moved SSE2 optimization code into the main libpng source directory.

Configure libpng with "configure --enable-intel-see" or compile
libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.
This commit is contained in:
Glenn Randers-Pehrson
2017-01-03 19:15:15 -06:00
parent 24dfd3f2d7
commit edef058e18
10 changed files with 123 additions and 367 deletions

View File

@@ -1,7 +1,7 @@
# configure.ac
# Copyright (c) 2004-2016 Glenn Randers-Pehrson
# Last changed in libpng 1.6.25 [September 1, 2016]
# Copyright (c) 2004-2017 Glenn Randers-Pehrson
# Last changed in libpng 1.6.28 [January 5, 2017]
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
@@ -391,6 +391,41 @@ AM_CONDITIONAL([PNG_MIPS_MSA],
mipsel*|mips64el*) :;;
esac])
# INTEL
# =====
#
# INTEL SSE (SIMD) support.
AC_ARG_ENABLE([intel-sse],
AS_HELP_STRING([[[--enable-intel-sse]]],
[Enable Intel SSE optimizations: =no/off, yes/on:]
[no/off: disable the optimizations;]
[yes/on: enable the optimizations.]
[If not specified: determined by the compiler.]),
[case "$enableval" in
no|off)
# disable the default enabling:
AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
[Disable Intel SSE optimizations])
# Prevent inclusion of the assembler files below:
enable_intel_sse=no;;
yes|on)
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
[Enable Intel SSE optimizations]);;
*)
AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
esac])
# Add Intel specific files to all builds where the host_cpu is Intel ('x86*')
# or where Intel optimizations were explicitly requested (this allows a
# fallback if a future host CPU does not match 'x86*')
AM_CONDITIONAL([PNG_INTEL_SSE],
[test "$enable_intel_sse" != 'no' &&
case "$host_cpu" in
i?86|x86_64) :;;
*) test "$enable_intel_sse" != '';;
esac])
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
# Config files, substituting as above