diff options
author | Ilya Tokar <tokarip@google.com> | 2023-03-21 13:05:25 -0700 |
---|---|---|
committer | Victor Costan <costan@google.com> | 2023-03-29 17:31:17 -0700 |
commit | 92f18e66fdf34bdde3d5116ca3fac3910fe14fc5 (patch) | |
tree | f97b4e4b33e38d32c5fa3fd872bedc6ebd52e492 | |
parent | f603a020086da1115118eef206ce28a4a5829438 (diff) | |
download | snappy-git-92f18e66fdf34bdde3d5116ca3fac3910fe14fc5.tar.gz |
Add prefetch to zippy compress
PiperOrigin-RevId: 518358512
-rw-r--r-- | snappy-internal.h | 2 | ||||
-rw-r--r-- | snappy.cc | 6 |
2 files changed, 2 insertions, 6 deletions
diff --git a/snappy-internal.h b/snappy-internal.h index e442b0b..39fbda5 100644 --- a/snappy-internal.h +++ b/snappy-internal.h @@ -258,6 +258,8 @@ static inline std::pair<size_t, bool> FindMatchLength(const char* s1, s2 += 8; } } + SNAPPY_PREFETCH(s1 + 64); + SNAPPY_PREFETCH(s2 + 64); // Find out how long the match is. We loop over the data 64 bits at a // time until we find a 64-bit block that doesn't match; then we find @@ -68,12 +68,6 @@ #include <arm_acle.h> #endif -#if defined(__GNUC__) -#define SNAPPY_PREFETCH(ptr) __builtin_prefetch(ptr, 0, 3) -#else -#define SNAPPY_PREFETCH(ptr) (void)(ptr) -#endif - #include <algorithm> #include <array> #include <cstddef> |