Sep 20, 2026

Reversing the SH-4 fpu with the help of three AI models Posted in dreamcast, fpu

Intro

The SH-4 in the Dreamcast has four ‘special’ floating-point instructions that exist to accelerate 3d graphics:

  • FIPR: 4-element inner product
  • FTRV: 4x4 matrix times vector
  • FSCA: sine and cosine approximation of a 16-bit angle
  • FSRRA: square root reciprocal approximation

FIPR and FTRV are documented by the Renesas/Hitachi manuals, while FSCA and FSRRA are documented for SH4A, which has a different pipeline. They are all “approximate” instructions.

It’s been a puzzle to me, and others in the Dreamcast emulation scene, on how exactly those instructions can be replicated and what is their likely internal structure.