- added patch from IBM which optimizes deflate on s390(x) architectures

This commit is contained in:
Peter Schiffer 2012-08-13 13:34:16 +02:00
parent 11e52f3ae9
commit c0b02ed072
2 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,48 @@
diff -upr zlib-1.2.7.orig/deflate.c zlib-1.2.7/deflate.c
--- zlib-1.2.7.orig/deflate.c 2012-02-13 01:15:47.000000000 +0100
+++ zlib-1.2.7/deflate.c 2012-08-13 12:58:49.275911722 +0200
@@ -1143,15 +1143,16 @@ local void lm_init (s)
/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
* match.S. The code will be functionally equivalent.
*/
-local uInt longest_match(s, cur_match)
+local uInt longest_match(s, pcur_match)
deflate_state *s;
- IPos cur_match; /* current match */
+ IPos pcur_match; /* current match */
{
+ uLong cur_match = pcur_match; /* extend to pointer width */
unsigned chain_length = s->max_chain_length;/* max hash chain length */
register Bytef *scan = s->window + s->strstart; /* current string */
register Bytef *match; /* matched string */
register int len; /* length of current match */
- int best_len = s->prev_length; /* best match length so far */
+ uLong best_len = s->prev_length; /* best match length so far */
int nice_match = s->nice_match; /* stop if match long enough */
IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
s->strstart - (IPos)MAX_DIST(s) : NIL;
@@ -1159,19 +1160,19 @@ local uInt longest_match(s, cur_match)
* we prevent matches with the string of window index 0.
*/
Posf *prev = s->prev;
- uInt wmask = s->w_mask;
+ uLong wmask = s->w_mask;
#ifdef UNALIGNED_OK
/* Compare two bytes at a time. Note: this is not always beneficial.
* Try with and without -DUNALIGNED_OK to check.
*/
register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
- register ush scan_start = *(ushf*)scan;
- register ush scan_end = *(ushf*)(scan+best_len-1);
+ register uInt scan_start = *(ushf*)scan;
+ register uInt scan_end = *(ushf*)(scan+best_len-1);
#else
register Bytef *strend = s->window + s->strstart + MAX_MATCH;
- register Byte scan_end1 = scan[best_len-1];
- register Byte scan_end = scan[best_len];
+ register uInt scan_end1 = scan[best_len-1];
+ register uInt scan_end = scan[best_len];
#endif
/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.

View File

@ -1,10 +1,11 @@
Summary: The zlib compression and decompression library Summary: The zlib compression and decompression library
Name: zlib Name: zlib
Version: 1.2.7 Version: 1.2.7
Release: 5%{?dist} Release: 6%{?dist}
Group: System Environment/Libraries Group: System Environment/Libraries
Source: http://www.zlib.net/zlib-%{version}.tar.bz2 Source: http://www.zlib.net/zlib-%{version}.tar.bz2
Patch0: zlib-1.2.5-minizip-fixuncrypt.patch Patch0: zlib-1.2.5-minizip-fixuncrypt.patch
Patch1: zlib-1.2.7-optimized-s390.patch
URL: http://www.zlib.net/ URL: http://www.zlib.net/
# /contrib/dotzlib/ have Boost license # /contrib/dotzlib/ have Boost license
License: zlib and Boost License: zlib and Boost
@ -56,6 +57,9 @@ developing applications which use minizip.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .fixuncrypt %patch0 -p1 -b .fixuncrypt
%ifarch s390 s390x
%patch1 -p1 -b .optimized-deflate
%endif
iconv -f windows-1252 -t utf-8 <ChangeLog >ChangeLog.tmp iconv -f windows-1252 -t utf-8 <ChangeLog >ChangeLog.tmp
mv ChangeLog.tmp ChangeLog mv ChangeLog.tmp ChangeLog
@ -121,6 +125,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%{_libdir}/pkgconfig/minizip.pc %{_libdir}/pkgconfig/minizip.pc
%changelog %changelog
* Mon Aug 13 2012 Peter Schiffer <pschiffe@redhat.com> - 1.2.7-6
- added patch from IBM which optimizes deflate on s390(x) architectures
* Thu Aug 02 2012 Peter Schiffer <pschiffe@redhat.com> - 1.2.7-5 * Thu Aug 02 2012 Peter Schiffer <pschiffe@redhat.com> - 1.2.7-5
- resolves: #832545 - resolves: #832545
recompiled with -fPIC flag recompiled with -fPIC flag