aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbinhdvo <binhvo@gmail.com>2021-12-14 15:53:50 -0500
committerGitHub <noreply@github.com>2021-12-14 15:53:50 -0500
commit64205b7832fa0b4433214e26c294545b4c962834 (patch)
tree1928dad616d2c040a6a0df924779318eb3dd2bb1
parent5e2fede604f28114bb9cb86db3247968bb01a060 (diff)
downloadzstd-64205b7832fa0b4433214e26c294545b4c962834.tar.gz
Fix performance degradation with -m32 (#2926)
-rw-r--r--lib/common/zstd_internal.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/common/zstd_internal.h b/lib/common/zstd_internal.h
index 9073df42..3dc14bb1 100644
--- a/lib/common/zstd_internal.h
+++ b/lib/common/zstd_internal.h
@@ -188,8 +188,13 @@ static void ZSTD_copy16(void* dst, const void* src) {
vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src));
#elif defined(ZSTD_ARCH_X86_SSE2)
_mm_storeu_si128((__m128i*)dst, _mm_loadu_si128((const __m128i*)src));
-#else
+#elif defined(__clang__)
ZSTD_memmove(dst, src, 16);
+#else
+ /* ZSTD_memmove is not inlined properly by gcc */
+ BYTE copy16_buf[16];
+ ZSTD_memcpy(copy16_buf, src, 16);
+ ZSTD_memcpy(dst, copy16_buf, 16);
#endif
}
#define COPY16(d,s) { ZSTD_copy16(d,s); d+=16; s+=16; }