bluespec / Piccolo

RISC-V CPU, simple 3-stage pipeline, for low-end applications (e.g., embedded, IoT)
Apache License 2.0
311 stars 49 forks source link

fcvt.wu.d does not round up denormalized values #25

Open michael-roe opened 4 years ago

michael-roe commented 4 years ago

If the rounding mode is set to round up, fcvt.wu.d of a denormalized value rounds down to zero rather than rounding up to 1. (Spike gets this right).

Here's a test:

.global _start _start: lui ra, 2 csrs mstatus, ra

_test: li t0, 0x10 fmv.d.x f1, t0 fcvt.wu.d a0, f1, rup