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

split MODESW into MODESW.CAP and MODESW.INT #406

Merged
merged 5 commits into from
Oct 4, 2024

Conversation

tariqkurd-repo
Copy link
Collaborator

@tariqkurd-repo tariqkurd-repo commented Oct 4, 2024

MODESW is difficult to implement in higher performance implementations as it causes a lot of uncertainty in pre-decode and decode about which mode is currently being entered. It also causes a long sequential path through a wide-issue decode packet, compared with entering a specific mode which makes it much easier to determine the mode for each instruction.

Therefore it is split into two which directly enter the named mode MODESW.CAP for cap mode and MODESW.INT for int mode, so that instructions can be decoded much more easily.

It was only a single encoding before to try and reduced the 16-bit encoding space for C.MODESW. This is guaranteed not to be accepted without showing significant code-size reduction or performance improvement as part of the standardisation process.

Only using 32-bit encodings means we can add a second encoding, and so be specific about which mode to enter.

Copy link
Collaborator

@arichardson arichardson left a comment

Choose a reason for hiding this comment

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

Since there are no arguments encoding space should not matter. I'm happy with this change since I don't think switching without knowing the target mode is ever useful.

@jrtc27 @jonwoodruff what do you think?

@PeterRugg
Copy link
Contributor

Chatting around the office, @jonwoodruff, @gameboo and I are happy.

@tariqkurd-repo tariqkurd-repo merged commit 8477807 into riscv:main Oct 4, 2024
3 checks passed
tariqkurd-repo added a commit to tariqkurd-repo/riscv-cheri that referenced this pull request Oct 9, 2024
MODESW is difficult to implement in higher performance implementations
as it causes a lot of uncertainty in pre-decode and decode about which
mode is currently being entered. It also causes a long sequential path
through a wide-issue decode packet, compared with entering a specific
mode which makes it much easier to determine the mode for each
instruction.

Therefore it is split into two which directly enter the named mode
MODESW.CAP for cap mode and MODESW.INT for int mode, so that
instructions can be decoded much more easily.

It was only a single encoding before to try and reduced the 16-bit
encoding space for C.MODESW. This is guaranteed not to be accepted
without showing significant code-size reduction or performance
improvement as part of the standardisation process.

Only using 32-bit encodings means we can add a second encoding, and so
be specific about which mode to enter.

---------

Co-authored-by: Andrés Amaya Garcia <andres.amaya@codasip.com>
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.

4 participants