From 8a853e3f0275efc8b05cb195085d45946942744a Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 14 Nov 2018 11:13:11 +0000 Subject: New upstream version 18.11-rc3 Change-Id: I958b9d019027ef049bd992b3968a667f3ae382ae Signed-off-by: Luca Boccassi --- lib/librte_eal/common/rte_reciprocal.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'lib/librte_eal/common/rte_reciprocal.c') diff --git a/lib/librte_eal/common/rte_reciprocal.c b/lib/librte_eal/common/rte_reciprocal.c index d81b11db..f017d0c2 100644 --- a/lib/librte_eal/common/rte_reciprocal.c +++ b/lib/librte_eal/common/rte_reciprocal.c @@ -41,28 +41,13 @@ #include "rte_reciprocal.h" -/* find largest set bit. - * portable and slow but does not matter for this usage. - */ -static inline int fls(uint32_t x) -{ - int b; - - for (b = 31; b >= 0; --b) { - if (x & (1u << b)) - return b + 1; - } - - return 0; -} - struct rte_reciprocal rte_reciprocal_value(uint32_t d) { struct rte_reciprocal R; uint64_t m; int l; - l = fls(d - 1); + l = rte_fls_u32(d - 1); m = ((1ULL << 32) * ((1ULL << l) - d)); m /= d; -- cgit 1.2.3-korg