From 72d6d64771ce52519c240fb122dbb35f989b4669 Mon Sep 17 00:00:00 2001 From: Salvatore Sanfilippo Date: Sun, 19 Feb 2017 14:59:39 +0000 Subject: ARM: Avoid memcpy() in MurmurHash64A() if we are using 64 bit ARM. However note that in architectures supporting 64 bit unaligned accesses memcpy(...,...,8) is likely translated to a simple word memory movement anyway. --- src/Makefile | 1 + src/config.h | 3 +++ src/hyperloglog.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 3f445f40f..f211eb84b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -14,6 +14,7 @@ release_hdr := $(shell sh -c './mkreleasehdr.sh') uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') +uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') OPTIMIZATION?=-O2 DEPENDENCY_TARGETS=hiredis linenoise lua NODEPS:=clean distclean diff --git a/src/config.h b/src/config.h index 354f8f5e5..1005dcc2a 100644 --- a/src/config.h +++ b/src/config.h @@ -211,5 +211,8 @@ void setproctitle(const char *fmt, ...); #if defined(__arm) && !defined(__arm__) #define __arm__ #endif +#if defined (__aarch64__) && !defined(__arm64__) +#define __arm64__ +#endif #endif diff --git a/src/hyperloglog.c b/src/hyperloglog.c index 7de5786f9..b8a63a73f 100644 --- a/src/hyperloglog.c +++ b/src/hyperloglog.c @@ -401,7 +401,7 @@ uint64_t MurmurHash64A (const void * key, int len, unsigned int seed) { uint64_t k; #if (BYTE_ORDER == LITTLE_ENDIAN) - #ifdef __arm__ + #if defined(__arm__) && !defined(__arm64__) memcpy(&k,data,sizeof(uint64_t)); #else k = *((uint64_t*)data); -- cgit v1.2.1