Implement char/short/int_fetch_and_add for msftc/x86[_64] (Win32)
authorIvan Maidanski <ivmai@mail.ru>
Mon, 8 Oct 2012 09:33:30 +0000 (13:33 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 8 Oct 2012 09:33:30 +0000 (13:33 +0400)
commit46425e19b4b0c84d0eb88313cdee9aa0d3a2fb89
tree01c9d71993b2e52e28135579efafc800ac1378d1
parent472ea60cc5df617cbee96ea567ea2fb18aa250a7
Implement char/short/int_fetch_and_add for msftc/x86[_64] (Win32)

* src/atomic_ops/sysdeps/msftc/x86.h (AO_NO_ASM_XADD): Recognize new
macro.
* src/atomic_ops/sysdeps/msftc/x86.h (AO_char_fetch_and_add_full,
AO_short_fetch_and_add_full): New primitive implemented using __asm
(only unless AO_NO_ASM_XADD).
* src/atomic_ops/sysdeps/msftc/x86.h (AO_HAVE_char_fetch_and_add_full,
AO_HAVE_short_fetch_and_add_full): New macro (accompanying the
corresponding primitive).
* src/atomic_ops/sysdeps/msftc/x86_64.h
(AO_HAVE_int_fetch_and_add_full, AO_HAVE_char_fetch_and_add_full,
AO_HAVE_short_fetch_and_add_full): Likewise.
* src/atomic_ops/sysdeps/msftc/x86_64.h (_InterlockedExchangeAdd): Add
pragma to specify the intrinsic.
* src/atomic_ops/sysdeps/msftc/x86_64.h (AO_int_fetch_and_add_full):
New primitive (implemented using 32-bit InterlockedExchangeAdd).
* src/atomic_ops/sysdeps/msftc/x86_64.h  (AO_char_fetch_and_add_full,
AO_short_fetch_and_add_full): New primitive implemented using 64-bit
__asm (only if AO_ASM_X64_AVAILABLE).
src/atomic_ops/sysdeps/msftc/x86.h
src/atomic_ops/sysdeps/msftc/x86_64.h