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 F0BD541C8C; Mon, 13 Feb 2023 21:01:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8AFD542D65; Mon, 13 Feb 2023 21:01:07 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 3363642D43; Mon, 13 Feb 2023 21:01:06 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 8412420C8B7E; Mon, 13 Feb 2023 12:01:05 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8412420C8B7E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1676318465; bh=i49UpfGplnqjF059MxPWtpGT2NtoyrtxGchIAknLhhg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fXmuxjVrRqTy+3zTKbghoEsIwbDHII0Bogxx3eRs4LygarUUawkmEi9j/Jn3nbJtv ij6EQ/Ri4TmLB0lbIi39+nU+/bq8M0rWXaAS8C6cCzjOXEg/rZ0GlC/SZs9IRzwBCY mOV6KQsIoNmgw+WztPgo7kSeRYlnAYaCyEMkQZvU= Date: Mon, 13 Feb 2023 12:01:05 -0800 From: Tyler Retzlaff To: Honnappa Nagarahalli Cc: bruce.richardson@intel.com, mb@smartsharesystems.com, dev@dpdk.org, ruifeng.wang@arm.com, jerinj@marvell.com, nd@arm.com, stable@dpdk.org, pbhagavatula@marvell.com Subject: Re: [RFC] eal: use same atomic intrinsics for gcc and clang Message-ID: <20230213200105.GA24482@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20230211015622.408487-1-honnappa.nagarahalli@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230211015622.408487-1-honnappa.nagarahalli@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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 On Fri, Feb 10, 2023 at 07:56:22PM -0600, Honnappa Nagarahalli wrote: > 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: Tyler Retzlaff so first of all thanks for fixing this up. it was confusing me why it was being conditionally compiled (there was no documented rationale). i do have a slight concern that perhaps the reason this was done was because __atomic_exchange_n on some gcc versions or for some specific target processor was generating less than desirable code but if nobody else has this concern i won't get in the way since it simplifies things. thanks! > --- > 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