fpu: sign-extend RV64 FCVT.WU positive overflow results
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 62/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 领域
- embedded-iot
调研方向
打开 hw/rtl/fpu/VX_fcvt_unit.sv 中 682-685 行附近的 f2i_u32_pos_ovf 分支,对比其他溢出分支,检查 res_val_64 在这里是如何组装的;RV64 路径需要将 32 位的 0xffffffff 符号扩展,而 res_val_32 保持不变。先阅读周围的 f2i 分支,了解 XLEN 如何在 64 位和 32 位结果之间进行选择。完成标准是:对 FCVT.WU.S 以 0x4f800000 和 frm=RNE 进行 FPU 仿真,得到 0xffffffffffffffff 且 NV 置位。
由索引模型根据 Issue 内容生成。
描述
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;
- 主要语言
- Verilog
- 星标
- 2.4k
- 派生
- 563
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 33
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vortexgpgpu/vortex 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
vortexgpgpu/vortex#501 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 22/100
vortexgpgpu/vortex#505 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 28/100
vortexgpgpu/vortex#504 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 22/100
vortexgpgpu/vortex#503 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
vortexgpgpu/vortex#500 ·
维护者通常 1 天内回复
查看 vortexgpgpu/vortex 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 61/100
-
难度 2/5 1-3 小时 新手友好度 70/100
raspberrypi/usbboot#419 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug triage
难度 2/5 1-3 小时 新手友好度 67/100
crosspoint-reader/crosspoint-reader#4595 · 4 条评论 ·
维护者通常 1 天内回复