summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDave Watson <davejwatson@fb.com>2019-02-08 21:57:43 (GMT)
committerDave Watson <davejwatson@fb.com>2019-02-11 19:44:51 (GMT)
commit5d7d1166cb681cda79a3ac4bda774f06a13356ad (patch)
tree61c4d3612f93bbd025e4ed21d7ecc05f46ad9dd0 /lib
parent75fb878a901900d0addd6950b4c9e4ab2bd3d1f2 (diff)
downloadlz4-5d7d1166cb681cda79a3ac4bda774f06a13356ad.zip
lz4-5d7d1166cb681cda79a3ac4bda774f06a13356ad.tar.gz
lz4-5d7d1166cb681cda79a3ac4bda774f06a13356ad.tar.bz2
decompress_generic: Limit fastpath to x86
New fastpath currently shows a regression on qualcomm arm chips. Restrict it to x86 for now
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.c12
1 files 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)) {