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

Pseudoinstruction examples don't work for RV64 #53

Open
allenjbaum opened this issue Sep 18, 2020 · 2 comments
Open

Pseudoinstruction examples don't work for RV64 #53

allenjbaum opened this issue Sep 18, 2020 · 2 comments

Comments

@allenjbaum
Copy link

The examples shown for the LA and LI insructions only work for RV32.
For RV64, any address at an offset of > +/-2GB won't work with the example shown.
The LI case has the same issue, as does the absolute addressing example (though the LI example does mention it is for an RV32i)

@aswaterman
Copy link
Contributor

Note that LI does work for arbitrary 64-bit constants in RV64; it expands into a potentially long and inefficient shift-and-add sequence.

It's certainly true that LA doesn't work for arbitrary 64-bit addresses (unless using PIC).

@allenjbaum
Copy link
Author

My title was misleading. It is entirely correct that LI and LA can work with either architecture.
What doesn't work are the example in the text, which don't mention that the RV64 versions may (or may not) take more actual instructions than the text indicates. Use of these pseudo instructions may cause failure of architectural tests that trap, depending on their exact aliignment, because of this uncertainty.
I am only asking that the text clarify the conditions under which the will or won't work, and the conditions under which the example shown will and won't work.

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

No branches or pull requests

2 participants