Message ID | 1708971946-18231-3-git-send-email-roretzla@linux.microsoft.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6ABA043BF1; Mon, 26 Feb 2024 19:25:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 540C842E6F; Mon, 26 Feb 2024 19:25:51 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 2F71642E25 for <dev@dpdk.org>; Mon, 26 Feb 2024 19:25:49 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 5C1BD20B74C2; Mon, 26 Feb 2024 10:25:48 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5C1BD20B74C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1708971948; bh=h0MxG6yK+lBULFYKUyns/jbLRvZRHy9o7fMXikZ0VKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dm7dKvYr6QyIoVOcK1Vh4KigUzisckc9qPbm80as8DFKQ5jikmGiDsDnL6eR/pIEv pvAE5I9LnYmYVrTNolhZ2CvomV8ezBND74n4IWC/O4VUtIDCOOrXqe7/ROT8bXRcFZ aznq0i7WCwd8xw2Z7t1IxwYE3wR7aY/On1PysfPI= From: Tyler Retzlaff <roretzla@linux.microsoft.com> To: dev@dpdk.org Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>, Bruce Richardson <bruce.richardson@intel.com>, Chengwen Feng <fengchengwen@huawei.com>, Cristian Dumitrescu <cristian.dumitrescu@intel.com>, David Christensen <drc@linux.vnet.ibm.com>, David Hunt <david.hunt@intel.com>, Ferruh Yigit <ferruh.yigit@amd.com>, Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>, Jasvinder Singh <jasvinder.singh@intel.com>, Jerin Jacob <jerinj@marvell.com>, Kevin Laatz <kevin.laatz@intel.com>, Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>, Min Zhou <zhoumin@loongson.cn>, Ruifeng Wang <ruifeng.wang@arm.com>, Sameh Gobriel <sameh.gobriel@intel.com>, Stanislaw Kardach <kda@semihalf.com>, Thomas Monjalon <thomas@monjalon.net>, Vladimir Medvedkin <vladimir.medvedkin@intel.com>, Yipeng Wang <yipeng1.wang@intel.com>, Tyler Retzlaff <roretzla@linux.microsoft.com> Subject: [PATCH v6 02/39] eal: redefine macro to be integer literal for MSVC Date: Mon, 26 Feb 2024 10:25:09 -0800 Message-Id: <1708971946-18231-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1708971946-18231-1-git-send-email-roretzla@linux.microsoft.com> References: <1707873986-29352-1-git-send-email-roretzla@linux.microsoft.com> <1708971946-18231-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
use C11 alignas
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
Commit Message
Tyler Retzlaff
Feb. 26, 2024, 6:25 p.m. UTC
MSVC __declspec(align(#)) is limited and accepts only integer literals as opposed to constant expressions. define XMM_SIZE to be 16 instead of sizeof(xmm_t) and static_assert that sizeof(xmm_t) == 16 for compatibility. Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> --- lib/eal/x86/include/rte_vect.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Comments
> Subject: [PATCH v6 02/39] eal: redefine macro to be integer literal for MSVC > > MSVC __declspec(align(#)) is limited and accepts only integer literals > as opposed to constant expressions. define XMM_SIZE to be 16 instead of > sizeof(xmm_t) and static_assert that sizeof(xmm_t) == 16 for > compatibility. > > Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com> > Acked-by: Morten Brørup <mb@smartsharesystems.com> > --- > lib/eal/x86/include/rte_vect.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/lib/eal/x86/include/rte_vect.h b/lib/eal/x86/include/rte_vect.h > index a1a537e..5ac3ccf 100644 > --- a/lib/eal/x86/include/rte_vect.h > +++ b/lib/eal/x86/include/rte_vect.h > @@ -11,6 +11,7 @@ > * RTE SSE/AVX related header. > */ > > +#include <assert.h> > #include <stdint.h> > #include <rte_config.h> > #include <rte_common.h> > @@ -33,9 +34,11 @@ > > typedef __m128i xmm_t; > > -#define XMM_SIZE (sizeof(xmm_t)) > +#define XMM_SIZE 16 > #define XMM_MASK (XMM_SIZE - 1) > > +static_assert(sizeof(xmm_t) == XMM_SIZE, ""); > + > typedef union rte_xmm { > xmm_t x; > uint8_t u8[XMM_SIZE / sizeof(uint8_t)]; > -- Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com> > 1.8.3.1
diff --git a/lib/eal/x86/include/rte_vect.h b/lib/eal/x86/include/rte_vect.h index a1a537e..5ac3ccf 100644 --- a/lib/eal/x86/include/rte_vect.h +++ b/lib/eal/x86/include/rte_vect.h @@ -11,6 +11,7 @@ * RTE SSE/AVX related header. */ +#include <assert.h> #include <stdint.h> #include <rte_config.h> #include <rte_common.h> @@ -33,9 +34,11 @@ typedef __m128i xmm_t; -#define XMM_SIZE (sizeof(xmm_t)) +#define XMM_SIZE 16 #define XMM_MASK (XMM_SIZE - 1) +static_assert(sizeof(xmm_t) == XMM_SIZE, ""); + typedef union rte_xmm { xmm_t x; uint8_t u8[XMM_SIZE / sizeof(uint8_t)];