Skip to content

riscv: gate fsgnj.d/fmv.d on FPU and D extension - #2393

Open
carlosqwqqwq wants to merge 1 commit into
unicorn-engine:masterfrom
carlosqwqqwq:fix/riscv-fsgnj-d-ext-gate
Open

riscv: gate fsgnj.d/fmv.d on FPU and D extension#2393
carlosqwqqwq wants to merge 1 commit into
unicorn-engine:masterfrom
carlosqwqqwq:fix/riscv-fsgnj-d-ext-gate

Conversation

@carlosqwqqwq

@carlosqwqqwq carlosqwqqwq commented Aug 12, 2026

Copy link
Copy Markdown

riscv: gate fsgnj.d/fmv.d on FPU and D extension

Fixes #2388

Problem

trans_fsgnj_d lacks REQUIRE_FPU and REQUIRE_EXT(ctx, RVD), so fsgnj.d/fmv.d retire on CPU models without F/D (e.g. SiFive E51) instead of raising an illegal-instruction trap.

Change

qemu/target/riscv/insn_trans/trans_rvd.inc.c trans_fsgnj_d: add REQUIRE_FPU; REQUIRE_EXT(ctx, RVD); at the top, matching every other D-extension translation in the same file.

The proposed change is source-only and contains no test-framework or repository-local changes.

Regression scope

Verify that fsgnj.d traps on a CPU without F/D and still executes correctly on a CPU with D, and that the existing floating-point tests remain unchanged.

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.

RISC-V: fsgnj.d/fmv.d retire without F/D extension

1 participant