enable LZ4_FAST_DEC_LOOP build macro on aarch64/GCC by default
authorGeorge Prekas <prekageo@amazon.com>
Fri, 3 May 2019 16:44:56 +0000 (11:44 -0500)
committerGeorge Prekas <prekageo@amazon.com>
Tue, 7 May 2019 13:36:06 +0000 (08:36 -0500)
lib/lz4.c

index 69143c0..070dd7e 100644 (file)
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -317,6 +317,11 @@ static const int      dec64table[8] = {0, 0, 0, -1, -4,  1, 2, 3};
 #ifndef LZ4_FAST_DEC_LOOP
 #  if defined(__i386__) || defined(__x86_64__)
 #    define LZ4_FAST_DEC_LOOP 1
+#  elif defined(__aarch64__) && !defined(__clang__)
+     /* On aarch64, we disable this optimization for clang because on certain
+      * mobile chipsets and clang, it reduces performance. For more information
+      * refer to https://github.com/lz4/lz4/pull/707. */
+#    define LZ4_FAST_DEC_LOOP 1
 #  else
 #    define LZ4_FAST_DEC_LOOP 0
 #  endif