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 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 ; 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 To: dev@dpdk.org Cc: Andrew Rybchenko , Bruce Richardson , Chengwen Feng , Cristian Dumitrescu , David Christensen , David Hunt , Ferruh Yigit , Honnappa Nagarahalli , Jasvinder Singh , Jerin Jacob , Kevin Laatz , Konstantin Ananyev , Min Zhou , Ruifeng Wang , Sameh Gobriel , Stanislaw Kardach , Thomas Monjalon , Vladimir Medvedkin , Yipeng Wang , Tyler Retzlaff 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Acked-by: Morten Brørup --- 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 #include #include #include @@ -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)]; -- 1.8.3.1