fpu: sign-extend RV64 FCVT.WU positive overflow results
Maintainers usually reply within 1 day
@zzf2024 is already working on this.
Since Nov 29, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- embedded-iot
Research direction
Open hw/rtl/fpu/VX_fcvt_unit.sv at the f2i_u32_pos_ovf branch near lines 682-685 and check how res_val_64 is assembled there versus the other overflow arms; the RV64 path needs the 32-bit 0xffffffff sign-extended while res_val_32 stays as it is. Read the surrounding f2i arms first to see how XLEN selects between the 64- and 32-bit results. Done means an FPU simulation of FCVT.WU.S on 0x4f800000 with frm=RNE yields 0xffffffffffffffff with NV set.
Written by the indexing model from the issue text.
Description
On RV64, FCVT.WU.S and FCVT.WU.D can return a zero-extended result when a finite positive input overflows the unsigned 32-bit range.
For example, FCVT.WU.S of 0x4f800000 (2^32), with frm=RNE, should produce 0xffffffffffffffff: the invalid flag is set and the 32-bit result 0xffffffff is sign-extended to XLEN. The RTL instead returns 0x00000000ffffffff. FCVT.WU.D of a value whose exponent is at least 32 takes the same arm.
This is not #430. #430 is FCVT.S.D overflow rounding, and #432 already fixed that path. This report is the float-to-unsigned-int arm: the overflow is detected and NV is set, but the RV64 result is zero-extended instead of sign-extended.
In hw/rtl/fpu/VX_fcvt_unit.sv, the f2i_u32_pos_ovf branch sets NV but zero-extends the result:
end else if (f2i_u32_pos_ovf) begin
final_fflags_s5.NV = 1'b1;
res_val_64 = {32'h00000000, 32'hFFFFFFFF};
res_val_32 = 32'hFFFFFFFF;
- Dominant language
- Verilog
- Stars
- 2.4k
- Forks
- 563
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 71
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vortexgpgpu/vortex
-
RV64 signed DIV/REM restores the sign from bit 31Possibly taken @zzf2024 claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vortexgpgpu/vortex#501 · 1 comment ·
Maintainers usually reply within 1 day
-
WGMMA: the next kernel can compute with the previous kernel's B row left in the B buffer (rtlsim)Possibly taken @youzi27 claimed this 2 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
vortexgpgpu/vortex#558 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
vortexgpgpu/vortex#521 ·
Maintainers usually reply within 1 day
-
WGMMA: a block-major B tile can read K-major data left in the B buffer (rtlsim)Possibly taken @youzi27 claimed this 5 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
vortexgpgpu/vortex#518 ·
Maintainers usually reply within 1 day
-
TFR tensor core with DSM drops an MXFP4/NVFP4 NaN block scale when its elements are maskedPossibly taken @youzi27 claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
vortexgpgpu/vortex#516 ·
Maintainers usually reply within 1 day
All issues in vortexgpgpu/vortex
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
espressif/esp-iot-solution#856 ·
Maintainers usually reply within 1 day
-
Add keycodes for Voice Dictation (HUTRR99) and AI assistant consumer usages (HUTRR89, HUTRR119)Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zmkfirmware/zmk#3573 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
protocomm: Security 2 nonce storage does not guarantee counter alignment (IDFGH-18841)Possibly taken @kPatch claimed this today. OpenStatus: Opened
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Arch: ARM/AArch64 BSP BSP: GD32 bug Component component: drivers
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
RT-Thread/rt-thread#12109 · 3 comments ·
Maintainers usually reply within 2 days