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

Adding a note to clarify natural alignment of the instructions #17

Merged
merged 1 commit into from
May 30, 2024

Conversation

christian-herber-nxp
Copy link
Collaborator

No description provided.

@@ -14,6 +14,11 @@ The Zilsd extension adds the following RV32-only instructions:
- LD loads a 64-bit value into registers `rd` and `rd+1`
- SD stores a 64-bit value from registers `rs2` and `rs2+1`

[NOTE]
====
As the access size is 64-bit, accesses are only considered naturally aligned for effective addresses that are a multiple of 8. In this case, these instruction are guaranteed to not raise an address-misaligned exception.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
As the access size is 64-bit, accesses are only considered naturally aligned for effective addresses that are a multiple of 8. In this case, these instruction are guaranteed to not raise an address-misaligned exception.
As the access size is 64-bit, accesses are only considered naturally aligned for effective addresses that are a multiple of 8. Only in this case are these instruction guaranteed to not raise an address-misaligned exception.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The way you suggest it was the first way I also wrote it, but it is not correct.
If your EEI guarantees that misaligned instructions do not trap but are emulated in hardware, they are also guaranteed not to trap.

@christian-herber-nxp christian-herber-nxp merged commit b03cca2 into main May 30, 2024
1 check passed
@christian-herber-nxp christian-herber-nxp deleted the 16-alignment-requirements-for-rv32-ldsd branch May 30, 2024 13:03
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.

Alignment requirements for RV32 ld/sd
2 participants