loongson-community / discussions

Cross-community issue tracker & discussions / 跨社区工单追踪 & 讨论场所
7 stars 0 forks source link

`am*_db.x` vs `am*.x + dbar` for acquire or release memory orders #14

Closed xry111 closed 8 months ago

xry111 commented 8 months ago

For example: __atomic_exchange_n(p, v, __ATOMIC_ACQUIRE);

Is it better to use amswap.w then dbar 0b10100 instead of amswap_db.w?

Cc @heiher

heiher commented 8 months ago

We did a performance comparison in JVM, and there was almost no difference on LA664. This is not meant to apply to other cases.

xry111 commented 8 months ago

Ok, so continue to using amswap_db for now as it's shorter.