generated from riscv/docs-spec-template
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readability of spec #7
Comments
I've updated the spec to hopefully be clearer. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is new to me, so I find the spec unapproachable as a new reader.
the spec title says "load-acquire" and "store-release", but the spec itself calls them "load atomic ordered" and "store atomic ordered"
the Note for load atomic states: "Load-atomic is similarly not seen as useful enough. Instead, users should suitably align their pointers so that ordinary load instructions suffice." First, it says it's not useful, so why is spec being introduced at all? Second, the second sentence tells me to use aligned pointers to get rid of the load atomics. is this why it's not useful? this is all very confusing to a new reader.
the actual behaviour of the load-acquire is not given in plain language. I cannot read SAIL code, and I shouldn't have to load up a C++ reference or Java reference to learn about atomics. I want to know what these instructions are supposed to do, but I can't figure it out from this spec.
the simple description that opens the load atomics is not sufficient on its own. it states "This instruction loads size bytes of memory from rs1 atomically. " What exactly does "atomically" mean in this context? Is this only dealing with the memory-read portion when a memory address is misaligned? Or is this dealing with the register-commit portion, where only the entire register will be updated atomically at once and never partially as might be done by a misaligned load? or am I completely confused?
I don't know what the aquire or release are referring to.
how is this different from LR/SC ? or do they work together? I'm expecting they are entirely different beasts, but can't really tell from the Zalasr writeup. Yet, the similarity of their names goes unmentioned and much is left to the imagination.
the cited document [1] does a better job explaining things, but that's not its purpose. the explanation in this spec can be much simpler and precise. Here is the most relevant section from that document:
"Informally, L.aq ensures that later memory operations become visible after the load; S.rl ensures that earlier memory operations become visible before the store, and no pair of these instructions is ever visibly reordered. Other reordering with non-acquire-or-release instructions is allowed. These instructions are not useful as fences to order non-acquire-or-release instructions amongbthemselves."
Unfortunately, this still doesn't explain why they are called "load atomic ordered" and "store atomic ordered" in this spec.
A spec should be self-contained -- one shouldn't have to go outside of the spec to figure things out -- especially if those references disappear or are not highly available works that are largely immutable (eg, another standard).
The text was updated successfully, but these errors were encountered: