sysprog21 / semu

A minimalist RISC-V system emulator capable of running Linux kernel
MIT License
247 stars 46 forks source link

Handle misalignment properly in jump-link instruction #20

Closed chiangkd closed 1 year ago

chiangkd commented 1 year ago

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)

jserv commented 1 year ago

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

jserv commented 1 year ago

Thank @chiangkd for contributing!