summaryrefslogtreecommitdiff
path: root/src/atomic_ops/sysdeps/gcc/avr32.h
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-12-08 16:39:56 +0400
committerIvan Maidanski <ivmai@mail.ru>2011-12-08 16:39:56 +0400
commita6d9efc45938225665f7708f98a81fb6a7724f0f (patch)
tree226daa2a700b586980ef400db31c5178489d70bc /src/atomic_ops/sysdeps/gcc/avr32.h
parent9a9c43a0ff7f36c4326f696efc31579dd141156d (diff)
downloadlibatomic_ops-a6d9efc45938225665f7708f98a81fb6a7724f0f.tar.gz
Add new macro (AO_PREFER_GENERALIZED) to favor generalized primitives
over direct assembly-based ones * configure.ac (AO_PREFER_GENERALIZED): New AC template. * src/atomic_ops/sysdeps/armcc/arm_v6.h (AO_test_and_set, AO_HAVE_test_and_set, AO_fetch_and_add, AO_HAVE_fetch_and_add, AO_fetch_and_add1, AO_HAVE_fetch_and_add1, AO_fetch_and_sub1, AO_HAVE_fetch_and_sub1): Do not define if AO_PREFER_GENERALIZED. * src/atomic_ops/sysdeps/gcc/arm.h (AO_test_and_set, AO_HAVE_test_and_set, AO_fetch_and_add, AO_HAVE_fetch_and_add, AO_fetch_and_add1, AO_HAVE_fetch_and_add1, AO_fetch_and_sub1, AO_HAVE_fetch_and_sub1): Likewise. * src/atomic_ops/sysdeps/gcc/avr32.h (AO_test_and_set_full, AO_HAVE_test_and_set_full): Likewise. * src/atomic_ops/sysdeps/gcc/hexagon.h (AO_fetch_and_add, AO_HAVE_fetch_and_add, AO_test_and_set, AO_HAVE_test_and_set): Likewise. * src/atomic_ops/sysdeps/gcc/ia64.h (AO_fetch_and_add1_acquire, AO_HAVE_fetch_and_add1_acquire, AO_fetch_and_add1_release, AO_HAVE_fetch_and_add1_release, AO_fetch_and_sub1_acquire, AO_HAVE_fetch_and_sub1_acquire, AO_fetch_and_sub1_release, AO_HAVE_fetch_and_sub1_release, AO_int_fetch_and_add1_acquire, AO_HAVE_int_fetch_and_add1_acquire, AO_int_fetch_and_add1_release, AO_HAVE_int_fetch_and_add1_release, AO_int_fetch_and_sub1_acquire, AO_HAVE_int_fetch_and_sub1_acquire, AO_int_fetch_and_sub1_release, AO_HAVE_int_fetch_and_sub1_release): Likewise. * src/atomic_ops/sysdeps/gcc/powerpc.h (AO_test_and_set, AO_HAVE_test_and_set, AO_test_and_set_acquire, AO_HAVE_test_and_set_acquire, AO_test_and_set_release, AO_HAVE_test_and_set_release, AO_test_and_set_full, AO_HAVE_test_and_set_full): Likewise. * src/atomic_ops/sysdeps/gcc/x86.h (AO_fetch_and_add_full, AO_HAVE_fetch_and_add_full, AO_and_full, AO_HAVE_and_full, AO_or_full, AO_HAVE_or_full, AO_xor_full, AO_HAVE_xor_full): Likewise. * src/atomic_ops/sysdeps/gcc/x86_64.h (AO_fetch_and_add_full, AO_HAVE_fetch_and_add_full, AO_and_full, AO_HAVE_and_full, AO_or_full, AO_HAVE_or_full, AO_xor_full, AO_HAVE_xor_full): Likewise. * src/atomic_ops/sysdeps/hpc/ia64.h (AO_fetch_and_add1_acquire, AO_HAVE_fetch_and_add1_acquire, AO_fetch_and_add1_release, AO_HAVE_fetch_and_add1_release, AO_fetch_and_sub1_acquire, AO_HAVE_fetch_and_sub1_acquire, AO_fetch_and_sub1_release, AO_HAVE_fetch_and_sub1_release): Likewise. * src/atomic_ops/sysdeps/ibmc/powerpc.h (AO_test_and_set_acquire, AO_HAVE_test_and_set_acquire, AO_test_and_set_release, AO_HAVE_test_and_set_release, AO_test_and_set_full, AO_HAVE_test_and_set_full): Likewise. * src/atomic_ops/sysdeps/icc/ia64.h (AO_fetch_and_add1_acquire, AO_HAVE_fetch_and_add1_acquire, AO_fetch_and_add1_release, AO_HAVE_fetch_and_add1_release, AO_fetch_and_sub1_acquire, AO_HAVE_fetch_and_sub1_acquire, AO_fetch_and_sub1_release, AO_HAVE_fetch_and_sub1_release): Likewise. * src/atomic_ops/sysdeps/msftc/x86_64.h (AO_fetch_and_add_full, AO_HAVE_fetch_and_add_full, AO_fetch_and_add1_full, AO_HAVE_fetch_and_add1_full, AO_fetch_and_sub1_full, AO_HAVE_fetch_and_sub1_full): Likewise. * src/atomic_ops/sysdeps/sunc/x86.h (AO_fetch_and_add_full, AO_HAVE_fetch_and_add_full, AO_and_full, AO_HAVE_and_full, AO_or_full, AO_HAVE_or_full, AO_xor_full, AO_HAVE_xor_full): Likewise. * src/atomic_ops/sysdeps/sunc/x86_64.h (AO_fetch_and_add_full, AO_HAVE_fetch_and_add_full, AO_and_full, AO_HAVE_and_full, AO_or_full, AO_HAVE_or_full, AO_xor_full, AO_HAVE_xor_full): Likewise. * src/atomic_ops/sysdeps/gcc/arm.h (AO_test_and_set_full, AO_HAVE_test_and_set_full): Do not define if AO_PREFER_GENERALIZED (but only in case of ARMv6+). * src/atomic_ops/sysdeps/msftc/common32_defs.h (_InterlockedIncrement, _InterlockedDecrement, _InterlockedExchangeAdd): Do not declare intrinsic if both AO_PREFER_GENERALIZED and AO_ASSUME_WINDOWS98. * src/atomic_ops/sysdeps/msftc/common32_defs.h (AO_fetch_and_add_full, AO_HAVE_fetch_and_add_full, AO_fetch_and_add1_full, AO_HAVE_fetch_and_add1_full, AO_fetch_and_sub1_full, AO_HAVE_fetch_and_sub1_full): Do not define if both AO_PREFER_GENERALIZED and AO_ASSUME_WINDOWS98. * src/atomic_ops/sysdeps/msftc/x86_64.h (_InterlockedIncrement64, _InterlockedDecrement64, _InterlockedExchangeAdd64): Do not declare intrinsic if AO_PREFER_GENERALIZED.
Diffstat (limited to 'src/atomic_ops/sysdeps/gcc/avr32.h')
-rw-r--r--src/atomic_ops/sysdeps/gcc/avr32.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/atomic_ops/sysdeps/gcc/avr32.h b/src/atomic_ops/sysdeps/gcc/avr32.h
index c1bf56c..c5a12a3 100644
--- a/src/atomic_ops/sysdeps/gcc/avr32.h
+++ b/src/atomic_ops/sysdeps/gcc/avr32.h
@@ -28,9 +28,10 @@
#include "../test_and_set_t_is_ao_t.h"
-AO_INLINE AO_TS_VAL_t
-AO_test_and_set_full(volatile AO_TS_t *addr)
-{
+#ifndef AO_PREFER_GENERALIZED
+ AO_INLINE AO_TS_VAL_t
+ AO_test_and_set_full(volatile AO_TS_t *addr)
+ {
register long ret;
__asm__ __volatile__(
@@ -40,8 +41,9 @@ AO_test_and_set_full(volatile AO_TS_t *addr)
: "memory");
return (AO_TS_VAL_t)ret;
-}
-#define AO_HAVE_test_and_set_full
+ }
+# define AO_HAVE_test_and_set_full
+#endif /* !AO_PREFER_GENERALIZED */
AO_INLINE int
AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val)