[libre-riscv-dev] FP unit testing (was Re: [isa-dev] FP reciprocal sqrt extension proposal)

Jacob Lifshay programmerjake at gmail.com
Sun Jul 14 08:39:34 BST 2019

On Sun, Jul 14, 2019 at 12:26 AM lkcl <luke.leighton at gmail.com> wrote:
> using bigfloat to perform the reciprocal-square-root in a much higher precision will cover the requirement to provide accurate FPSQRT.  however the corner-cases (at the extreme limits of the exponent, and when the mantissa's MSB is zero) are going to be a bundle of fun.
Note that mpfr has code to emulate fixed-size floating point numbers,
including handling denormal numbers. It also has mostly (see caveats)
the same special-case semantics (+-0, +-Inf, NaN) as IEEE 754, so that
should make it a lot easier to use.

MPFR is used in gcc to evaluate floating-point expressions at compile
time, so it is well-tested and likely to be correct.

mpfr does, however, have some notable caveats: see


More information about the libre-riscv-dev mailing list