From 5765a2224946b953ec6702bd01205af475f8c80a Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Tue, 5 Apr 2016 12:33:17 -0500 Subject: [PATCH] [libpng16] Eliminate PNG_NO_INTEL_SSE_3BPP from intel INSTALL --- contrib/intel/INSTALL | 14 +++++++------- contrib/intel/filter_sse2_intrinsics.c | 8 -------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/contrib/intel/INSTALL b/contrib/intel/INSTALL index e4d56777f..f57467fe2 100644 --- a/contrib/intel/INSTALL +++ b/contrib/intel/INSTALL @@ -1,7 +1,9 @@ Enabling SSE support Copyright (c) 2016 Google, Inc. -Written by Mike Klein and Matt Sarett +Written by Mike Klein, Matt Sarett + +This INSTALL file written by Glenn Randers-Pehrson, 2016. If you have moved intel_init.c and filter_sse2_intrinsics.c to a different directory, be sure to update the '#include "../../pngpriv.h"' line in both @@ -24,26 +26,24 @@ distribution, remove any existing pre-built configure scripts: make maintainer-clean ./autogen.sh --maintainer --clean -Finally, configure libpng with -DPNG_INTEL_SSE in CPPFLAGS. If you only -want to optimize reading 4bpp images, also use -DPNG_NO_INTEL_SSE_3BPP: +Finally, configure libpng with -DPNG_INTEL_SSE in CPPFLAGS: ./autogen.sh --maintainer - CPPFLAGS="-DPNG_INTEL_SSE -DPNG_NO_INTEL_SSE_3BPP" ./configure [options] + CPPFLAGS="-DPNG_INTEL_SSE" ./configure [options] make II. Using a custom makefile: If you are using a custom makefile makefile, you will have to update it manually to include contrib/intel/*.o in the dependencies, and to define -PNG_INTEL_SSE and possibly PNG_NO_INTEL_SSE_3BPP. +PNG_INTEL_SSE. III. Using manually updated "configure" scripts: If you prefer, manually edit configure.ac and Makefile.am, following the instructions below, then follow the instructions in section II of INSTALL in the main libpng directory, then configure libpng with -DPNG_INTEL_SSE -in CPPFLAGS. If you only want to optimize reading 4bpp images, also use --DPNG_NO_INTEL_SSE_3BPP. +in CPPFLAGS. 1. Insert the following lines above the copyright line near the top of configure.ac: diff --git a/contrib/intel/filter_sse2_intrinsics.c b/contrib/intel/filter_sse2_intrinsics.c index 9de1e92d8..92dcd7e4a 100644 --- a/contrib/intel/filter_sse2_intrinsics.c +++ b/contrib/intel/filter_sse2_intrinsics.c @@ -37,7 +37,6 @@ static void store4(void* p, __m128i v) { *(int*)p = _mm_cvtsi128_si32(v); } -#ifndef PNG_NO_INTEL_SSE_3BPP static __m128i load3(const void* p) { /* We'll load 2 bytes, then 1 byte, * then mask them together, and finally load into SSE. @@ -62,9 +61,7 @@ static void store3(void* p, __m128i v) { *p01 = v012; *p2 = v012 >> 16; } -#endif -#ifndef PNG_NO_INTEL_SSE_3BPP void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row, png_const_bytep prev) { @@ -93,7 +90,6 @@ void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row, rb -= 3; } } -#endif void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row, png_const_bytep prev) @@ -116,7 +112,6 @@ void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row, } } -#ifndef PNG_NO_INTEL_SSE_3BPP void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row, png_const_bytep prev) { @@ -165,7 +160,6 @@ void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row, rb -= 3; } } -#endif void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row, png_const_bytep prev) @@ -228,7 +222,6 @@ static __m128i if_then_else(__m128i c, __m128i t, __m128i e) { #endif } -#ifndef PNG_NO_INTEL_SSE_3BPP void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row, png_const_bytep prev) { @@ -322,7 +315,6 @@ void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row, rb -= 3; } } -#endif void png_read_filter_row_paeth4_sse2(png_row_infop row_info, png_bytep row, png_const_bytep prev)