This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, alpha]: Fix libgomp.c/autopar-1.c execution test failure
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 26 Aug 2009 08:12:48 +0200
- Subject: Re: [PATCH, alpha]: Fix libgomp.c/autopar-1.c execution test failure
- References: <4A9452E4.2090102@gmail.com> <4A946BDA.40209@redhat.com>
On 08/26/2009 12:55 AM, Richard Henderson wrote:
On 08/25/2009 02:08 PM, Uros Bizjak wrote:
BTW: Linux does not need memory barrier in front of the LL/SC sequence,
How do you figure that?
From the source of arch/alpha/include/asm/xchg.h:
static inline unsigned long
____cmpxchg(_u64, volatile long *m, unsigned long old, unsigned long new)
{
unsigned long prev, cmp;
__asm__ __volatile__(
"1: ldq_l %0,%5\n"
" cmpeq %0,%3,%1\n"
" beq %1,2f\n"
" mov %4,%1\n"
" stq_c %1,%2\n"
" beq %1,3f\n"
__ASM__MB
"2:\n"
".subsection 2\n"
"3: br 1b\n"
".previous"
: "=&r"(prev), "=&r"(cmp), "=m"(*m)
: "r"((long) old), "r"(new), "m"(*m) : "memory");
return prev;
}
Uros.