From 5d7d1166cb681cda79a3ac4bda774f06a13356ad Mon Sep 17 00:00:00 2001 From: Dave Watson Date: Fri, 8 Feb 2019 13:57:43 -0800 Subject: decompress_generic: Limit fastpath to x86 New fastpath currently shows a regression on qualcomm arm chips. Restrict it to x86 for now --- lib/lz4.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/lz4.c b/lib/lz4.c index 066d535..48423f6 100644 --- a/lib/lz4.c +++ b/lib/lz4.c @@ -301,6 +301,7 @@ static const unsigned inc32table[8] = {0, 1, 2, 1, 0, 4, 4, 4}; static const int dec64table[8] = {0, 0, 0, -1, -4, 1, 2, 3}; +#if defined(__i386__) || defined(__x86_64__) LZ4_FORCE_O2_INLINE_GCC_PPC64LE void LZ4_memcpy_using_offset_base(BYTE* dstPtr, const BYTE* srcPtr, BYTE* dstEnd, const size_t offset) { if (offset < 8) { @@ -365,7 +366,7 @@ void LZ4_memcpy_using_offset(BYTE* dstPtr, const BYTE* srcPtr, BYTE* dstEnd, con dstPtr += 8; } } - +#endif /*-************************************ * Common Constants **************************************/ @@ -1586,6 +1587,8 @@ LZ4_decompress_generic( if ((!endOnInput) && (unlikely(outputSize==0))) return (*ip==0 ? 1 : -1); if ((endOnInput) && unlikely(srcSize==0)) return -1; + /* Currently the fast loop shows a regression on qualcomm arm chips. */ +#if defined(__i386__) || defined(__x86_64__) if ((oend - op) < FASTLOOP_SAFE_DISTANCE) goto safe_decode; @@ -1706,8 +1709,8 @@ LZ4_decompress_generic( op = cpy; /* wildcopy correction */ } - safe_decode: +#endif /* Main Loop : decode remaining sequences where output < FASTLOOP_SAFE_DISTANCE */ while (1) { @@ -1768,7 +1771,9 @@ LZ4_decompress_generic( /* copy literals */ cpy = op+length; +#if defined(__i386__) || defined(__x86_64__) safe_literal_copy: +#endif LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH); if ( ((endOnInput) && ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) ) || ((!endOnInput) && (cpy>oend-WILDCOPYLENGTH)) ) @@ -1816,8 +1821,9 @@ LZ4_decompress_generic( } length += MINMATCH; +#if defined(__i386__) || defined(__x86_64__) safe_match_copy: - +#endif /* match starting within external dictionary */ if ((dict==usingExtDict) && (match < lowPrefix)) { if (unlikely(op+length > oend-LASTLITERALS)) { -- cgit v0.12