[libc-commits] [libc] [libc][math] Fix missing underflow exception in DyadicFloat::generic_as (PR #186734)

via libc-commits libc-commits at lists.llvm.org
Thu Apr 9 00:50:50 PDT 2026


zimmermann6 wrote:

I have added to the CORE-MATH test suite a macro CORE_MATH_UNDERFLOW_BEFORE to check underflow before rounding. Please use that if LLVM libc assumes underflow before rounding. Note that CORE_MATH_UNDERFLOW_BEFORE might not be implemented for all formats and types of functions (univariate, bivariate, sincos-like). Please report to the CORE-MATH mailing list of any issue.

With the CORE-MATH test suite, the command to check LLVM functions is for example:
```
$ CORE_MATH_STD_NAME=expbf16 EXTRA_CFLAGS=-DCORE_MATH_UNDERFLOW_BEFORE CORE_MATH_CHECK_STD=true LIBM=$L ./check.sh exp_bf16
```
where CORE_MATH_STD_NAME=expbf16 is needed because the names differ between LLVM libc and CORE-MATH.

https://github.com/llvm/llvm-project/pull/186734


More information about the libc-commits mailing list