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 2C605440B6; Fri, 24 May 2024 14:50:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBD4D402BF; Fri, 24 May 2024 14:50:39 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 06B9E40271 for ; Fri, 24 May 2024 14:50:38 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id F30A820F8B; Fri, 24 May 2024 14:50:36 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH v11 3/6] ptr_compress: add pointer compression library X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Fri, 24 May 2024 14:50:35 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F496@smartserver.smartshare.dk> In-Reply-To: <20240524083651.482541-4-paul.szczepanek@arm.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v11 3/6] ptr_compress: add pointer compression library Thread-Index: AdqttZAYmuP27/06RD6/PnzdNgo3gAAH7ZJg References: <20230927150854.3670391-2-paul.szczepanek@arm.com> <20240524083651.482541-1-paul.szczepanek@arm.com> <20240524083651.482541-4-paul.szczepanek@arm.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Paul Szczepanek" , Cc: "Honnappa Nagarahalli" , "Kamalakshitha Aligeri" , "Nathan Brown" , "Jack Bond-Preston" 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 > +#define BITS_REQUIRED_TO_STORE_VALUE(x) \ > + ((x) =3D=3D 0 ? 1 : (sizeof(size_t) * CHAR_BIT - = __builtin_clzl((size_t)x))) > + > +#define BIT_SHIFT_FROM_ALIGNMENT(x) ((x) =3D=3D 0 ? 0 : = __builtin_ctzl(x)) The two built-ins used are not available with MSVC. Please see if you can find similar functions in = /lib/eal/include/rte_bitops.h instead of defining these macros. > + > +#define CAN_USE_RTE_PTR_COMPRESS_16_SHIFT(mem_range, obj_alignment) \ > + ((BITS_REQUIRED_TO_STORE_VALUE(mem_range) - \ > + BIT_SHIFT_FROM_ALIGNMENT(obj_alignment)) <=3D 16 ? 1 : 0) > + > +#define CAN_USE_RTE_PTR_COMPRESS_32_SHIFT(mem_range, obj_alignment) \ > + ((BITS_REQUIRED_TO_STORE_VALUE(mem_range) - \ > + BIT_SHIFT_FROM_ALIGNMENT(obj_alignment)) <=3D 32 ? 1 : 0) > + These macros are in a public header file, and thus public. Their names should begin with RTE_PTR_COMPRESS. And they should have Doxygen descriptions. Please also use them in the tests or some other code, for the CI to = verify that MSVC can be build them.