8#ifndef INCLUDED_BSLS_ATOMICOPERATIONS_POWERPC64_AIX_XLC
9#define INCLUDED_BSLS_ATOMICOPERATIONS_POWERPC64_AIX_XLC
54#include <bsls_atomicoperations_powerpc_aix_xlc_default.h>
58#if defined(BSLS_PLATFORM_CPU_POWERPC) && defined(BSLS_PLATFORM_CMP_IBM) \
59 && defined(BSLS_PLATFORM_CPU_64_BIT)
74void AtomicOperations_Powerpc64_SetInt64(
volatile Types::Int64 *atomicInt,
77void AtomicOperations_Powerpc64_SetInt64Release(
94Types::Int64 AtomicOperations_Powerpc64_testAndSwapInt64AcqRel(
107struct AtomicOperations_POWERPC64_AIX_XLC;
108typedef AtomicOperations_POWERPC64_AIX_XLC AtomicOperations_Imp;
115struct Atomic_TypeTraits<AtomicOperations_POWERPC64_AIX_XLC>
119 volatile int d_value __attribute__((__aligned__(
sizeof(
int))));
124 volatile Types::Int64 d_value
125 __attribute__((__aligned__(
sizeof(Types::Int64))));
130 volatile unsigned int d_value
131 __attribute__((__aligned__(
sizeof(
unsigned int))));
136 volatile Types::Uint64 d_value
137 __attribute__((__aligned__(
sizeof(Types::Uint64))));
142 void *
volatile d_value __attribute__((__aligned__(
sizeof(
void *))));
150struct AtomicOperations_POWERPC64_AIX_XLC
151 : AtomicOperations_POWERPC_AIX_XLC_Default64<
152 AtomicOperations_POWERPC64_AIX_XLC>
154 typedef Atomic_TypeTraits<AtomicOperations_POWERPC64_AIX_XLC>
159 static Types::Int64 getInt64(
const AtomicTypes::Int64 *atomicInt);
161 static Types::Int64 getInt64Relaxed(
const AtomicTypes::Int64 *atomicInt);
163 static Types::Int64 getInt64Acquire(
const AtomicTypes::Int64 *atomicInt);
165 static void setInt64(AtomicTypes::Int64 *atomicInt, Types::Int64 value);
167 static void setInt64Relaxed(AtomicTypes::Int64 *atomicInt,
170 static void setInt64Release(AtomicTypes::Int64 *atomicInt,
173 static Types::Int64 swapInt64(AtomicTypes::Int64 *atomicInt,
174 Types::Int64 swapValue);
176 static Types::Int64 swapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
177 Types::Int64 swapValue);
179 static Types::Int64 testAndSwapInt64(AtomicTypes::Int64 *atomicInt,
180 Types::Int64 compareValue,
181 Types::Int64 swapValue);
183 static Types::Int64 testAndSwapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
184 Types::Int64 compareValue,
185 Types::Int64 swapValue);
187 static Types::Int64 addInt64Nv(AtomicTypes::Int64 *atomicInt,
190 static Types::Int64 addInt64NvRelaxed(AtomicTypes::Int64 *atomicInt,
193 static Types::Int64 addInt64NvAcqRel(AtomicTypes::Int64 *atomicInt,
207 getInt64(
const AtomicTypes::Int64 *atomicInt)
209 return AtomicOperations_Powerpc64_GetInt64(&atomicInt->d_value);
214 getInt64Relaxed(
const AtomicTypes::Int64 *atomicInt)
216 return atomicInt->d_value;
221 getInt64Acquire(
const AtomicTypes::Int64 *atomicInt)
223 return AtomicOperations_Powerpc64_GetInt64Acquire(&atomicInt->d_value);
227void AtomicOperations_POWERPC64_AIX_XLC::
228 setInt64(AtomicTypes::Int64 *atomicInt,
Types::Int64 value)
230 AtomicOperations_Powerpc64_SetInt64(&atomicInt->d_value, value);
234void AtomicOperations_POWERPC64_AIX_XLC::
235 setInt64Relaxed(AtomicTypes::Int64 *atomicInt,
Types::Int64 value)
237 atomicInt->d_value = value;
241void AtomicOperations_POWERPC64_AIX_XLC::
242 setInt64Release(AtomicTypes::Int64 *atomicInt,
Types::Int64 value)
244 AtomicOperations_Powerpc64_SetInt64Release(&atomicInt->d_value,
250 swapInt64(AtomicTypes::Int64 *atomicInt,
253 return AtomicOperations_Powerpc64_SwapInt64(&atomicInt->d_value,
259 swapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
262 return AtomicOperations_Powerpc64_SwapInt64AcqRel(&atomicInt->d_value,
268 testAndSwapInt64(AtomicTypes::Int64 *atomicInt,
272 return AtomicOperations_Powerpc64_testAndSwapInt64(&atomicInt->d_value,
279 testAndSwapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
283 return AtomicOperations_Powerpc64_testAndSwapInt64AcqRel(
291 addInt64Nv(AtomicTypes::Int64 *atomicInt,
294 return AtomicOperations_Powerpc64_AddInt64(&atomicInt->d_value,
300 addInt64NvRelaxed(AtomicTypes::Int64 *atomicInt,
303 return __fetch_and_addlp(
304 reinterpret_cast<volatile long *
>(&atomicInt->d_value),
305 static_cast<long>(value))
311 addInt64NvAcqRel(AtomicTypes::Int64 *atomicInt,
314 return AtomicOperations_Powerpc64_AddInt64AcqRel(&atomicInt->d_value,
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlt_iso8601util.h:691
long long Int64
Definition bsls_types.h:132