This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR11784 - atomic __exchange_and_add() broken for ColdFire targets
- From: Richard Henderson <rth at redhat dot com>
- To: Bernardo Innocenti <bernie at develer dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Mon, 4 Aug 2003 15:52:41 -0700
- Subject: Re: [PATCH] Fix PR11784 - atomic __exchange_and_add() broken for ColdFire targets
- References: <200308040322.13087.bernie@develer.com>
On Mon, Aug 04, 2003 at 03:22:13AM +0200, Bernardo Innocenti wrote:
> +// bset with no immediate addressing
> +#if defined(__mcf5200__) || defined(__mcf5300__)
> + __asm__ __volatile__("1: bset.b #7,%0@\n\tjbne 1b"
> + : /* no outputs */
> + : "a"(&__Atomicity_lock<0>::_S_atomicity_lock)
> + : "cc", "memory");
> +
> +// bset with immediate addressing
> +#elif defined(__mc68000__)
> + __asm__ __volatile__("1: bset.b #7,%0\n\tjbne 1b"
> + : "=m"(__Atomicity_lock<0>::_S_atomicity_lock)
> + : "m"(__Atomicity_lock<0>::_S_atomicity_lock)
> + : "cc");
> +
These should be combined, surely?
r~