Skip to content

[BUG] Incorrect Result from 'fdiv' Operation Leading to Negative Infinity Instead of Smallest Negative Number #110

@youzi27

Description

@youzi27

Bug Description

When performing floating-point division using the fdiv.d instruction in CVA6, under specific conditions where the expected result is the smallest representable negative double-precision floating-point number (0xffefffffffffffff), CVA6 incorrectly returns negative infinity (0xfff0000000000000).

Steps to Reproduce:

  1. Load fa7 with 0xc024000000000000.
  2. Load fs3 with 0x00000000000002cc.
  3. Execute the instruction: fdiv.d ft6, fa7, fs3.
  4. Observe the resulting value in ft6.

The log is as follows::

core   0: 0x00000000800052b2 (0x233987d3) fsgnj.d fa5, fs3, fs3
1 0x00000000800052b2 (0x233987d3) f15 0x00000000000002cc
core   0: 0x00000000800052b6 (0x23188853) fsgnj.d fa6, fa7, fa7
1 0x00000000800052b6 (0x23188853) f16 0xc024000000000000
core   0: 0x00000000800052ba (0x1b38f353) fdiv.d  ft6, fa7, fs3
1 0x00000000800052ba (0x1b38f353) f 6 0xfff0000000000000

See: openhwgroup/cva6#2060

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