Do any of the POWER ISAs include atomic operations other than LL/SC, e.g., atomic addition, exchange, and so on?
Asked
Active
Viewed 382 times
2
-
I used powerpc tag because there doesn't seem to be a POWER one? – BeeOnRope Apr 22 '20 at 02:28
-
I assume you tried compiling with GCC `-march=power9` or something. Apparently ARMv8.2 added some non-LL/SC atomic RMWs like CAS which perform much better in high-contention situations ([Andrei Frumusanu's Graviton2 review](https://www.anandtech.com/show/15578/cloud-clash-amazon-graviton2-arm-against-intel-and-amd/2)), but IDK if POWER has anything equivalent. – Peter Cordes Apr 22 '20 at 03:44
-
@PeterCordes - I played around a bit in godbolt and didn't see anything but that's not very definitive. – BeeOnRope Apr 22 '20 at 04:08
-
Look at POWER ISA 3.0B, Book II, §4.5 Atomic Memory Operations (AMO). [Link](https://ibm.ent.box.com/s/1hzcwkwf8rbju5h9iyf44wm94amnlcrv) – Iwillnotexist Idonotexist Apr 22 '20 at 05:12
-
You might want to elaborate on what you are trying to accomplish. The examples you gave can of course be implemented using "LL/SC". GCC provides atomic ops like `__atomic_fetch_add`, `__atomic_test_and_set`, etc. (which usually resolve to LL/SC-based code, see section 6.55 of a current GCC doc). – ThinkOpenly Apr 22 '20 at 14:21
-
1@Paul I just want to fill out my mental list of platforms which include RMW atomic operations, such as x86 and now ARM, and which offer only LL/SC and you build your atomics on that. It's for a sentence I am writing. – BeeOnRope Apr 22 '20 at 14:34
1 Answers
-1
-
Please don't post link-only answers. A Stack Overflow answer must stand on its own without having to rely on external references. Please add something like a rudimentary description of the POWER8 transactional memory model to bring your answer to that state. – fuz Apr 22 '20 at 11:46
-
@fuz: disagree that this is link-*only*. The mere fact that POWER8 has transactional memory is an answer. This kind of question doesn't need answers that explain in detail how to use whatever feature; that's something we can google or find in the manual. – Peter Cordes Apr 23 '20 at 02:01