8#ifndef INCLUDED_BSLS_ATOMICOPERATIONS_POWERPC_AIX_XLC_DEFAULT
9#define INCLUDED_BSLS_ATOMICOPERATIONS_POWERPC_AIX_XLC_DEFAULT
55#include <bsls_atomicoperations_default.h>
59#if defined(BSLS_PLATFORM_CPU_POWERPC) && defined(BSLS_PLATFORM_CMP_IBM)
68int AtomicOperations_Powerpc_GetInt(
const volatile int *atomicInt);
69int AtomicOperations_Powerpc_GetIntAcquire(
const volatile int *atomicInt);
70void AtomicOperations_Powerpc_SetInt(
volatile int *atomicInt,
int value);
71void AtomicOperations_Powerpc_SetIntRelease(
volatile int *atomicInt,
73int AtomicOperations_Powerpc_SwapInt(
volatile int *atomicInt,
75int AtomicOperations_Powerpc_SwapIntAcqRel(
volatile int *atomicInt,
77int AtomicOperations_Powerpc_TestAndSwapInt(
volatile int *atomicInt,
80int AtomicOperations_Powerpc_TestAndSwapIntAcqRel(
volatile int *atomicInt,
83int AtomicOperations_Powerpc_AddInt(
volatile int *atomicInt,
int value);
84int AtomicOperations_Powerpc_AddIntAcqRel(
volatile int *atomicInt,
91template <
typename IMP>
92struct AtomicOperations_POWERPC_AIX_XLC_DefaultInt
93 : AtomicOperations_DefaultInt<IMP>
95 typedef Atomic_TypeTraits<IMP> AtomicTypes;
99 static int getInt(
typename AtomicTypes::Int
const *atomicInt);
101 static int getIntAcquire(
typename AtomicTypes::Int
const *atomicInt);
103 static void setInt(
typename AtomicTypes::Int *atomicInt,
int value);
105 static void setIntRelease(
typename AtomicTypes::Int *atomicInt,
int value);
107 static int swapInt(
typename AtomicTypes::Int *atomicInt,
int swapValue);
109 static int swapIntAcqRel(
typename AtomicTypes::Int *atomicInt,
int swapValue);
111 static int testAndSwapInt(
typename AtomicTypes::Int *atomicInt,
115 static int testAndSwapIntAcqRel(
typename AtomicTypes::Int *atomicInt,
119 static int addIntNv(
typename AtomicTypes::Int *atomicInt,
int value);
121 static int addIntNvRelaxed(
typename AtomicTypes::Int *atomicInt,
int value);
123 static int addIntNvAcqRel(
typename AtomicTypes::Int *atomicInt,
int value);
130template <
typename IMP>
131struct AtomicOperations_POWERPC_AIX_XLC_Default32
132 : AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>
133 , AtomicOperations_DefaultInt64<IMP>
134 , AtomicOperations_DefaultUint<IMP>
135 , AtomicOperations_DefaultUint64<IMP>
136 , AtomicOperations_DefaultPointer32<IMP>
143template <
typename IMP>
144struct AtomicOperations_POWERPC_AIX_XLC_Default64
145 : AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>
146 , AtomicOperations_DefaultInt64<IMP>
147 , AtomicOperations_DefaultUint<IMP>
148 , AtomicOperations_DefaultUint64<IMP>
149 , AtomicOperations_DefaultPointer64<IMP>
160template <
typename IMP>
162int AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>::
163 getInt(
typename AtomicTypes::Int
const *atomicInt)
165 return AtomicOperations_Powerpc_GetInt(&atomicInt->d_value);
168template <
typename IMP>
170int AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>::
171 getIntAcquire(
typename AtomicTypes::Int
const *atomicInt)
173 return AtomicOperations_Powerpc_GetIntAcquire(&atomicInt->d_value);
176template <
typename IMP>
178void AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>::
179 setInt(
typename AtomicTypes::Int *atomicInt,
int value)
181 AtomicOperations_Powerpc_SetInt(&atomicInt->d_value, value);
184template <
typename IMP>
186void AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>::
187 setIntRelease(
typename AtomicTypes::Int *atomicInt,
int value)
189 AtomicOperations_Powerpc_SetIntRelease(&atomicInt->d_value, value);
192template <
typename IMP>
194int AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>::
195 swapInt(
typename AtomicTypes::Int *atomicInt,
int swapValue)
197 return AtomicOperations_Powerpc_SwapInt(&atomicInt->d_value,
201template <
typename IMP>
203int AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>::
204 swapIntAcqRel(
typename AtomicTypes::Int *atomicInt,
int swapValue)
206 return AtomicOperations_Powerpc_SwapIntAcqRel(&atomicInt->d_value,
210template <
typename IMP>
212int AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>::
213 testAndSwapInt(
typename AtomicTypes::Int *atomicInt,
217 return AtomicOperations_Powerpc_TestAndSwapInt(&atomicInt->d_value,
222template <
typename IMP>
224int AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>::
225 testAndSwapIntAcqRel(
typename AtomicTypes::Int *atomicInt,
229 return AtomicOperations_Powerpc_TestAndSwapIntAcqRel(
235template <
typename IMP>
237int AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>::
238 addIntNv(
typename AtomicTypes::Int *atomicInt,
int value)
240 return AtomicOperations_Powerpc_AddInt(&atomicInt->d_value, value);
243template <
typename IMP>
245int AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>::
246 addIntNvRelaxed(
typename AtomicTypes::Int *atomicInt,
int value)
248 return __fetch_and_add(&atomicInt->d_value, value) + value;
251template <
typename IMP>
253int AtomicOperations_POWERPC_AIX_XLC_DefaultInt<IMP>::
254 addIntNvAcqRel(
typename AtomicTypes::Int *atomicInt,
int value)
256 return AtomicOperations_Powerpc_AddIntAcqRel(&atomicInt->d_value,
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlt_iso8601util.h:691