Skip to content

R5900 floating point unit (FPU)

frno7 edited this page Mar 15, 2020 · 5 revisions

The R5900 floating-point unit (FPU) is not compliant with the IEEE 754 standard, as required by the R5900 processor specific ABI (psABI). The FPU is therefore emulated in software by the R5900 Linux kernel. This emulation is accurate but slow. The R5900 FPU hardware has the following limitations:

  • not a number (NaN) and plus/minus infinities are not supported;
  • exception mechanisms are not fully supported;
  • denormalized numbers are not supported;
  • rounding towards nearest and plus/minus infinities are not supported;
  • computed results usually differs in the least significant bit;
  • saturating instructions can differ more than the least significant bit.

Since only rounding towards zero is supported, the two least significant bits of FCR31 are hardwired to 01.

Finally, the R5900 FPU has some anomalies in the instruction set; not all opcode encodings are standard and some opcodes are extra. The output of the command grep 'FP_.*EE' binutils/opcodes/mips-opc.c with EE in the membership field are extra, and those with EE in the exclusions field are missing. See [PATCH] Support for MIPS R5900 (Sony Playstation 2).