[Libre-soc-dev] load/store quad and svp64

Jacob Lifshay programmerjake at gmail.com
Tue Apr 12 04:10:35 BST 2022


lq is stated to be excluded from svp64, imho it should be included since
128-bit atomic operations are very useful, even in vector code.

The 128-bit atomic operations (from the OpenPower ISA spec. v3.1 book 2
section 1.3):

They can't be replaced by svp64 vectorized 64-bit load/stores unless svp64
is modified to additionally guarantee atomicity at the 128-bit size, which
I don't think is appropriate for 64-bit operations.

One example of where vectorized 128-bit atomics are quite useful is if
you're trying to vectorize lookups in a parallel hash table with 64-bit
key/value pairs, you'd want the 128-bit loads to be relaxed-atomic
operations since otherwise the key or value might be modified by some other
cpu and you'd get an old key and a new value or something like that rather
than the correct result of the old key and the old value, or the new key
and the new value.

OpenPower uses lq for 128-bit relaxed (monotonic in llvm ir) atomic loads,
as you can see here:


More information about the Libre-soc-dev mailing list