diff options
author | ivmai <ivmai> | 2011-06-27 06:48:12 +0000 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2011-07-25 16:03:27 +0400 |
commit | d923334022938240c43c167d66549b1211aed2ba (patch) | |
tree | 476efb598932678b9a779d9d3c8138ace7910460 | |
parent | 43ef167a875a589332b5f333a672212718f56174 (diff) | |
download | libatomic_ops-d923334022938240c43c167d66549b1211aed2ba.tar.gz |
2011-06-27 Ivan Maidanski <ivmai@mail.ru> (really Jeremy Huddleston)
* src/atomic_ops/sysdeps/gcc/x86.h (AO_test_and_set_full):
Explicitly cast 0xff to unsigned char (otherwise LLVM v2.7 GAS
reports an error); don't recognize AO_XCHGB_RET_WORD.
* src/atomic_ops/sysdeps/gcc/x86_64.h (AO_test_and_set_full):
Ditto.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/atomic_ops/sysdeps/gcc/x86.h | 9 | ||||
-rw-r--r-- | src/atomic_ops/sysdeps/gcc/x86_64.h | 9 |
3 files changed, 12 insertions, 14 deletions
@@ -1,3 +1,11 @@ +2011-06-27 Ivan Maidanski <ivmai@mail.ru> (really Jeremy Huddleston) + + * src/atomic_ops/sysdeps/gcc/x86.h (AO_test_and_set_full): + Explicitly cast 0xff to unsigned char (otherwise LLVM v2.7 GAS + reports an error); don't recognize AO_XCHGB_RET_WORD. + * src/atomic_ops/sysdeps/gcc/x86_64.h (AO_test_and_set_full): + Ditto. + 2011-06-15 Ivan Maidanski <ivmai@mail.ru> * configure.ac, README: Change to version 7.2alpha7. diff --git a/src/atomic_ops/sysdeps/gcc/x86.h b/src/atomic_ops/sysdeps/gcc/x86.h index 5e6d7fa..807afc1 100644 --- a/src/atomic_ops/sysdeps/gcc/x86.h +++ b/src/atomic_ops/sysdeps/gcc/x86.h @@ -104,16 +104,11 @@ AO_or_full (volatile AO_t *p, AO_t incr) AO_INLINE AO_TS_VAL_t AO_test_and_set_full(volatile AO_TS_t *addr) { -# ifdef AO_XCHGB_RET_WORD - /* Workaround for a bug in LLVM v2.7 GAS. */ - unsigned oldval; -# else - unsigned char oldval; -# endif + unsigned char oldval; /* Note: the "xchg" instruction does not need a "lock" prefix */ __asm__ __volatile__("xchgb %0, %1" : "=q"(oldval), "=m"(*addr) - : "0"(0xff), "m"(*addr) : "memory"); + : "0"((unsigned char)0xff), "m"(*addr) : "memory"); return (AO_TS_VAL_t)oldval; } #define AO_HAVE_test_and_set_full diff --git a/src/atomic_ops/sysdeps/gcc/x86_64.h b/src/atomic_ops/sysdeps/gcc/x86_64.h index 0f68c1e..3cbe76e 100644 --- a/src/atomic_ops/sysdeps/gcc/x86_64.h +++ b/src/atomic_ops/sysdeps/gcc/x86_64.h @@ -101,16 +101,11 @@ AO_or_full (volatile AO_t *p, AO_t incr) AO_INLINE AO_TS_VAL_t AO_test_and_set_full(volatile AO_TS_t *addr) { -# ifdef AO_XCHGB_RET_WORD - /* Workaround for a bug in LLVM v2.7 GAS. */ - unsigned oldval; -# else - unsigned char oldval; -# endif + unsigned char oldval; /* Note: the "xchg" instruction does not need a "lock" prefix */ __asm__ __volatile__("xchgb %0, %1" : "=q"(oldval), "=m"(*addr) - : "0"(0xff), "m"(*addr) : "memory"); + : "0"((unsigned char)0xff), "m"(*addr) : "memory"); return (AO_TS_VAL_t)oldval; } #define AO_HAVE_test_and_set_full |