Historical FP findings and current implementation

The following findings describe the older audit at e7c4210, not the current implementation. They are retained as regression examples. Current AOT and JIT emitters use raw-bit, stateful helpers in helpers/fp.c and helpers/fp_arithmetic.c; host operations run only behind guards that preserve guest results and flags. The QEMU differential test is the independent reference. This does not certify every operand or encoding.

FP arithmetic, fused operations and square root

Affected families include FADD/FSUB/FMUL/FDIV, FMADD/FMSUB/FNMADD/FNMSUB, vector/by-element FMLA/FMLS, FADDP and FSQRT. Not every form fails every test.

Concrete captured examples with FPCR=0 and initial FPSR=0:

FP/integer and FP-format conversions

FCVT[NAMPZ][SU], SCVTF/UCVTF, their fixed-point forms, vector conversion/narrowing forms and half/single/double FCVT had counterexamples in that audit. Its legacy helpers lack CPU state, so they cannot correctly implement all required input flushing, rounding, invalid/inexact reporting, DN and AHP behavior. The earlier FRINT repair does not automatically repair conversions using other helpers.

Examples:

Estimates and refinement

The older FRECPE, FRSQRTE, FRECPX, FRECPS and FRSQRTS paths required correction of NaNs, exceptions, flushing and extreme-value behavior. For example, reciprocal estimate of zero must report divide-by-zero, not merely return infinity. The dedicated 5ea1d820 FRECPE control sweep reports 2,176 differing executions out of 3,072 AOT/interpreter comparisons.

The raw-bit/stateful backend now implements these semantics, including the guest's estimate algorithm. The vector FRSQRTE fast path has directed table-bin and mixed-lane tests in tests/native_rsqrte.c. Exactness tests remain necessary when extending any fast path; no title-specific workaround or masked result comparison replaces them.


Made from docs/history/divergences.md at 69237645142c. GPL-3.0-or-later.