]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
common: apply two stage copy to aarch64 3145/head
authorJun He <jun.he@arm.com>
Wed, 25 May 2022 14:26:41 +0000 (22:26 +0800)
committerJun He <jun.he@arm.com>
Thu, 26 May 2022 06:40:21 +0000 (14:40 +0800)
On aarch64 ZSTD_wildcopy uses a simple loop to do
16B based memory copy. There is existing optimized
two stage copy that can achieve better performance.
By applying this to aarch64 it is also observed ~1%
uplift in silesia corpus.

Signed-off-by: Jun He <jun.he@arm.com>
Change-Id: Ic1253308e7a8a7df2d08963ba544e086c81ce8be

lib/common/zstd_internal.h

index 8e2b84a236558805140648f5287d7c77f4a9d804..e76b8e19d64d1a61303c14c92704fe0114ac20ed 100644 (file)
@@ -235,12 +235,6 @@ void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e
          * one COPY16() in the first call. Then, do two calls per loop since
          * at that point it is more likely to have a high trip count.
          */
-#ifdef __aarch64__
-        do {
-            COPY16(op, ip);
-        }
-        while (op < oend);
-#else
         ZSTD_copy16(op, ip);
         if (16 >= length) return;
         op += 16;
@@ -250,7 +244,6 @@ void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e
             COPY16(op, ip);
         }
         while (op < oend);
-#endif
     }
 }