[libc-commits] [PATCH] D123335: [libc] Add support for x86-64 targets that do not have FMA instructions.
Tue Ly via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Apr 7 19:19:48 PDT 2022
lntue added inline comments.
================
Comment at: libc/src/math/generic/CMakeLists.txt:517
-O3
-mfma
)
----------------
michaelrj wrote:
> On windows, removing the `-mfma` options in this cmake file with this patch doesn't break any of the tests except for this one. The `expm1f` tests fail with a ULP error, copied below.
>
>
> ```
> [ RUN ] LlvmLibcExpm1fTest.InFloatRange
> C:/src/llvm-project/libc/test/src/math/expm1f_test.cpp:119: FAILURE
> Failed to match __llvm_libc::expm1f(x) against __llvm_libc::testing::mpfr::get_mpfr_matcher<mpfr::Operation::Expm1>( x, __llvm_libc::expm1f(x), 0.5, mpfr::RoundingMode::TowardZero).
> Match value not within tolerance value of MPFR result:
> Input decimal: -0.00000000000000000000000000000000000001175976677754
> Input bits: 0x80800d72, (S | E | M) = (1 | 0x01 | 0x000d72)
>
> Match decimal: -0.00000000000000000000000000000000000001175976677754
> Match bits: 0x80800d72, (S | E | M) = (1 | 0x01 | 0x000d72)
>
> MPFR result: -0.00000000000000000000000000000000000001175976537624
> MPFR rounded: 0x80800d71, (S | E | M) = (1 | 0x01 | 0x000d71)
>
> ULP error: 1.000000
> [ FAILED ] LlvmLibcExpm1fTest.InFloatRange
> Ran 5 tests. PASS: 4 FAIL: 1
> ```
This is expected. There will be followup changes to take care of different exceptional values from math functions when FMA instructions are not supported.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123335/new/
https://reviews.llvm.org/D123335
More information about the libc-commits
mailing list