Skip to content

Fix several RISC-V conformance issues#218

Open
whensun wants to merge 4 commits into
LekKit:stagingfrom
whensun:fix-riscv-conformance-issues
Open

Fix several RISC-V conformance issues#218
whensun wants to merge 4 commits into
LekKit:stagingfrom
whensun:fix-riscv-conformance-issues

Conversation

@whensun

@whensun whensun commented Jun 11, 2026

Copy link
Copy Markdown

This PR fixes several RISC-V conformance issues in CSR handling, trap-return side effects, and floating-point behavior.

Changes include:

  • Reject read-only access forms for the seed CSR.
  • Legalize reserved mtvec/stvec MODE values.
  • Ensure mepc[0] and sepc[0] always read as zero.
  • Set MPIE/SPIE to 1 after MRET/SRET.
  • Honor the rm field for FCVT.D.L.
  • Set NX for inexact FCVT.W.S conversions.
  • Adjust FMSUB.S qNaN invalid-flag behavior.

The changes were checked with minimal bare-metal RISC-V tests that reproduce the previous mismatches.

@LekKit

LekKit commented Jun 15, 2026

Copy link
Copy Markdown
Owner

What about performance of the FPU changes? Please split this PR into first two commits (CSR and xRET fixes), and FPU fixes, for now

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