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

Add unratified Zimop extension #1467

Closed
wants to merge 0 commits into from

Conversation

ved-rivos
Copy link
Contributor

@aswaterman
Copy link
Collaborator

@ved-rivos I’d like to refactor this to reduce the number of instructions perceived by Spike. The idea is that we’d have a single instruction for each of mop.r, mop.rr, and c.mop. A switch statement can perform the dispatch on the relevant opcode bits.

This presumably requires defining three new pseudoinstruction within riscv-opcodes.

@ved-rivos
Copy link
Contributor Author

@aswaterman that would work. Will need a wider match/mask for each opcode group in opcodes. Will not need a switch I guess - they all have the same action. I am not sure how I can get the disassembler to show separate mnemonics - will look through it but if there is an example of such a pattern already please give me a pointer.

@aswaterman
Copy link
Collaborator

@ved-rivos Right. I guess I meant we'd need a switch when implementing e.g. Zicfiss. As it stands, the switch is unnecessary.

I think your disassembler implementation is fine as-is. (riscv-opcodes will have both the current opcodes and the new alias that subsumes them all, so the disassembler code will work without change.)

@ved-rivos
Copy link
Contributor Author

@aswaterman - the PR is updated to use the mop.r.N and mop.rr.N pseudo-instructions.

@@ -1395,6 +1395,10 @@ riscv_insn_ext_zvksh = \
vsm3c_vi \
vsm3me_vv \

riscv_insn_ext_zimop = \
mop_r_N \
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file uses tabs--probably for bad reasons--but please be consistent with the surrounding spacing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it. My editor was setup to replace tabs with space.

@@ -1431,6 +1435,7 @@ riscv_insn_list = \
$(riscv_insn_priv) \
$(riscv_insn_smrnmi) \
$(riscv_insn_svinval) \
$(riscv_insn_ext_zimop) \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Tabbing comment applies here, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

Thank you for humoring my suggestion, @ved-rivos. I'll hold off on merging this (and #1468) until riscv/riscv-opcodes#194 is sorted out, but otherwise, LGTM!

@ved-rivos
Copy link
Contributor Author

@aswaterman riscv/riscv-opcodes#194 is sorted out,

@aswaterman
Copy link
Collaborator

@ved-rivos can you clean up this PR so that it passes regression tests? Note that for Spike we require every commit in the PR to pass individually, so the problem might be that you need to reorganize your commits (or possibly squash some of them together) so that each commit is valid.

@ved-rivos
Copy link
Contributor Author

ved-rivos commented Oct 17, 2023

@aswaterman - I had to squash the commits and it passes the checks now. I did not realize the system checks each commit to be buildable and testable. I will keep that in mind for future for organizing the commits.

@YenHaoChen
Copy link
Collaborator

I am interested in zimop extension. Is there an update to this PR?
@ved-rivos @aswaterman

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

Thanks, @ved-rivos!

@aswaterman
Copy link
Collaborator

@ved-rivos sorry for letting this lapse. Can you rebase (possibly updating encoding.h once again)?

@YenHaoChen I do want to merge this promptly; it just happened to fall by the wayside.

@ved-rivos
Copy link
Contributor Author

@aswaterman @YenHaoChen - I will rebase, run tests, and try to push it in today.

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