Skip to content

riscv: return after valid fcvtmod.w.d - #303

Open
carlosqwqqwq wants to merge 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/fcvtmod-no-partial-commit
Open

riscv: return after valid fcvtmod.w.d#303
carlosqwqqwq wants to merge 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/fcvtmod-no-partial-commit

Conversation

@carlosqwqqwq

@carlosqwqqwq carlosqwqqwq commented Sep 5, 2026

Copy link
Copy Markdown

riscv: return after valid fcvtmod.w.d

Fixes #294

Commit message

riscv: return after valid fcvtmod.w.d

Description

The valid fcvtmod.w.d path writes the integer result and then falls through to the illegal-instruction path because it lacks a return. Add the missing return immediately after the architectural writeback. Reserved rounding-mode encodings continue to use the existing illegal path. The change is limited to src/cpu/riscv_fpu.c.

This PR is independently applicable to staging. PR #304 addresses the
separate modulo-conversion semantics in the same instruction, and no longer
contains this control-flow hunk; the two fixes can be reviewed and merged
independently.

Validation

  • QEMU with Zfa executes 0xc2801553 and retires the legal rtz form; the patched RVVM also retires it with rd = 3 and no internal illegal-instruction exception. A native RV64 reference without Zfa is recorded only as a capability boundary, not as the expected behaviour of RVVM's Zfa-enabled guest.

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.

fcvtmod.w.d commits rd before raising illegal instruction

1 participant