]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add `ip1 + 128` Prefetch; Tiny Cleanup
authorW. Felix Handte <w@felixhandte.com>
Thu, 19 Aug 2021 17:58:09 +0000 (13:58 -0400)
committerW. Felix Handte <w@felixhandte.com>
Wed, 1 Sep 2021 18:15:04 +0000 (14:15 -0400)
lib/compress/zstd_fast.c

index c43c8a6af1e006d443fd6c9a0a2d64f2dbecebd1..ebbef491926e2880abe30e0bbb2f9c08ef8b07a3 100644 (file)
@@ -295,7 +295,9 @@ _start: /* Requires: ip0 */
     idx = hashTable[hash0];
 
     do {
+        /* load repcode match for ip[2]*/
         const U32 rval = MEM_read32(ip2 - rep_offset1);
+
         current0 = ip0 - base;
 
         /* write back hash table entry */
@@ -334,18 +336,18 @@ _start: /* Requires: ip0 */
         /* lookup ip[1] */
         idx = hashTable[hash0];
 
-        /* advance to next positions */
-        {
-            if (ip1 >= nextStep) {
-                PREFETCH_L1(ip1 + 64);
-                step++;
-                nextStep += kStepIncr;
-            }
-
-            ip0 = ip1;
-            ip1 = ip2;
-            ip2 = ip2 + step;
+        /* calculate step */
+        if (ip1 >= nextStep) {
+            PREFETCH_L1(ip1 + 64);
+            PREFETCH_L1(ip1 + 128);
+            step++;
+            nextStep += kStepIncr;
         }
+
+        /* advance to next positions */
+        ip0 = ip1;
+        ip1 = ip2;
+        ip2 += step;
     } while (ip2 < ilimit);
 
 _cleanup: