From c783e7761c2ac63fc978e24addf71bb7f1197ca4 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Wed, 30 May 2018 19:40:56 +0000 Subject: [PATCH] cityhash: disable SSE 4.2 optimization on x86 $ c++ -m32 -msse4.2 -c ext/native/ext/cityhash/city.cpp ext/native/ext/cityhash/city.cpp:569:5: error: use of undeclared identifier '_mm_crc32_u64' CHUNK(0); PERMUTE3(a, h, c); ^ ext/native/ext/cityhash/city.cpp:562:9: note: expanded from macro 'CHUNK' z = _mm_crc32_u64(z, b + g); \ ^ --- ext/native/ext/cityhash/city.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ext/native/ext/cityhash/city.cpp b/ext/native/ext/cityhash/city.cpp index 6b5d4726d2..0428da728c 100644 --- a/ext/native/ext/cityhash/city.cpp +++ b/ext/native/ext/cityhash/city.cpp @@ -27,9 +27,6 @@ // possible hash functions, by using SIMD instructions, or by // compromising on hash quality. -#ifdef __ANDROID__ -#undef __SSE4_2__ -#endif #include "city.h" #include @@ -521,7 +518,7 @@ uint128 CityHash128(const char *s, size_t len) { CityHash128WithSeed(s, len, uint128(k0, k1)); } -#ifdef __SSE4_2__ +#if defined(__x86_64__) && defined(__SSE4_2__) #include "citycrc.h" #include