diff options
author | Matthew Macy <[email protected]> | 2019-10-01 13:17:32 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-10-01 13:17:32 -0700 |
commit | 7111c86ca38c4513d036d3bf58e28a532b8ce137 (patch) | |
tree | 490e95d49b024de2f6437696b782732ae073989f | |
parent | bd76e6817cb53ad621fc100d0ec01fcaacbb092e (diff) |
Enable clang to use intrinsics for lz4
Reviewed-by: Igor Kozhukhov <[email protected]>
Reviewed-by: Jorgen Lundman <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #9385
-rw-r--r-- | module/zfs/lz4.c | 6 |
1 files 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 |