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 54E22432CA; Tue, 7 Nov 2023 20:10:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02C56427E7; Tue, 7 Nov 2023 20:10:13 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 18C30402D4 for ; Tue, 7 Nov 2023 20:10:08 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 6426420B74C2; Tue, 7 Nov 2023 11:10:07 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6426420B74C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1699384207; bh=nZ+Kj5q1Szts3I5PejzgGbG0XPcFuxH9Y9wWnRtfQYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R+Kr5UbsHKAOKlCfaCLBdxx7F6YnHfCKM8oXk9RV7SEGLKBaUQy2L+ZyxarP9wJJ0 NiZecUHpKCrd1ICDY5fiFcVSUxE3aGeLYetzQhIR92NaBk9vSSF4Wk34pMEVXJQCiI xeXUUPONvRoSj1fNUIRnJOleLbCc+97eMcw5NJwU= 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 , mb@smartsharesystems.com Subject: [PATCH v2 2/5] hash: use abstracted bit count functions Date: Tue, 7 Nov 2023 11:10:02 -0800 Message-Id: <1699384205-12999-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1699384205-12999-1-git-send-email-roretzla@linux.microsoft.com> References: <1698887132-5347-1-git-send-email-roretzla@linux.microsoft.com> <1699384205-12999-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_ctz32 or rte_ctz64 respectively instead of __builtin_ctzl depending on the resultant type of the expression passed as an argument 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..19ee53a 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_ctz32(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_ctz32(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_ctz32(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_ctz32(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_ctz32(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_ctz32(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_ctz32(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_ctz32(sec_hitmask[i]) >> 1; uint32_t key_idx = rte_atomic_load_explicit( -- 1.8.3.1