Skip to content
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

Contribute ARC feedback on Zilsd #45

Merged
merged 5 commits into from
Sep 18, 2024
Merged

Contribute ARC feedback on Zilsd #45

merged 5 commits into from
Sep 18, 2024

Conversation

aswaterman
Copy link
Member

The ARC had no further feedback on the semantics, but we wanted to tighten up the exception-related language, rephrasing it in terms of existing terminology. We also thought the "software view" section was mostly superfluous and could be summarized in a non-normative note.

zilsd.adoc Outdated

NOTE: This definition permits LD and SD instructions giving rise to exactly one
memory access, regardless of alignment.
It also permits decomposing instructions with 4-byte-aligned effective
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems redundante with the normative definition.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can get behind deleting this NOTE if you think it's unhelpfully redundant.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried to update the note to be less repetitive and also clarify that the accesses are atomic. Maybe this helps with @tovine's comment.

zilsd.adoc Outdated Show resolved Hide resolved
=== Exception Handling

For the purposes of RVWMO and exception handling, LD and SD instructions are
considered to be misaligned loads and stores, with one additional constraint:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this text is a bit confusing - this only applies in case the access is not 8-byte aligned, right? Right now it can read as if LD and SD are always considered to be misaligned accesses.

Copy link
Member Author

@aswaterman aswaterman Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's deliberate, though. 8-byte alignment offers no special benefit for these instructions. (Of course, the uarch is likely to optimize them, but that's not the point here.) The only architecturally visible question is whether they're 4-byte aligned.

Copy link
Collaborator

@tovine tovine Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what you're saying is that implementations are free to consider them misaligned (and trap) regardless of actual alignment?
I'd very much hope that compilers will (or at least can) be instructed to make them 8-byte aligned, otherwise they bring almost none of the originally intended benefits over a pair of normal LW/SW.
One such intended benefit is to allow low-end MCU-class cores to better utilize the bus if they have one that is wider than the native machine width, but this is only possible if the wider access is then aligned, and those cores don't typically have the same kind of macro-op fusion capabilities as larger ones.

Copy link
Member Author

@aswaterman aswaterman Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a rhetorical tactic to simplify the description of the semantics, not a means to recommend what implementations should do. Obviously it's a good thing for implementations to implement these ops as wide bus xacts when possible. That doesn't run afoul of anything in the spec.

zilsd.adoc Show resolved Hide resolved
zilsd.adoc Outdated Show resolved Hide resolved
zilsd.adoc Outdated Show resolved Hide resolved
zilsd.adoc Outdated Show resolved Hide resolved
zilsd.adoc Outdated

NOTE: This definition permits LD and SD instructions giving rise to exactly one
memory access, regardless of alignment.
It also permits decomposing instructions with 4-byte-aligned effective
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried to update the note to be less repetitive and also clarify that the accesses are atomic. Maybe this helps with @tovine's comment.

Co-authored-by: Christian Herber <[email protected]>
Signed-off-by: Andrew Waterman <[email protected]>
@aswaterman
Copy link
Member Author

@christian-herber-nxp I'm OK with this tweaked version if you are.

@christian-herber-nxp
Copy link
Collaborator

@christian-herber-nxp I'm OK with this tweaked version if you are.

I think you have only accepted one of my three suggestions (I do not know of a way to make a suggestion for multiple lines at once. I guess you wanted to accept the suggestion, but I will wait for you on that.

aswaterman and others added 2 commits September 18, 2024 04:03
Co-authored-by: Christian Herber <[email protected]>
Signed-off-by: Andrew Waterman <[email protected]>
Co-authored-by: Christian Herber <[email protected]>
Signed-off-by: Andrew Waterman <[email protected]>
@aswaterman aswaterman merged commit 53a1637 into main Sep 18, 2024
1 check passed
@aswaterman aswaterman deleted the arc-patches branch September 18, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants