From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4436343267; Thu, 2 Nov 2023 02:05:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D797042DDA; Thu, 2 Nov 2023 02:05:39 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 197FE42DC5 for ; Thu, 2 Nov 2023 02:05:35 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 44B1620B74C3; Wed, 1 Nov 2023 18:05:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 44B1620B74C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1698887134; bh=x7t+Qhc2IVLyZ3FEJAJhsdIR77Wr6QcR+1Qa2VHDK3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MqupIUPixF+DCUAq0da8GrOR+CiuQa1Qh9sYnYkn3TfZOKjY7lQVuv0sLhjQZDYg7 /8aSjwnViy2Bs6WDO5WgQY3vxI3Y2jTivi+NrXmxZWNEPxx/QurZ8ir9oBDGKG/6Xm xVTHy3EV80zgcsE/UTGwYmte8E4LJmTu3tzIA8HQ= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Cristian Dumitrescu , David Hunt , Honnappa Nagarahalli , Ruifeng Wang , Sameh Gobriel , Tyler Retzlaff , Vladimir Medvedkin , Yipeng Wang Subject: [PATCH 3/5] hash: use abstracted bit count functions Date: Wed, 1 Nov 2023 18:05:30 -0700 Message-Id: <1698887132-5347-4-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1698887132-5347-1-git-send-email-roretzla@linux.microsoft.com> References: <1698887132-5347-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use rte_ctz64 instead of __builtin_ctzl Fixes: 18898c4d06f9 ("eal: use abstracted bit count functions") Signed-off-by: Tyler Retzlaff --- lib/hash/rte_cuckoo_hash.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c index b2cf60d..d8d4cc1 100644 --- a/lib/hash/rte_cuckoo_hash.c +++ b/lib/hash/rte_cuckoo_hash.c @@ -1931,7 +1931,7 @@ struct rte_hash * if (prim_hitmask[i]) { uint32_t first_hit = - __builtin_ctzl(prim_hitmask[i]) + rte_ctz64(prim_hitmask[i]) >> 1; uint32_t key_idx = primary_bkt[i]->key_idx[first_hit]; @@ -1945,7 +1945,7 @@ struct rte_hash * if (sec_hitmask[i]) { uint32_t first_hit = - __builtin_ctzl(sec_hitmask[i]) + rte_ctz64(sec_hitmask[i]) >> 1; uint32_t key_idx = secondary_bkt[i]->key_idx[first_hit]; @@ -1962,7 +1962,7 @@ struct rte_hash * positions[i] = -ENOENT; while (prim_hitmask[i]) { uint32_t hit_index = - __builtin_ctzl(prim_hitmask[i]) + rte_ctz64(prim_hitmask[i]) >> 1; uint32_t key_idx = primary_bkt[i]->key_idx[hit_index]; @@ -1990,7 +1990,7 @@ struct rte_hash * while (sec_hitmask[i]) { uint32_t hit_index = - __builtin_ctzl(sec_hitmask[i]) + rte_ctz64(sec_hitmask[i]) >> 1; uint32_t key_idx = secondary_bkt[i]->key_idx[hit_index]; @@ -2088,7 +2088,7 @@ struct rte_hash * if (prim_hitmask[i]) { uint32_t first_hit = - __builtin_ctzl(prim_hitmask[i]) + rte_ctz64(prim_hitmask[i]) >> 1; uint32_t key_idx = primary_bkt[i]->key_idx[first_hit]; @@ -2102,7 +2102,7 @@ struct rte_hash * if (sec_hitmask[i]) { uint32_t first_hit = - __builtin_ctzl(sec_hitmask[i]) + rte_ctz64(sec_hitmask[i]) >> 1; uint32_t key_idx = secondary_bkt[i]->key_idx[first_hit]; @@ -2118,7 +2118,7 @@ struct rte_hash * for (i = 0; i < num_keys; i++) { while (prim_hitmask[i]) { uint32_t hit_index = - __builtin_ctzl(prim_hitmask[i]) + rte_ctz64(prim_hitmask[i]) >> 1; uint32_t key_idx = rte_atomic_load_explicit( @@ -2150,7 +2150,7 @@ struct rte_hash * while (sec_hitmask[i]) { uint32_t hit_index = - __builtin_ctzl(sec_hitmask[i]) + rte_ctz64(sec_hitmask[i]) >> 1; uint32_t key_idx = rte_atomic_load_explicit( -- 1.8.3.1