This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, alpha]: Fix libgomp.c/autopar-1.c execution test failure


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]