mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Move sse opts into contrib/intel
This commit is contained in:
parent
fb375429b5
commit
342c4eab2a
@ -83,11 +83,6 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
|
|||||||
arm/filter_neon.S arm/filter_neon_intrinsics.c
|
arm/filter_neon.S arm/filter_neon_intrinsics.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if PNG_INTEL_SSE
|
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += intel/intel_init.c\
|
|
||||||
intel/filter_sse2_intrinsics.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
|
nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
|
||||||
|
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
|
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
|
||||||
|
|||||||
35
configure.ac
35
configure.ac
@ -314,41 +314,6 @@ AM_CONDITIONAL([PNG_ARM_NEON],
|
|||||||
*) test "$enable_arm_neon" != '';;
|
*) test "$enable_arm_neon" != '';;
|
||||||
esac])
|
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]])
|
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
|
||||||
|
|
||||||
# Config files, substituting as above
|
# Config files, substituting as above
|
||||||
|
|||||||
17
contrib/intel/Makefile.am.patch
Normal file
17
contrib/intel/Makefile.am.patch
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
#
|
||||||
|
# Copyright (c) 2016 Google, Inc.
|
||||||
|
#
|
||||||
|
# This code is released under the libpng license.
|
||||||
|
# For conditions of distribution and use, see the disclaimer
|
||||||
|
# and license in png.h
|
||||||
|
#
|
||||||
|
|
||||||
|
# In order to compile Intel SSE optimizations for libpng, please add
|
||||||
|
# the following code to Makefile.am directly beneath the
|
||||||
|
# "if PNG_ARM_NEON ... endif" statement.
|
||||||
|
|
||||||
|
if PNG_INTEL_SSE
|
||||||
|
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += intel/intel_init.c\
|
||||||
|
intel/filter_sse2_intrinsics.c
|
||||||
|
endif
|
||||||
46
contrib/intel/configure.ac.patch
Normal file
46
contrib/intel/configure.ac.patch
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2016 Google, Inc.
|
||||||
|
#
|
||||||
|
# This code is released under the libpng license.
|
||||||
|
# For conditions of distribution and use, see the disclaimer
|
||||||
|
# and license in png.h
|
||||||
|
#
|
||||||
|
|
||||||
|
# In order to compile Intel SSE optimizations for libpng, please add
|
||||||
|
# the following code to configure.ac under HOST SPECIFIC OPTIONS
|
||||||
|
# directly beneath the section for ARM.
|
||||||
|
|
||||||
|
# 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])
|
||||||
@ -183,12 +183,18 @@
|
|||||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
#endif /* PNG_ARM_NEON_OPT > 0 */
|
||||||
|
|
||||||
#ifndef PNG_INTEL_SSE_OPT
|
#ifndef PNG_INTEL_SSE_OPT
|
||||||
|
# ifdef PNG_INTEL_SSE
|
||||||
|
/* Only check for SSE if the build configuration has been modified to
|
||||||
|
* enable SSE optimizations. This means that these optimizations will
|
||||||
|
* be off by default. See contrib/intel for more details.
|
||||||
|
*/
|
||||||
# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
|
# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
|
||||||
defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
|
defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
|
||||||
(defined(_M_IX86_FP) && _M_IX86_FP >= 2)
|
(defined(_M_IX86_FP) && _M_IX86_FP >= 2)
|
||||||
# define PNG_INTEL_SSE_OPT 1
|
# define PNG_INTEL_SSE_OPT 1
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if PNG_INTEL_SSE_OPT > 0
|
#if PNG_INTEL_SSE_OPT > 0
|
||||||
# ifndef PNG_INTEL_SSE_IMPLEMENTATION
|
# ifndef PNG_INTEL_SSE_IMPLEMENTATION
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user