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 7E23B45B51; Wed, 16 Oct 2024 16:03:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D94040150; Wed, 16 Oct 2024 16:03:24 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2048.outbound.protection.outlook.com [40.107.21.48]) by mails.dpdk.org (Postfix) with ESMTP id 68E21400D6 for ; Wed, 16 Oct 2024 16:03:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LMh+JHQE61I8lzad4eZG/bubquUqgsXS2KH6wtZcx/g898AcedgeVMCvjFOJWDGiyPQTrd3hYzJjJRFcujKfKdl0pVJuu5rjfx8TOBp8byKDXprqW9Cng95dGax740+7YW5+MmMUAEx3SbSpkDJuEC2bhKrb8By9DGElw3kvaPRq2SPxjXIuhSS9bAJ6hBIfTM3XV0V14ARmiAoPVKNqLyztL7Vf71kyWv8qpDbFOkTjoaEUdPlcQ5F8kZgXfXiijrTv+siL2dMugUwU9mfvTwc+DtU2KNVEZEI5M+EyehFWqRLtBxO4HZ2Ky0ai2bgxP4af7fBvPsu6eWAf5732Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hcRwwlHFpD8j0UegS7BEuT8NtMkEpkQ3awilpP7ytmg=; b=c89BR1DTD7U0k7FZq55EdRI3RrzezTNAszB3wijs3lu/KOIWwymVjQIGWxK0MRj3QFm3RYMNv02j8vCQYk9cIPS6x0J0kGrEXtd7Rxr/QVli77ACxoHL8eFM6Pwd8oBZXMX8q+gU+bu93Sivox/dK3lmf9Q/JDa9jBlQasUZDotcMzlS3G67AuhazRX/pqltKXIjS5WcFHqeITqIafI7V62vuYWXStI17dz8lkE4ztqRPpk3Hc4ZoVW3AqCDxS5qyi2KRK1GsbwgGYeWME1oIoT5ii5XQzKFpvv85+gRE08nn0kBlTLdq6eW03WAtX/LPbJnXgP2YmkNuUFN0NGqLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=dpdk.org smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hcRwwlHFpD8j0UegS7BEuT8NtMkEpkQ3awilpP7ytmg=; b=vfyMtg6WmhZMuUJhoGx+vUYofNqmlex+kKnOt7rGMrW0gmookqtrrM+U17t3QK7DExzHy1UdyOK3BmO+T5tKrsQULiPJcaoF33j7J/wpE69kfsqpQ+wK+NCDzoNcuOAmCkER4dcyfgGkfbaUK36n7s09QH3iRS3YNzVS13SK9OBoF1X4XMRZP/TjGsvuDa9I4aHChtq0rB/hsLK4XytvqZlq3ivCv35BFKzXH38jrgpQmbnXdHKCNkuaAFQ6VMgnJV7H1kEILeyJsaHkp9PKztPBNpAE7RrxLxB8agzmcBla5eU/rft6Xg0EHhsDka83/AqBPdfjk0lJ5z7aV1aBgA== Received: from DUZP191CA0038.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f8::22) by AS8PR07MB7878.eurprd07.prod.outlook.com (2603:10a6:20b:394::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Wed, 16 Oct 2024 14:03:18 +0000 Received: from DU2PEPF00028D12.eurprd03.prod.outlook.com (2603:10a6:10:4f8:cafe::e7) by DUZP191CA0038.outlook.office365.com (2603:10a6:10:4f8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18 via Frontend Transport; Wed, 16 Oct 2024 14:03:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by DU2PEPF00028D12.mail.protection.outlook.com (10.167.242.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Wed, 16 Oct 2024 14:03:17 +0000 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.142.248) by smtp-central.internal.ericsson.com (100.87.178.62) with Microsoft SMTP Server id 15.2.1544.11; Wed, 16 Oct 2024 16:03:16 +0200 Received: from breslau.. (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 2DC7E1C006B; Wed, 16 Oct 2024 16:03:16 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: , David Marchand CC: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH 1/2] bitset: discontinue the use of GCC builtin Date: Wed, 16 Oct 2024 15:54:10 +0200 Message-ID: <20241016135411.827850-1-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF00028D12:EE_|AS8PR07MB7878:EE_ X-MS-Office365-Filtering-Correlation-Id: 061cff4e-bd54-484d-2fd4-08dcedeb4920 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?V0ZxRmZ4L3o2Zlh5YXhKV2VYT29NQkR5RTN6Q203UjdqNk4rY3EybEFuazQw?= =?utf-8?B?Yk9aVWcvNW5WTmlnNUlVSC8wM2p3dGwxdW1xVG9JZG10b2c3aUliOEV1d1Q0?= =?utf-8?B?QUxLRWY5V1FkOE1mYmpLbEZneEpvM2pJcVp5REM0OGVhclNpNVBNeXcvNnp6?= =?utf-8?B?MnBVUGdrMG94Tk52T0JoQ0d2MHhVc1dkNFpaaFZwKzNCSFFOQ3RPOHNmTmVq?= =?utf-8?B?c290bFp1ajFVbUttVENsbTRwbi91cllkRks4Q0Rkc2RDNWV6eEgrVVVLQWlv?= =?utf-8?B?UnNsc25WT1Z5Nlc0M3pYQjB6ekNKb1F5NWhZN1dyZ29jUnVLTFRFdWh1VXhH?= =?utf-8?B?bWJQRVUyYldvdkdyWlh5R3NLN3Y2ZVBXQndlR2V2c1JuV3hOeDVvVVlTVDNR?= =?utf-8?B?Y0NtWVpZZmt6REpFYkQwaWdSTFBHbzhPQXpDdDFGY3V0T0VBZ1VIMERUK2dO?= =?utf-8?B?cG5wazdxR2w0RDRKcGFYUi9jQUwyQWpFeUJETFpUOFUzaHdLamJIcFFqV1c2?= =?utf-8?B?bkdhK0drUHRHU2JNUFVDR2QrRnBvSkRkNERITm9NaC9rZVlRdk1RT25vbzNQ?= =?utf-8?B?bG5OVlhGby95QkYwM1haUCtERnJkQjNVb243ZEdGZGhtdmlVeWRMeENGTHd2?= =?utf-8?B?RGs1VGpQT1pzOFZTdG8yS1lkdHlUemlacWE5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xFT21UVjJkeFFlZlZjUjh0c0NncHhpVkExQWFT?= =?utf-8?B?ZHhWMVZxaXhPdC80NkhxMXNmM1VPcHhjZVZjTno5aDQ5b29ZR0RYa2xWSFFN?= =?utf-8?B?RXlmRnRqR1lCb3k5b2szVmw4eWZlOXU1QVhDZ1EwS1VsQXV2bVhDQ1VvZVJE?= =?utf-8?B?QWZNU1dFV0E1eWJ4bjd2RDZ3MW1pb0hOZ0tDdXprdCtkQ0k2SG00VE5vQ01M?= =?utf-8?B?MjBrTmVZNGFBM0hVd3k1SEsvektBckYvNjFQek9MM29mczNra2NFZ1FZM0d3?= =?utf-8?Q?RvdRWCxhHdt0p?= X-Forefront-Antispam-Report: CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 14:03:17.8930 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 061cff4e-bd54-484d-2fd4-08dcedeb4920 X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74]; Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF00028D12.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7878 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 Replace the use of __builtin_ffsll() with rte_bsf64() to be MSVC compatible. Signed-off-by: Mattias Rönnblom Suggested-by: David Marchand --- lib/eal/include/rte_bitset.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/eal/include/rte_bitset.h b/lib/eal/include/rte_bitset.h index 74c643a72a..27b7a2e34d 100644 --- a/lib/eal/include/rte_bitset.h +++ b/lib/eal/include/rte_bitset.h @@ -601,7 +601,6 @@ __rte_bitset_find_nowrap(const uint64_t *bitset, size_t __rte_unused size, size_ while (word_idx <= __RTE_BITSET_WORD_IDX(end_bit - 1)) { uint64_t word; - int word_ffs; word = bitset[word_idx]; if (find_clear) @@ -609,16 +608,14 @@ __rte_bitset_find_nowrap(const uint64_t *bitset, size_t __rte_unused size, size_ word >>= offset; - word_ffs = __builtin_ffsll(word); - - if (word_ffs != 0) { - ssize_t ffs = start_bit + word_ffs - 1; + if (word != 0) { + size_t ffs = start_bit + rte_bsf64(word); /* * Check if set bit were among the last, * unused bits, in the last word. */ - if (unlikely(ffs >= (ssize_t)end_bit)) + if (unlikely(ffs >= end_bit)) return -1; return ffs; -- 2.43.0