Why does ia64 not use fetchadd in atomic.h?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I just looked at at the asm generated by some of the use of atomic for 
statistics and saw that there were complicated compxchg constructs where I 
would have expected a simple fetchadd. Why is this?

F.e.

static __inline__ int
ia64_atomic_add (int i, atomic_t *v)
{
        __s32 old, new;
        CMPXCHG_BUGCHECK_DECL

        do {
                CMPXCHG_BUGCHECK(v);
                old = atomic_read(v);
                new = old + i;
        } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old);
        return new;
}

Why not

#define ia64_atomic_add(__i, __v) ia64_fetchadd(__i, &v->counter, acq)

?


-
: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Sparc Linux]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux x86_64]     [Linux for Ham Radio]

  Powered by Linux