Hi,

I think I have identified some issues with the atomic builtins, but I want
your advises.
For instance :

A:  __atomic_store_n (addr, val, __ATOMIC_SEQ_CST);

gives the armv7 code:

DMB     sy
STR     r1, [r0]
DMB     sy

but if I have well understood, the DMBs instructions only provide the
property that the
code is sequentially consistent, but not the atomicity for which we have to
use the
LDREX/STREX instructions. Thus I think that the code should be :

    DMB     sy
1: LDREX  r2, [r0]
    STREX  r1, r2, [r0]
    TEQ      r1, #0
    BNE      1b

B: __atomic_load_n (addr, __ATOMIC_ACQUIRE);

gives the armv7 code:

DMB     sy
LDR     r0, [r0]

but the load-acquire semantique specifies that all loads and stores
appearing in program order
after the load-acquire will be observed after the load-acquire, thus the
DMB should be after the
LDR, no ?

--
Yvan
_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to