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 3BF3D41CC5; Sat, 18 Feb 2023 02:58:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A44A41101; Sat, 18 Feb 2023 02:58:27 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 2FB6C400EF; Sat, 18 Feb 2023 02:58:26 +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 297DC1042; Fri, 17 Feb 2023 17:59:08 -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 3B4413F881; Fri, 17 Feb 2023 17:58:25 -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, Ola Liljedahl Subject: [PATCH] eal: use same atomic intrinsics for gcc and clang Date: Fri, 17 Feb 2023 19:58:03 -0600 Message-Id: <20230218015803.1676415-1-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230211015622.408487-1-honnappa.nagarahalli@arm.com> References: <20230211015622.408487-1-honnappa.nagarahalli@arm.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 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 Reviewed-by: Ola Liljedahl Reviewed-by: Ruifeng Wang Acked-by: Morten Brørup Acked-by: Tyler Retzlaff --- 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 -- 2.25.1