From patchwork Mon Mar 4 17:52:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 137917 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: 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 616BA43B9B; Mon, 4 Mar 2024 18:53:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22E2940F1A; Mon, 4 Mar 2024 18:52:57 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 347A440E78 for ; Mon, 4 Mar 2024 18:52:51 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 227E520B74C2; Mon, 4 Mar 2024 09:52:50 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 227E520B74C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1709574770; bh=KfpOn60kX6C72eRj8JVe6yxrSBFG7Aajh4KRrpCIZaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hYg0/VETmnKJIUKh1ycPlP2SnUL0hD6LSVzZlefj2zBGvzyS+Q4q//WCigl5clCDl brfJs3zPjgPTqSi53BUGNl6oI3EREVGYgFfgc9ZhPErpO8WmTplDI75LiGDprH1/ho qKeZBUSqfVkNmo2ZHYQmEM5Q4AJ7exnQfvWi40DA= 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 v7 02/39] eal: redefine macro to be integer literal for MSVC Date: Mon, 4 Mar 2024 09:52:07 -0800 Message-Id: <1709574764-9041-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709574764-9041-1-git-send-email-roretzla@linux.microsoft.com> References: <1707873986-29352-1-git-send-email-roretzla@linux.microsoft.com> <1709574764-9041-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 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 Acked-by: Konstantin Ananyev --- 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)];