From 7111c86ca38c4513d036d3bf58e28a532b8ce137 Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Tue, 1 Oct 2019 13:17:32 -0700 Subject: [PATCH] Enable clang to use intrinsics for lz4 Reviewed-by: Igor Kozhukhov Reviewed-by: Jorgen Lundman Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Signed-off-by: Matt Macy Closes #9385 --- module/zfs/lz4.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/zfs/lz4.c b/module/zfs/lz4.c index c04cfa7ba..953c440df 100644 --- a/module/zfs/lz4.c +++ b/module/zfs/lz4.c @@ -383,7 +383,7 @@ static inline int LZ4_NbCommonBytes(register U64 val) { #if defined(LZ4_BIG_ENDIAN) -#if defined(__GNUC__) && (GCC_VERSION >= 304) && \ +#if ((defined(__GNUC__) && (GCC_VERSION >= 304)) || defined(__clang__)) && \ !defined(LZ4_FORCE_SW_BITCOUNT) return (__builtin_clzll(val) >> 3); #else @@ -404,7 +404,7 @@ LZ4_NbCommonBytes(register U64 val) return (r); #endif #else -#if defined(__GNUC__) && (GCC_VERSION >= 304) && \ +#if ((defined(__GNUC__) && (GCC_VERSION >= 304)) || defined(__clang__)) && \ !defined(LZ4_FORCE_SW_BITCOUNT) return (__builtin_ctzll(val) >> 3); #else @@ -426,7 +426,7 @@ static inline int LZ4_NbCommonBytes(register U32 val) { #if defined(LZ4_BIG_ENDIAN) -#if defined(__GNUC__) && (GCC_VERSION >= 304) && \ +#if ((defined(__GNUC__) && (GCC_VERSION >= 304)) || defined(__clang__)) && \ !defined(LZ4_FORCE_SW_BITCOUNT) return (__builtin_clz(val) >> 3); #else