[libc-commits] [PATCH] D123335: [libc] Add support for x86-64 targets that do not have FMA instructions.

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Apr 7 15:51:54 PDT 2022


michaelrj added a comment.

LGTM as is, I looked into if this patch allowed for reverting this one: https://reviews.llvm.org/D122689 and added my results as a comment.



================
Comment at: libc/src/math/generic/CMakeLists.txt:517
     -O3
     -mfma
 )
----------------
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
```


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