From d262a6ae9a36aea61daf5af03f246287a30c45dd Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Fri, 28 Sep 2018 09:43:41 +0200 Subject: replace direct calls to __builtin_clz/ctz with generic functions --- include/common/intops.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/common/intops.h b/include/common/intops.h index a739709..61b891d 100644 --- a/include/common/intops.h +++ b/include/common/intops.h @@ -30,6 +30,8 @@ #include +#include "common/attributes.h" + static inline int imax(const int a, const int b) { return a > b ? a : b; } @@ -51,11 +53,11 @@ static inline int apply_sign(const int v, const int s) { } static inline int ulog2(const unsigned v) { - return 31 - __builtin_clz(v); + return 31 - clz(v); } static inline int u64log2(const uint64_t v) { - return 63 - __builtin_clzll(v); + return 63 - clzll(v); } static inline unsigned rl16(const uint8_t *const ptr) { -- cgit v1.2.3