From 6b85c685f6b4a4d63e62319587c362682b1de42a Mon Sep 17 00:00:00 2001 From: giraffedata Date: Fri, 17 Apr 2015 03:17:30 +0000 Subject: Release 10.70.02 git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2463 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- GNUmakefile | 4 ++-- common.mk | 2 -- doc/HISTORY | 10 ++++++++++ doc/TESTS | 2 +- editor/pamflip/config.h | 7 +++++++ editor/pamflip/pamflip.c | 11 ++--------- editor/pamflip/pamflip_sse.c | 9 +++++++-- pm_config.in.h | 14 ++++++++++++++ version.mk | 2 +- 9 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 editor/pamflip/config.h diff --git a/GNUmakefile b/GNUmakefile index 1e933347..2e624aa0 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -387,9 +387,9 @@ install.lib: endif .PHONY: install.manwebmain -install.manwebmain: $(PKGDIR)/man/web/netpbm.url $(PKGDIR)/bin/doc.url +install.manwebmain: $(PKGDIR)/$(PKGMANDIR)/web/netpbm.url $(PKGDIR)/bin/doc.url -$(PKGDIR)/man/web/netpbm.url: $(PKGDIR)/man/web +$(PKGDIR)/$(PKGMANDIR)/web/netpbm.url: $(PKGDIR)/$(PKGMANDIR)/web echo "$(NETPBM_DOCURL)" > $@ chmod $(INSTALL_PERM_MAN) $@ diff --git a/common.mk b/common.mk index 48c63c69..97413530 100644 --- a/common.mk +++ b/common.mk @@ -515,8 +515,6 @@ install.man: install.man1 install.man3 install.man5 \ MANUALS1 = $(BINARIES) $(SCRIPTS) -PKGMANDIR = man - install.man1: $(MANUALS1:%=%_installman1) install.man3: $(MANUALS3:%=%_installman3) diff --git a/doc/HISTORY b/doc/HISTORY index db9c0421..c3e27537 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -4,6 +4,16 @@ Netpbm. CHANGE HISTORY -------------- +15.04.17 BJH Release 10.70.02 + + Fix typo in doc/TESTS. + + Build: work around bug in GCC < 4.2 related to SSE2 builtins + that causes compile of pamflip to fail. + + Build: fix 'make package' where config.mk sets a subdirectory + other than 'man' for the manual. + 15.04.05 BJH Release 10.70.01 ppmtoarbtxt: fix bug: wrong output when high numbers represent diff --git a/doc/TESTS b/doc/TESTS index 7b62a841..9352b207 100644 --- a/doc/TESTS +++ b/doc/TESTS @@ -267,7 +267,7 @@ target, for example pre-compiled binaries distributed in .rpm or .deb format. If PBM_TESTPREFIX is explicitly set to a directory that contains programs from such a source, you should expect multiple failures due to missing programs, missing features, etc. If -PBM_TEXTPREFIX is set to "" (null), the outcome will depend heavily +PBM_TESTPREFIX is set to "" (null), the outcome will depend heavily on what version has precedence in PATH. Netpbm distributed with Debian or Ubuntu is called "Netpbm-Free" and diff --git a/editor/pamflip/config.h b/editor/pamflip/config.h new file mode 100644 index 00000000..42aefb6e --- /dev/null +++ b/editor/pamflip/config.h @@ -0,0 +1,7 @@ +#ifndef SSE_PBM_XY_FLIP + #if WANT_SSE && HAVE_WORKING_SSE2 + #define SSE_PBM_XY_FLIP 1 + #else + #define SSE_PBM_XY_FLIP 0 + #endif +#endif diff --git a/editor/pamflip/pamflip.c b/editor/pamflip/pamflip.c index ade05601..149ab310 100644 --- a/editor/pamflip/pamflip.c +++ b/editor/pamflip/pamflip.c @@ -72,19 +72,12 @@ #include "nstring.h" #include "bitreverse.h" +#include "config.h" /* Defines SSE_PBM_XY_FLIP */ #include "flip.h" #include "pamflip_sse.h" enum xformType {LEFTRIGHT, TOPBOTTOM, TRANSPOSE}; -#ifndef SIMD_PBM_TRANSPOSITION - #if WANT_SSE && defined(__SSE2__) - #define SIMD_PBM_TRANSPOSITION 1 - #else - #define SIMD_PBM_TRANSPOSITION 0 - #endif -#endif - static void parseXformOpt(const char * const xformOpt, unsigned int * const xformCountP, @@ -1149,7 +1142,7 @@ transformPbm(struct pam * const inpamP, /* This is a column-for-row type of transformation, which requires complex traversal of an in-memory image. */ - if (SIMD_PBM_TRANSPOSITION == 1) + if (SSE_PBM_XY_FLIP) pamflip_transformRowsToColumnsPbmSse(inpamP, outpamP, xform); else transformPbmGen(inpamP, outpamP, xform); diff --git a/editor/pamflip/pamflip_sse.c b/editor/pamflip/pamflip_sse.c index eccbe965..e0929f65 100644 --- a/editor/pamflip/pamflip_sse.c +++ b/editor/pamflip/pamflip_sse.c @@ -24,6 +24,7 @@ #include "mallocvar.h" #include "pam.h" +#include "config.h" /* Defines SSE_PBM_XY_FLIP */ #include "flip.h" #include "pamflip_sse.h" @@ -32,7 +33,7 @@ (i.e. exists). */ -#if WANT_SSE && defined(__SSE2__) +#if SSE_PBM_XY_FLIP /*---------------------------------------------------------------------------- This is a specialized routine for row-for-column PBM transformations. @@ -59,7 +60,11 @@ As an enhancement, we clear the output raster to zero (=white) in the beginning and flip only the 8x16 blocks that contain non-zero bits (=any amount of black pixels). When we add padding to the edges, we initialize - it all to zero to prevent unnecessary transpositions. + it all to zero to prevent unnecessary transpositions. Because most + real-world documents are largely white, this saves much execution time. If + you are porting this code to an environment in which non-zero bits are the + majority, for example, BMP where zero means black, you should seriously + consider modifying this. All instructions unique to GCC/SSE are in transpose16Bitrows(). It is possible to write a non-SSE version by providing a generic diff --git a/pm_config.in.h b/pm_config.in.h index c64fc093..9d0dc303 100644 --- a/pm_config.in.h +++ b/pm_config.in.h @@ -240,6 +240,20 @@ #endif #endif +#ifndef HAVE_WORKING_SSE2 +#if defined(__SSE2__) && ( GCCVERSION >=402 || defined(__clang__) ) + #define HAVE_WORKING_SSE2 1 + /* We can use SSE2 builtin functions to exploit SSE2 instructions. GCC + version 4.2 or newer is required; older GCC ostensibly has these SSE2 + builtins, but the compiler aborts with an error. Note that __SSE2__ + means not only that the compiler has the capability, but that the user + has not disabled it via compiler options. + */ +#else + #define HAVE_WORKING_SSE2 0 +#endif +#endif + /* UNALIGNED_OK means it's OK to do unaligned memory access, e.g. loading an 8-byte word from an address that is not a multiple of 8. On some systems, such an access causes a trap and a signal. diff --git a/version.mk b/version.mk index a377f271..66378083 100644 --- a/version.mk +++ b/version.mk @@ -1,3 +1,3 @@ NETPBM_MAJOR_RELEASE = 10 NETPBM_MINOR_RELEASE = 70 -NETPBM_POINT_RELEASE = 1 +NETPBM_POINT_RELEASE = 2 -- cgit 1.4.1