Use sse4.2 CRC32 instructions to hash when available.
About 9x faster than Murmur3 for long inputs.
Most of this is a mechanical change from SkChecksum::Murmur3(...) to SkOpts::hash(...).
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208903002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot;master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot
Review-Url: https://codereview.chromium.org/2208903002
diff --git a/BUILD.gn b/BUILD.gn
index 76b04d5..ff3c492 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -158,6 +158,13 @@
cflags = [ "-msse4.1" ]
}
+source_set("opts_sse42") {
+ configs += skia_library_configs
+
+ sources = opts_gypi.sse42_sources
+ cflags = [ "-msse4.2" ]
+}
+
source_set("opts_avx") {
configs += skia_library_configs
@@ -172,6 +179,7 @@
deps = [
":opts_avx",
":opts_sse41",
+ ":opts_sse42",
":opts_ssse3",
"//third_party/expat",
"//third_party/giflib",