Fix bug 11291: add *mem as atomic operation output for MIPS.

This commit is contained in:
Mischa Jonker 2010-03-23 15:03:10 +00:00 committed by Joseph Myers
parent 92dd2ecf16
commit 1eb0725631
2 changed files with 36 additions and 26 deletions

View File

@ -1,3 +1,13 @@
2010-03-23 Mischa Jonker <mischa.jonker@viragelogic.com>
[BZ #11291]
* sysdeps/mips/bits/atomic.h
(__arch_compare_and_exchange_xxx_32_int,
__arch_compare_and_exchange_xxx_64_int,
__arch_exchange_xxx_32_int, __arch_exchange_xxx_64_int,
__arch_exchange_and_add_32_int, __arch_exchange_and_add_64_int):
Specify *mem as asm output as well as input.
2010-02-10 Joseph Myers <joseph@codesourcery.com>
* sysdeps/mips/fpu/fegetenv.c: Add hidden alias.

View File

@ -69,16 +69,16 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\t" \
"ll %0,%4\n\t" \
"ll %0,%5\n\t" \
"move %1,$0\n\t" \
"bne %0,%2,2f\n\t" \
"move %1,%3\n\t" \
"sc %1,%4\n\t" \
"bne %0,%3,2f\n\t" \
"move %1,%4\n\t" \
"sc %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
: "=&r" (__prev), "=&r" (__cmp) \
: "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (oldval), "r" (newval), "m" (*mem) \
: "memory")
@ -93,16 +93,16 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\t" \
"lld %0,%4\n\t" \
"lld %0,%5\n\t" \
"move %1,$0\n\t" \
"bne %0,%2,2f\n\t" \
"move %1,%3\n\t" \
"scd %1,%4\n\t" \
"bne %0,%3,2f\n\t" \
"move %1,%4\n\t" \
"scd %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
: "=&r" (__prev), "=&r" (__cmp) \
: "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (oldval), "r" (newval), "m" (*mem) \
: "memory")
#endif
@ -189,14 +189,14 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\t" \
"ll %0,%3\n\t" \
"move %1,%2\n\t" \
"sc %1,%3\n\t" \
"ll %0,%4\n\t" \
"move %1,%3\n\t" \
"sc %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
: "=&r" (__prev), "=&r" (__cmp) \
: "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (newval), "m" (*mem) \
: "memory"); \
__prev; })
@ -213,14 +213,14 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\n" \
"lld %0,%3\n\t" \
"move %1,%2\n\t" \
"scd %1,%3\n\t" \
"lld %0,%4\n\t" \
"move %1,%3\n\t" \
"scd %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
: "=&r" (__prev), "=&r" (__cmp) \
: "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (newval), "m" (*mem) \
: "memory"); \
__prev; })
@ -248,14 +248,14 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\t" \
"ll %0,%3\n\t" \
"addu %1,%0,%2\n\t" \
"sc %1,%3\n\t" \
"ll %0,%4\n\t" \
"addu %1,%0,%3\n\t" \
"sc %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
: "=&r" (__prev), "=&r" (__cmp) \
: "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (value), "m" (*mem) \
: "memory"); \
__prev; })
@ -272,14 +272,14 @@ typedef uintmax_t uatomic_max_t;
MIPS_PUSH_MIPS2 \
rel "\n" \
"1:\t" \
"lld %0,%3\n\t" \
"daddu %1,%0,%2\n\t" \
"scd %1,%3\n\t" \
"lld %0,%4\n\t" \
"daddu %1,%0,%3\n\t" \
"scd %1,%2\n\t" \
"beqz %1,1b\n" \
acq "\n\t" \
".set pop\n" \
"2:\n\t" \
: "=&r" (__prev), "=&r" (__cmp) \
: "=&r" (__prev), "=&r" (__cmp), "=m" (*mem) \
: "r" (value), "m" (*mem) \
: "memory"); \
__prev; })