Use DPDK abstracted bitcount functions in rte_bsf and rte_fls inline
functions.

Signed-off-by: Tyler Retzlaff <roret...@linux.microsoft.com>
---
 lib/eal/include/rte_bitops.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/eal/include/rte_bitops.h b/lib/eal/include/rte_bitops.h
index d45aa54..6b8ae8d 100644
--- a/lib/eal/include/rte_bitops.h
+++ b/lib/eal/include/rte_bitops.h
@@ -574,7 +574,7 @@
 static inline uint32_t
 rte_bsf32(uint32_t v)
 {
-       return (uint32_t)__builtin_ctz(v);
+       return (uint32_t)rte_ctz32(v);
 }
 
 /**
@@ -615,7 +615,7 @@
 static inline uint32_t
 rte_bsf64(uint64_t v)
 {
-       return (uint32_t)__builtin_ctzll(v);
+       return (uint32_t)rte_ctz64(v);
 }
 
 /**
@@ -656,7 +656,7 @@
 static inline uint32_t
 rte_fls_u32(uint32_t x)
 {
-       return (x == 0) ? 0 : 32 - __builtin_clz(x);
+       return (x == 0) ? 0 : 32 - rte_clz32(x);
 }
 
 /**
@@ -674,7 +674,7 @@
 static inline uint32_t
 rte_fls_u64(uint64_t x)
 {
-       return (x == 0) ? 0 : 64 - __builtin_clzll(x);
+       return (x == 0) ? 0 : 64 - rte_clz64(x);
 }
 
 /*********** Macros to work with powers of 2 ********/
-- 
1.8.3.1

Reply via email to