diff options
Diffstat (limited to 'package/libs/zlib/patches/003-arm-specific-optimisations-for-inflate.patch')
-rw-r--r-- | package/libs/zlib/patches/003-arm-specific-optimisations-for-inflate.patch | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/package/libs/zlib/patches/003-arm-specific-optimisations-for-inflate.patch b/package/libs/zlib/patches/003-arm-specific-optimisations-for-inflate.patch index 9370264c40..1f83b500ba 100644 --- a/package/libs/zlib/patches/003-arm-specific-optimisations-for-inflate.patch +++ b/package/libs/zlib/patches/003-arm-specific-optimisations-for-inflate.patch @@ -16,9 +16,6 @@ Change-Id: I59854eb25d2b1e43561c8a2afaf9175bf10cf674 3 files changed, 335 insertions(+), 62 deletions(-) create mode 100644 contrib/arm/chunkcopy.h -diff --git a/contrib/arm/chunkcopy.h b/contrib/arm/chunkcopy.h -new file mode 100644 -index 00000000..2d6fd6f9 --- /dev/null +++ b/contrib/arm/chunkcopy.h @@ -0,0 +1,279 @@ @@ -301,8 +298,6 @@ index 00000000..2d6fd6f9 +#undef Z_RESTRICT + +#endif /* CHUNKCOPY_H */ -diff --git a/contrib/arm/inffast.c b/contrib/arm/inffast.c -index 0dbd1dbc..f7f50071 100644 --- a/contrib/arm/inffast.c +++ b/contrib/arm/inffast.c @@ -7,6 +7,7 @@ @@ -313,7 +308,7 @@ index 0dbd1dbc..f7f50071 100644 #ifdef ASMINF # pragma message("Assembler code may have bugs -- use at your own risk") -@@ -57,6 +58,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ +@@ -57,6 +58,7 @@ unsigned start; /* inflate()'s s unsigned char FAR *out; /* local strm->next_out */ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ unsigned char FAR *end; /* while out < end, enough space available */ @@ -321,7 +316,7 @@ index 0dbd1dbc..f7f50071 100644 #ifdef INFLATE_STRICT unsigned dmax; /* maximum distance from zlib header */ #endif -@@ -84,12 +86,13 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ +@@ -84,12 +86,13 @@ unsigned start; /* inflate()'s s out = strm->next_out; beg = out - (start - strm->avail_out); end = out + (strm->avail_out - 257); @@ -336,7 +331,7 @@ index 0dbd1dbc..f7f50071 100644 window = state->window; hold = state->hold; bits = state->bits; -@@ -197,70 +200,51 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ +@@ -197,70 +200,51 @@ unsigned start; /* inflate()'s s #endif } from = window; @@ -371,14 +366,8 @@ index 0dbd1dbc..f7f50071 100644 - } while (--op); - from = out - dist; /* rest from output */ - } -+ out = chunkcopy_safe(out, from, op, limit); -+ from = window; /* more from start of window */ -+ op = wnext; -+ /* This (rare) case can create a situation where -+ the first chunkcopy below must be checked. -+ */ - } - } +- } +- } - else { /* contiguous in window */ - from += wnext - op; - if (op < len) { /* some from window */ @@ -399,6 +388,14 @@ index 0dbd1dbc..f7f50071 100644 - *out++ = *from++; - if (len > 1) - *out++ = *from++; ++ out = chunkcopy_safe(out, from, op, limit); ++ from = window; /* more from start of window */ ++ op = wnext; ++ /* This (rare) case can create a situation where ++ the first chunkcopy below must be checked. ++ */ ++ } ++ } + if (op < len) { /* still need some from output */ + out = chunkcopy_safe(out, from, op, limit); + len -= op; @@ -443,8 +440,6 @@ index 0dbd1dbc..f7f50071 100644 } } else if ((op & 64) == 0) { /* 2nd level distance code */ -diff --git a/contrib/arm/inflate.c b/contrib/arm/inflate.c -index ac333e8c..e40322c3 100644 --- a/contrib/arm/inflate.c +++ b/contrib/arm/inflate.c @@ -84,6 +84,7 @@ |