diff options
author | costan <costan@google.com> | 2017-02-27 14:29:18 -0800 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2017-02-28 14:08:46 -0800 |
commit | ea175e28f8ef7f6a8f5931ebad1835d95ec466ed (patch) | |
tree | 8c52c8a394b42444589e4d3929093d03982f32ef /port/port_example.h | |
parent | 95cd743e5e71c7b06e7149a837e33b91309dfa48 (diff) | |
download | leveldb-ea175e28f8ef7f6a8f5931ebad1835d95ec466ed.tar.gz |
Implement support for Intel crc32 instruction (SSE 4.2)
This change authored by vadimskipin and submitted via:
https://github.com/google/leveldb/pull/309
Changes made to support iOS builds and other architectures
without support for SSE 4.2.
db_bench reports original crc32 speed at:
crc32c : 3.610 micros/op; 1082.0 MB/s (4K per op)
with this change performance has increased to:
crc32c : 0.843 micros/op; 4633.6 MB/s (4K per op)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148694935
Diffstat (limited to 'port/port_example.h')
-rw-r--r-- | port/port_example.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/port/port_example.h b/port/port_example.h index ab9e489..97bd669 100644 --- a/port/port_example.h +++ b/port/port_example.h @@ -129,6 +129,12 @@ extern bool Snappy_Uncompress(const char* input_data, size_t input_length, // The concatenation of all "data[0,n-1]" fragments is the heap profile. extern bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg); +// Extend the CRC to include the first n bytes of buf. +// +// Returns zero if the CRC cannot be extended using acceleration, else returns +// the newly extended CRC value (which may also be zero). +uint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size); + } // namespace port } // namespace leveldb |