From patchwork Sat Feb 11 01:56:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 123714 X-Patchwork-Delegate: thomas@monjalon.net 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 E48D041C64; Sat, 11 Feb 2023 02:56:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7618240E50; Sat, 11 Feb 2023 02:56:45 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 7EFD040E0F; Sat, 11 Feb 2023 02:56:43 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 79E8D4B3; Fri, 10 Feb 2023 17:57:25 -0800 (PST) Received: from 2p2660v4-1.austin.arm.com (2p2660v4-1.austin.arm.com [10.118.14.10]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D197B3F703; Fri, 10 Feb 2023 17:56:42 -0800 (PST) From: Honnappa Nagarahalli To: roretzla@linux.microsoft.com, bruce.richardson@intel.com, mb@smartsharesystems.com Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com, jerinj@marvell.com, nd@arm.com, stable@dpdk.org, pbhagavatula@marvell.com Subject: [RFC] eal: use same atomic intrinsics for gcc and clang Date: Fri, 10 Feb 2023 19:56:22 -0600 Message-Id: <20230211015622.408487-1-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.25.1 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 The size generic atomic intrinsics generate the same code as the size specific intrinsics for gcc. Use size generic intrinsics for both gcc and clang. Fixes: 7bdccb93078e ("eal: fix ARM build with clang") Cc: stable@dpdk.org Cc: pbhagavatula@marvell.com Signed-off-by: Honnappa Nagarahalli Acked-by: Morten Brørup Acked-by: Tyler Retzlaff Reviewed-by: Ruifeng Wang --- lib/eal/include/generic/rte_atomic.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/generic/rte_atomic.h index f5c49a9870..234b268b91 100644 --- a/lib/eal/include/generic/rte_atomic.h +++ b/lib/eal/include/generic/rte_atomic.h @@ -176,11 +176,7 @@ rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val); static inline uint16_t rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val) { -#if defined(__clang__) return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST); -#else - return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST); -#endif } #endif @@ -459,11 +455,7 @@ rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val); static inline uint32_t rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val) { -#if defined(__clang__) return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST); -#else - return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST); -#endif } #endif @@ -741,11 +733,7 @@ rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val); static inline uint64_t rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val) { -#if defined(__clang__) return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST); -#else - return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST); -#endif } #endif