LeoRiether/FPGRARS

Feature request: FP control and status instructions

Opened this issue · 0 comments

Is it possible to implement some floating point control and status instructions?
frcsr
The image above shows the control/status register structure.

Some instructions are:

  • frcsr t0 - Read FP control/status register
  • frflags t0 - Read FP exception flags (idk if it can be implemented in this case)
  • frrm t0 - Read FP rounding mode
  • fsrm t0 - Write FP rounding mode
  • fsrmi 2 - Write FP rounding mode (imm)

It would be extremely useful, especially the rounding mode instructions.
The rounding mode works according to this table:
image
So, when I use fcvt.w.s t0, ft0, t0's value will be ft0's value rounded according to the rounding mode defined in the control/status register.