29#include "../all_atomic_load_store.h"
31#include "../test_and_set_t_is_char.h"
33#include <ia64intrin.h>
39#define AO_INTEL_PTR_t void *
46#define AO_HAVE_load_acquire
53#define AO_HAVE_store_release
61#define AO_HAVE_char_load_acquire
68#define AO_HAVE_char_store_release
76#define AO_HAVE_short_load_acquire
83#define AO_HAVE_short_store_release
91#define AO_HAVE_int_load_acquire
98#define AO_HAVE_int_store_release
105#define AO_HAVE_nop_full
107#ifndef AO_PREFER_GENERALIZED
111 return __fetchadd8_acq((
unsigned __int64 *)p, 1);
113#define AO_HAVE_fetch_and_add1_acquire
118 return __fetchadd8_rel((
unsigned __int64 *)p, 1);
120#define AO_HAVE_fetch_and_add1_release
125 return __fetchadd8_acq((
unsigned __int64 *)p, -1);
127#define AO_HAVE_fetch_and_sub1_acquire
132 return __fetchadd8_rel((
unsigned __int64 *)p, -1);
134#define AO_HAVE_fetch_and_sub1_release
141 return _InterlockedCompareExchange64_acq(addr, new_val, old_val);
143#define AO_HAVE_fetch_compare_and_swap_acquire
149 return _InterlockedCompareExchange64_rel(addr, new_val, old_val);
151#define AO_HAVE_fetch_compare_and_swap_release
155 unsigned char old_val,
156 unsigned char new_val)
158 return _InterlockedCompareExchange8_acq(addr, new_val, old_val);
160#define AO_HAVE_char_fetch_compare_and_swap_acquire
164 unsigned char old_val,
165 unsigned char new_val)
167 return _InterlockedCompareExchange8_rel(addr, new_val, old_val);
169#define AO_HAVE_char_fetch_compare_and_swap_release
173 unsigned short old_val,
174 unsigned short new_val)
176 return _InterlockedCompareExchange16_acq(addr, new_val, old_val);
178#define AO_HAVE_short_fetch_compare_and_swap_acquire
182 unsigned short old_val,
183 unsigned short new_val)
185 return _InterlockedCompareExchange16_rel(addr, new_val, old_val);
187#define AO_HAVE_short_fetch_compare_and_swap_release
191 unsigned int old_val,
192 unsigned int new_val)
194 return _InterlockedCompareExchange_acq(addr, new_val, old_val);
196#define AO_HAVE_int_fetch_compare_and_swap_acquire
200 unsigned int old_val,
201 unsigned int new_val)
203 return _InterlockedCompareExchange_rel(addr, new_val, old_val);
205#define AO_HAVE_int_fetch_compare_and_swap_release
AO_INLINE void AO_int_store_release(volatile unsigned int *p, unsigned int val)
AO_INLINE unsigned short AO_short_fetch_compare_and_swap_acquire(volatile unsigned short *addr, unsigned short old_val, unsigned short new_val)
AO_INLINE unsigned int AO_int_fetch_compare_and_swap_acquire(volatile unsigned int *addr, unsigned int old_val, unsigned int new_val)
AO_INLINE AO_t AO_fetch_compare_and_swap_release(volatile AO_t *addr, AO_t old_val, AO_t new_val)
AO_INLINE AO_t AO_load_acquire(const volatile AO_t *p)
AO_INLINE unsigned char AO_char_load_acquire(const volatile unsigned char *p)
AO_INLINE unsigned short AO_short_load_acquire(const volatile unsigned short *p)
AO_INLINE void AO_store_release(volatile AO_t *p, AO_t val)
AO_INLINE unsigned int AO_int_load_acquire(const volatile unsigned int *p)
AO_INLINE void AO_char_store_release(volatile unsigned char *p, unsigned char val)
AO_INLINE AO_t AO_fetch_and_sub1_release(volatile AO_t *p)
AO_INLINE unsigned char AO_char_fetch_compare_and_swap_release(volatile unsigned char *addr, unsigned char old_val, unsigned char new_val)
AO_INLINE unsigned int AO_int_fetch_compare_and_swap_release(volatile unsigned int *addr, unsigned int old_val, unsigned int new_val)
AO_INLINE AO_t AO_fetch_and_add1_acquire(volatile AO_t *p)
AO_INLINE AO_t AO_fetch_and_sub1_acquire(volatile AO_t *p)
AO_INLINE unsigned short AO_short_fetch_compare_and_swap_release(volatile unsigned short *addr, unsigned short old_val, unsigned short new_val)
AO_INLINE AO_t AO_fetch_and_add1_release(volatile AO_t *p)
AO_INLINE unsigned char AO_char_fetch_compare_and_swap_acquire(volatile unsigned char *addr, unsigned char old_val, unsigned char new_val)
AO_INLINE void AO_short_store_release(volatile unsigned short *p, unsigned short val)
AO_INLINE AO_t AO_fetch_compare_and_swap_acquire(volatile AO_t *addr, AO_t old_val, AO_t new_val)
AO_INLINE void AO_nop_full(void)