[libc-commits] [PATCH] D143234: [libc] Add -mavx2 together with -mfma to allow clang pre-12 to generate fmainstructions.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Feb 3 12:12:24 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGc1e252417e39: [libc] Add -mavx2 together with -mfma to allow clang pre-12 to generate fma (authored by lntue).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143234/new/

https://reviews.llvm.org/D143234

Files:
  libc/cmake/modules/LLVMLibCObjectRules.cmake
  libc/test/src/math/CMakeLists.txt


Index: libc/test/src/math/CMakeLists.txt
===================================================================
--- libc/test/src/math/CMakeLists.txt
+++ libc/test/src/math/CMakeLists.txt
@@ -1317,24 +1317,22 @@
     libc.src.__support.FPUtil.fp_bits
 )
 
-# TODO: Enable log10_test after #60282 is addressed. It is disabled for now
-# as it is failing on the bots.
-#add_fp_unittest(
-#  log10_test
-#  NEED_MPFR
-#  SUITE
-#    libc_math_unittests
-#  SRCS
-#    log10_test.cpp
-#  DEPENDS
-#    libc.include.errno
-#    libc.src.errno.errno
-#    libc.include.math
-#    libc.src.math.log10
-#    libc.src.__support.FPUtil.fp_bits
-#  FLAGS
-#    FMA_OPT__ONLY
-#)
+add_fp_unittest(
+ log10_test
+ NEED_MPFR
+ SUITE
+   libc_math_unittests
+ SRCS
+   log10_test.cpp
+ DEPENDS
+   libc.include.errno
+   libc.src.errno.errno
+   libc.include.math
+   libc.src.math.log10
+   libc.src.__support.FPUtil.fp_bits
+ FLAGS
+   FMA_OPT__ONLY
+)
 
 add_fp_unittest(
   log10f_test
Index: libc/cmake/modules/LLVMLibCObjectRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -39,6 +39,7 @@
       list(APPEND compile_options "-Wthread-safety")
     endif()
     if(ADD_FMA_FLAG)
+      list(APPEND compile_options "-mavx2")
       list(APPEND compile_options "-mfma")
     endif()
     if(ADD_SSE4_2_FLAG)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143234.494701.patch
Type: text/x-patch
Size: 1424 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230203/4bed01f2/attachment.bin>


More information about the libc-commits mailing list