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 618AD432CC; Wed, 8 Nov 2023 00:38:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E8BE42D9D; Wed, 8 Nov 2023 00:38:29 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 92E4D402C9 for ; Wed, 8 Nov 2023 00:38:22 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id C8A0820B74C2; Tue, 7 Nov 2023 15:38:21 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C8A0820B74C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1699400301; bh=nZ+Kj5q1Szts3I5PejzgGbG0XPcFuxH9Y9wWnRtfQYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m8JxVFVxwx9U4npHv7zTF/8jKjFkvD8+XNRj+XeYV8dCAKWcLWnGna8LR1xT04TCN WzJ50RRfQNx2qCyIwMn3QfocjLIFiIVbcQ0tvW6ZxbaSVbytRp5KWxrI4r66x2+40x K5qn5xyfsziwYg9Rb+Nr8y8SM0y6NDQo3cVVnNFQ= 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 v3 2/7] hash: use abstracted bit count functions Date: Tue, 7 Nov 2023 15:38:15 -0800 Message-Id: <1699400300-22545-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1699400300-22545-1-git-send-email-roretzla@linux.microsoft.com> References: <1698887132-5347-1-git-send-email-roretzla@linux.microsoft.com> <1699400300-22545-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