notes

Software floating point libraries

Berkeley SoftFloat

Berkeley SoftFloat by John Hauser is a C library, that implements IEEE-754. The source is primarily distributed as archives and is seemingly maintained on GitHub.

Berkeley TestFloat tests IEEE-compliance. Berkeley HardFloat provides Verilog implementations.

Bindings and libraries:

Forks:

LLVM APFloat

llvm::APFloat is a C++ data type in LLVM, that implements arbitrary-precision floats with various semantics. The sources are at llvm/include/llvm/ADT/APFloat.h, llvm/unittests/ADT/APFloatTest.cpp, and llvm/lib/Support/APFloat.cpp.

rustc_apfloat is a port of it to Rust, used in rustc and Cranelift.

ieee-apsqrt extends rustc_apfloat with square root.

GNU MPFR

GNU MPFR is a C library for floating-point computations with arbitrary precision, which is set on construction.

Rug for Rust wraps MPFR with Float.

GCC …

libm

libm is a C math library for machines that support IEEE-754 binary64. Is has several implementations.

Go

Go uses a softfloat implementation by default for ARMv5, and it can be enabled for MIPS (since Go 1.10 [issue]), 386 (since Go 1.16 [issue]), and ARM (since Go 1.22 [issue]).

simple-soft-float

simple-soft-float is a straightforward reference implementation of IEEE-754 in Rust. It looks to be a great reference and has excellent tests. [crates.io]

Other

Tests and benchmarks

TODO

Fully list libraries from this thread.