Skip to content

RV64 STD FCVT.S.D directed overflow returns signed infinity instead of maximum finite #430

Closed

Description

@vera-rubin

The recorded directed-overflow cases require maximum finite but return signed infinity. Software using the converted value can consequently compute different results or make different data-dependent decisions. No application workload, memory-safety effect, isolation failure, device-wide hang, or physical implementation was tested.

Reproducer and paired logs. F rounding rules.

# Recorded Vortex build configuration
../configure --xlen=64
make -C sim/simx
make -C sim/rtlsim THREADS=4 CONFIGS=-DVX_CFG_FPU_TYPE_STD
# From the unpacked fixture directory
./run.sh /path/to/vortex
./run-processor.sh /path/to/vortex /path/to/rtlsim /path/to/simx

Verilator/Icarus leaf results:

a=47f0000000000000 rm=1 got=ffffffff7f800000 flags=05 expected=ffffffff7f7fffff flags=05 mask=1f
a=47f0000000000000 rm=2 got=ffffffff7f800000 flags=05 expected=ffffffff7f7fffff flags=05 mask=1f
a=47f0000000000000 rm=0 got=ffffffff7f800000 flags=05 expected=ffffffff7f800000 flags=05 mask=1f
a=c7f0000000000000 rm=3 got=ffffffffff800000 flags=05 expected=ffffffffff7fffff flags=05 mask=1f

Processor results:

SimX: exit 0
CONFIGS: num_threads=4, num_warps=4, num_cores=1, num_clusters=1, socket_size=1, local_mem_base=0x1ffff0000, num_barriers=8
RTL: exit 1

The processor probe checks only the positive RTZ numerical result. The additional directed modes and overflow flags are leaf evidence. The OF and NX flags are right. STD defaults for ASICs. DPI is the default rtlsim backend. DSP shares VX_fcvt_unit. DPI and DSP were inspected in source but were not run.

We think overflow packing preserves sign, ignoring frm. We've neither written nor tested a fix.

Version: Vortex v3.0 (7fe19369587c087f902c3e2bc2add612aa910a95), Ubuntu 24.04.5, installed riscv64-unknown-elf-gcc 13.2.0, Verilator 5.053 devel, Icarus 14.0 devel, g++ 13.3.0, Python 3.12.3, TOOLCHAIN_REV=v3.0.1, SoftFloat b51ef8f3, Ramulator e62c84a6.

— ChipLab

Activity

  1. tinebp commented on Nov 12, 2026

    @tinebp
    Collaborator

    Fixed on master by #432: FCVT.S.D overflow now returns infinity or the largest finite F32 according to the rounding mode and sign (of_to_inf / box_s_max in VX_fcvt_unit.sv). Closing; the regression test is pending in #431.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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