1 of 8

LLVM libc math library 2026++

Tue Ly

Confidential + Proprietary

2 of 8

Long term goals

  • Math libraries completion
    • math.h
    • complex.h
    • libmvec
    • stdfix.h
  • Hand-in-hand++
    • Make LLVM libc math library the math library of all LLVM projects.
  • More than correctness
    • Specializations and customizations to support all use-cases.

Confidential + Proprietary

3 of 8

Math.h - Higher Math Functions

  • C23 / C++23 and beyond 2026 goals�
  • float: 35/50 complete
  • double: 23/51 complete
  • float16: 31/49 complete
  • bfloat16: 2/49 complete
  • float80: 4/52 algebraic + exps + logs + (inv) trigs + (inv) hyperbolic
  • float128: 5/52 algebraic + exps + logs + (inv) trigs + (inv) hyperbolic
  • decimal floating points N/A

Confidential + Proprietary

4 of 8

Complex.h

  • Work with CFP to make complex.h match C23 math.h functionality
    • Extend type support: complex float16, complex bfloat16, complex float128, …
  • Correctly rounded basic operations
  • Correctly rounded higher math functions

2026 goals:

  • complex.h proposal with CFP
  • correctly rounded + performant basic operations + algebraic functions.

Confidential + Proprietary

5 of 8

Vector math

  • Vectorize all math functions for all types
  • Support “all” architectures

2026 goals:

  • algebraic + exps + logs + (inv) trigs + (inv) hyperbolic
  • x86-64 + aarch64

Confidential + Proprietary

6 of 8

Fixed point

  • Revise the fixed point TR, propose an updated TS.
  • Implement all functions

2026 goal:

  • Update fixed-point TS.

Confidential + Proprietary

7 of 8

Hand-in-hand++

  • Use LLVM libc math routines in all LLVM projects
    • LLVM, Clang, libc++, compiler-rt, flang?, …

2026 goals:

  • LLVM libc infra updates:
    • full soft-float support for float + double + float80 + float128
    • refactor math functions to header-only
    • more pre-commit CIs for targets supported by LLVM
  • Use in LLVM projects:
    • LLVM - APFloat, constant propagation
    • Clang - Constexpr builtins, interpreter
    • libc++ - C++26 constexpr math
    • compiler-rt - generic soft-floats (GSoC 2026)

Confidential + Proprietary

8 of 8

More than correctness

  • Support other use cases where correctness and accuracy can be relaxed
    • GPUs, embedded systems, …
  • Static rounding
    • Floating-point environment emulation
    • Type-specific float-point environments

2026 goals:

  • Add float-only option for all float functions
  • Static rounding without changing floating point environments.
  • More customizations
    • Bounded ULP levels, errno, floating point exceptions, …

Confidential + Proprietary