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

Handle misalignment properly in jump-link instruction #20

Merged
merged 1 commit into from
Jul 22, 2023

Conversation

chiangkd
Copy link
Collaborator

From spec, an instruction-address-misaligned exception is reported on the branch or jump instruction, implying rd would not be updated.

For simplicity, I keep do_jump function to handle branch instruction, and modify only op_jump_link function.

Reference: https://riscv.org/technical/specifications/ (section 2.2)

riscv.c Outdated Show resolved Hide resolved
@jserv jserv changed the title Fix rd update when the jump fail Handle misalignment properly in jump-link instruction Jul 22, 2023
Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Use ChatGPT to refine / proofread git commit messages.

@jserv
Copy link
Collaborator

jserv commented Jul 22, 2023

In addition, use plain text in git commit messages rather than markdown.

As per the specifications, if a branch or jump instruction
is found to have an instruction-address-misaligned exception,
it indicates that the `rd` would not be updated.

To maintain simplicity, the `do_jump` function will continue
to handle branch instructions, which modifications will be
made exclusively to the `op_jump_link` function.

Reference: https://riscv.org/technical/specifications/
@jserv jserv merged commit ec5824d into sysprog21:master Jul 22, 2023
@jserv
Copy link
Collaborator

jserv commented Jul 22, 2023

Thank @chiangkd for contributing!

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.

2 participants