eal: add 64-bit bsf and 32-bit safe bsf functions
[dpdk.git] / app / test-pmd / testpmd.c
index a10bc40..d4d22af 100644 (file)
@@ -649,19 +649,13 @@ calc_mem_size(uint32_t nb_mbufs, uint32_t mbuf_sz, size_t pgsz, size_t *out)
        return 0;
 }
 
-static inline uint32_t
-bsf64(uint64_t v)
-{
-       return (uint32_t)__builtin_ctzll(v);
-}
-
 static inline uint32_t
 log2_u64(uint64_t v)
 {
        if (v == 0)
                return 0;
        v = rte_align64pow2(v);
-       return bsf64(v);
+       return rte_bsf64(v);
 }
 
 static int