[all-commits] [llvm/llvm-project] b0dbd2: [libc][math] Add option to set a specific exponent...

lntue via All-commits all-commits at lists.llvm.org
Fri Oct 18 06:58:37 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b0dbd2ca5b52a277560a70a2864ea9949f1e3794
      https://github.com/llvm/llvm-project/commit/b0dbd2ca5b52a277560a70a2864ea9949f1e3794
  Author: lntue <lntue at google.com>
  Date:   2024-10-18 (Fri, 18 Oct 2024)

  Changed paths:
    M libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
    M libc/config/config.json
    M libc/docs/configure.rst
    M libc/src/__support/FPUtil/ManipulationFunctions.h
    M libc/test/src/math/smoke/FrexpTest.h

  Log Message:
  -----------
  [libc][math] Add option to set a specific exponent for frexp with Inf/NaN inputs. (#112387)

In IEEE 754 and C standards, when calling `frexp` with Inf/Nan inputs,
the exponent result is unspecified. In this case, FreeBSD libc and musl
just passthrough `exp`, while glibc, FreeBSD libm set exp = 0, and MSVC
set exp = -1.

By default, LLVM libc will passthrough `exp` just as FreeBSD libc and
musl, but we also allow users to explicitly choose the return exp value
in this case for compatibility with other libc.

Notice that, gcc did generate passthrough `exp` for `frexp(NaN/Inf,
exp)`: https://godbolt.org/z/sM8fEej4E



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list