Skip to content

[BUG] `fdiv.h` NaN Canonicalization Bug

Is there an existing CVA6 bug for this?

  • I have searched the existing bug issues

Bug Description

This report captures a divergence where CVA6 produces a non-canonical NaN while Spike and Rocket both return the canonical half-precision NaN (0xffffffffffff7e00). The discrepancy appears when executing fdiv.h f21, f22, f24, rup with the registers initialized to:

  • f21 = 0xffffffffffff7e00
  • f22 = 0x9025247828924067
  • f24 = 0x5baabdb6a7d8958b

Expected behavior (per Spike and Rocket): f21 is written with the canonical NaN pattern 0xffffffffffff7e00.
Observed on CVA6: f21 is written with 0xffffffffffffe65a, preserving a non-canonical payload.

This indicates CVA6 is skipping the required canonicalization step for half-precision division results that should be NaN, leading to architectural divergence whenever NaN inputs reach fdiv.h under round-up mode.