Skip to content

[Bug] VexRiscv FSGNJX.D Sign Bit Wrong #464

@canxin121

Description

@canxin121

VexRiscv FSGNJX.D Sign Bit Wrong

Reproduction

  • Setup: RV32 + FD VexRiscv; run the same program on Spike for reference.
  • Sequence:
    1. li x2, 0xe1f08df2; fmv.w.x f20, x2 → f20 = 0xffffffffe1f08df2 (sign = 1).
    2. li x2, 0xc051749b; fmv.w.x f25, x2 → f25 = 0xffffffffc051749b (sign = 1).
    3. fsgnjx.d f25, f25, f20.
    4. Store f25 to memory or read the register to check the result.

Issue

  • Spike: f25 becomes 0x7fffffffc051749b; the sign bit is XORed to 0 as the spec requires.
  • VexRiscv: f25 stays 0xffffffffc051749b; the sign bit does not flip, violating FSGNJX.D semantics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions