[RFC] eal: use same atomic intrinsics for gcc and clang

Honnappa Nagarahalli honnappa.nagarahalli at arm.com
Sat Feb 11 02:56:22 CET 2023


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 at dpdk.org
Cc: pbhagavatula at marvell.com

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
---
 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



More information about the stable mailing list