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 9BA3945F5D; Sat, 28 Dec 2024 02:23:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 349A740280; Sat, 28 Dec 2024 02:23:12 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 977F24021F for ; Sat, 28 Dec 2024 02:23:10 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id CE4352047212; Fri, 27 Dec 2024 17:23:09 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com CE4352047212 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1735348989; bh=lweUBe6OdH6HC+lFeShzbtI/m/fm5AotKw1/QOGbZC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K9zw10+Q2CcbnMfLAwQINP8sk1V9LsRlUkIqqE5NH76juRl9uLnvZ8iN+RdBU8A35 TeHc3tkefXaBId6v3CHhawj7WHPazZLThyrvfsHWhmBugstryUQOKd04qVWAvsEgTi T8VmR0TeBHGvCLRZXXgvovnXBL0d+2cmcZoTKoJ4= From: Andre Muezerie To: andremue@linux.microsoft.com Cc: bruce.richardson@intel.com, dev@dpdk.org, konstantin.v.ananyev@yandex.ru, vattunuru@marvell.com Subject: [PATCH v2] drivers/net: use intrinsic to access content of __m128i Date: Fri, 27 Dec 2024 17:23:03 -0800 Message-Id: <1735348983-19590-1-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1735328684-10684-1-git-send-email-andremue@linux.microsoft.com> References: <1735328684-10684-1-git-send-email-andremue@linux.microsoft.com> 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 Compiler intrinsics should be used to access/manipulate contents of __m128i. Existing code results in the error below when compiled with MSVC: ../drivers/net/octeon_ep/cnxk_ep_rx_sse.c(61): error C2440: 'type cast': cannot convert from '__m128i' to 'rte_xmm_t' The fix is to use an intrinsic instead. This compiles fine with gcc, clang and msvc. Signed-off-by: Andre Muezerie --- drivers/net/octeon_ep/cnxk_ep_rx_sse.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/octeon_ep/cnxk_ep_rx_sse.c b/drivers/net/octeon_ep/cnxk_ep_rx_sse.c index fbd1f73c1e..d17ec46211 100644 --- a/drivers/net/octeon_ep/cnxk_ep_rx_sse.c +++ b/drivers/net/octeon_ep/cnxk_ep_rx_sse.c @@ -58,10 +58,21 @@ cnxk_ep_process_pkts_vec_sse(struct rte_mbuf **rx_pkts, struct otx_ep_droq *droq s23 = _mm_shuffle_epi8(s23, cpy_mask); /* Store packet length and data length to mbuf. */ +#ifdef RTE_ARCH_64 + *(uint64_t *)&m0->pkt_len = _mm_extract_epi64(s01, 0); + *(uint64_t *)&m1->pkt_len = _mm_extract_epi64(s01, 1); + *(uint64_t *)&m2->pkt_len = _mm_extract_epi64(s23, 0); + *(uint64_t *)&m3->pkt_len = _mm_extract_epi64(s23, 1); +#else + /* _mm_extract_epi64 is only available on 64-bit architecture. + * The cast below is non-portable and results in compile error + * using MSVC. + */ *(uint64_t *)&m0->pkt_len = ((rte_xmm_t)s01).u64[0]; *(uint64_t *)&m1->pkt_len = ((rte_xmm_t)s01).u64[1]; *(uint64_t *)&m2->pkt_len = ((rte_xmm_t)s23).u64[0]; *(uint64_t *)&m3->pkt_len = ((rte_xmm_t)s23).u64[1]; +#endif /* Reset rearm data. */ *(uint64_t *)&m0->rearm_data = droq->rearm_data; -- 2.47.0.vfs.0.3