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

[OTBN] assembly format of JALR instruction #2599

Closed
felixmiller opened this issue Jun 23, 2020 · 3 comments
Closed

[OTBN] assembly format of JALR instruction #2599

felixmiller opened this issue Jun 23, 2020 · 3 comments
Labels
Component:Doc Documentation issue Type:Question Questions

Comments

@felixmiller
Copy link
Contributor

felixmiller commented Jun 23, 2020

I wonder which one is the correct assembly format of the JALR instruction and which one should we use in our OTBN spec here.

I see the two formats:

  1. JALR <rd>, <offset>(<rs>)
  2. JALR <rd>, <rs>, <offset>

Currently we use # 2, but apparently this was changed here.

@asb
Copy link
Member

asb commented Jun 24, 2020

Both formats are valid and supported by RISC-V assemblers. The argument for preferring 1) is that you're then addressing memory addresses consistently as <offset>(reg) across jalr, lw, sw, and so on.

@felixmiller
Copy link
Contributor Author

felixmiller commented Jun 24, 2020

Thanks @asb . @imphil should we change this in the otbn spec, since we are using format # 1 for lw and sw?

@felixmiller
Copy link
Contributor Author

felixmiller commented Sep 30, 2020

Closing this since we are now consistently using # 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:Doc Documentation issue Type:Question Questions
Projects
None yet
Development

No branches or pull requests

2 participants