Merge pull request #295 from yjh0502/crc32

Enable sse4.2/pclmul for accelerated crc32c
master
Oleksandr Anyshchenko 6 years ago committed by GitHub
commit d06d91bd2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      librocksdb-sys/build.rs

@ -90,6 +90,18 @@ fn build_rocksdb() {
.filter(|file| *file != "util/build_version.cc")
.collect::<Vec<&'static str>>();
if cfg!(target_arch = "x86_64") {
// This is needed to enable hardware CRC32C. Technically, SSE 4.2 is
// only available since Intel Nehalem (about 2010) and AMD Bulldozer
// (about 2011).
config.define("HAVE_PCLMUL", Some("1"));
config.define("HAVE_SSE42", Some("1"));
config.flag("-msse2");
config.flag("-msse4.1");
config.flag("-msse4.2");
config.flag("-mpclmul");
}
if cfg!(target_os = "macos") {
config.define("OS_MACOSX", Some("1"));
config.define("ROCKSDB_PLATFORM_POSIX", Some("1"));

Loading…
Cancel
Save