Skip to content

[BUG] Floating point instructions clear capability #46

@Andreas-Bur

Description

@Andreas-Bur

Is there an existing CVA6 bug for this?

  • I have searched the existing bug issues

Bug Description

Floating point instructions that write to an integer register unexpectedly clear the top half of the corresponding capability register. After a fcvt.w.d instruction for example, all fields of the corresponding capability are set to 0. This also happens with other instructions such as flt.d or feq.d.

PoC:

# Init FPU

  lui x11, 2
  csrrw x11, mstatus, x11
  addi x11, x0, 0
  csrrw x11, fcsr, x11

# Program

  fcvt.w.d x1,ft0
  cgettype x2,c1     # returns 0 instead of 0xffffffffffffffff
  cgetlen x3,c1      # returns 0 instead of 0xffffffffffffffff

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