I am currently wading through the ARM architecture manual for the ARMv7 core. In chapter A3.5.3 about atomicity of memory accesses, it states:
If a single-copy atomic load overlaps a single-copy atomic store and for any of the overlapping bytes the load returns the data written by the write inserted into the Coherence order of that byte by the single-copy atomic store then the load must return data from a point in the Coherence order no earlier than the writes inserted into the Coherence order by the single-copy atomic store of all of the overlapping bytes.
As non-native english speaker I admit that I am slightly challenged in understanding this sentence.
Is there a scenario where writes to a memory byte are not inserted in the Coherence Order and thus the above does not apply? If not, am I correct to say that shortening and rephrasing the sentence to the following:
If the load happens to return at least one byte of the the write, then the load must return all overlapping bytes from a point no earlier than where the write inserted them into the Coherence order of all of the overlapping bytes.
still transports the same meaning?
strb
to bytes 0,1,2,3 andldr
on the full word should behave similar. I think that is the single-copy atomic bit. Aldr
to addr+2 will not be single-copy atomic. Ie, an unaligned read. – Toronto