diff options
author | Victor Costan <pwnall@chromium.org> | 2021-08-14 08:15:44 +0000 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2021-08-14 08:15:44 +0000 |
commit | b9c9a989b2738ea3e576c5b6abccd1dd68617153 (patch) | |
tree | c67253aadf0624aeda1ec2256e63083e609bd411 | |
parent | 5c87bc61b6d44cdfc1cc7855fd606c0f3370ce70 (diff) | |
parent | d643b9a98888bdc746e8b19621ab19208e79fdac (diff) | |
download | snappy-git-b9c9a989b2738ea3e576c5b6abccd1dd68617153.tar.gz |
Merge pull request #135 from JunHe77:remove_extra
PiperOrigin-RevId: 390767998
-rw-r--r-- | snappy.cc | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1112,6 +1112,15 @@ std::pair<const uint8_t*, ptrdiff_t> DecompressBranchless( // ip points just past the tag and we are touching at maximum kSlopBytes // in an iteration. size_t tag = ip[-1]; +#if defined(__clang__) && defined(__aarch64__) + // Workaround for https://bugs.llvm.org/show_bug.cgi?id=51317 + // when loading 1 byte, clang for aarch64 doesn't realize that it(ldrb) + // comes with free zero-extension, so clang generates another + // 'and xn, xm, 0xff' before it use that as the offset. This 'and' is + // redundant and can be removed by adding this dummy asm, which gives + // clang a hint that we're doing the zero-extension at the load. + asm("" ::"r"(tag)); +#endif do { // The throughput is limited by instructions, unrolling the inner loop // twice reduces the amount of instructions checking limits and also |