[libc-commits] [libc] ced5a38 - [libc][NFC] Move cpu_features to macros folder

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Tue Feb 7 02:32:30 PST 2023


Author: Guillaume Chatelet
Date: 2023-02-07T10:32:19Z
New Revision: ced5a382a8ebeffa828cdd66d5dfcc2d97716f85

URL: https://github.com/llvm/llvm-project/commit/ced5a382a8ebeffa828cdd66d5dfcc2d97716f85
DIFF: https://github.com/llvm/llvm-project/commit/ced5a382a8ebeffa828cdd66d5dfcc2d97716f85.diff

LOG: [libc][NFC] Move cpu_features to macros folder

Added: 
    libc/src/__support/macros/cpu_features.h

Modified: 
    libc/cmake/modules/cpu_features/check_AVX2.cpp
    libc/cmake/modules/cpu_features/check_AVX512BW.cpp
    libc/cmake/modules/cpu_features/check_AVX512F.cpp
    libc/cmake/modules/cpu_features/check_FMA.cpp
    libc/cmake/modules/cpu_features/check_SSE2.cpp
    libc/cmake/modules/cpu_features/check_SSE4_2.cpp
    libc/src/__support/CMakeLists.txt
    libc/src/__support/FPUtil/FMA.h
    libc/src/__support/FPUtil/aarch64/FMA.h
    libc/src/__support/FPUtil/multiply_add.h
    libc/src/__support/FPUtil/x86_64/FMA.h
    libc/src/math/generic/asinf.cpp
    libc/src/math/generic/cosf.cpp
    libc/src/math/generic/expm1f.cpp
    libc/src/math/generic/sincosf.cpp
    libc/src/math/generic/sincosf_utils.h
    libc/src/math/generic/sinf.cpp
    libc/src/math/generic/tanf.cpp
    libc/src/math/generic/tanhf.cpp
    utils/bazel/llvm-project-overlay/libc/BUILD.bazel

Removed: 
    libc/src/__support/cpu_features.h


################################################################################
diff  --git a/libc/cmake/modules/cpu_features/check_AVX2.cpp b/libc/cmake/modules/cpu_features/check_AVX2.cpp
index 4330308ab836e..024dd40eb1f6f 100644
--- a/libc/cmake/modules/cpu_features/check_AVX2.cpp
+++ b/libc/cmake/modules/cpu_features/check_AVX2.cpp
@@ -1,4 +1,4 @@
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #ifndef LIBC_TARGET_HAS_AVX2
 #error unsupported

diff  --git a/libc/cmake/modules/cpu_features/check_AVX512BW.cpp b/libc/cmake/modules/cpu_features/check_AVX512BW.cpp
index 4e8cfc2f10fab..5010612b0f900 100644
--- a/libc/cmake/modules/cpu_features/check_AVX512BW.cpp
+++ b/libc/cmake/modules/cpu_features/check_AVX512BW.cpp
@@ -1,4 +1,4 @@
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #ifndef LIBC_TARGET_HAS_AVX512BW
 #error unsupported

diff  --git a/libc/cmake/modules/cpu_features/check_AVX512F.cpp b/libc/cmake/modules/cpu_features/check_AVX512F.cpp
index 8491654b692e9..2bab186ddde25 100644
--- a/libc/cmake/modules/cpu_features/check_AVX512F.cpp
+++ b/libc/cmake/modules/cpu_features/check_AVX512F.cpp
@@ -1,4 +1,4 @@
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #ifndef LIBC_TARGET_HAS_AVX512F
 #error unsupported

diff  --git a/libc/cmake/modules/cpu_features/check_FMA.cpp b/libc/cmake/modules/cpu_features/check_FMA.cpp
index 909875684ecfe..b5244763efca7 100644
--- a/libc/cmake/modules/cpu_features/check_FMA.cpp
+++ b/libc/cmake/modules/cpu_features/check_FMA.cpp
@@ -1,4 +1,4 @@
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #ifndef LIBC_TARGET_HAS_FMA
 #error unsupported

diff  --git a/libc/cmake/modules/cpu_features/check_SSE2.cpp b/libc/cmake/modules/cpu_features/check_SSE2.cpp
index eee2dea2d5381..d1c01ee6ec700 100644
--- a/libc/cmake/modules/cpu_features/check_SSE2.cpp
+++ b/libc/cmake/modules/cpu_features/check_SSE2.cpp
@@ -1,4 +1,4 @@
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #ifndef LIBC_TARGET_HAS_SSE2
 #error unsupported

diff  --git a/libc/cmake/modules/cpu_features/check_SSE4_2.cpp b/libc/cmake/modules/cpu_features/check_SSE4_2.cpp
index 43586b25ed7d8..5280430cef872 100644
--- a/libc/cmake/modules/cpu_features/check_SSE4_2.cpp
+++ b/libc/cmake/modules/cpu_features/check_SSE4_2.cpp
@@ -1,4 +1,4 @@
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #ifndef LIBC_TARGET_HAS_SSE4_2
 #error unsupported

diff  --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index 7d68137c2c104..a937e5bdb90d1 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -33,7 +33,7 @@ add_header_library(
   HDRS
     macros/architectures.h
     common.h
-    cpu_features.h
+    macros/cpu_features.h
     endian.h
 )
 

diff  --git a/libc/src/__support/FPUtil/FMA.h b/libc/src/__support/FPUtil/FMA.h
index 68bb952d57f68..b78577a1783ed 100644
--- a/libc/src/__support/FPUtil/FMA.h
+++ b/libc/src/__support/FPUtil/FMA.h
@@ -10,8 +10,8 @@
 #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_FMA_H
 
 #include "src/__support/common.h"
-#include "src/__support/cpu_features.h"
 #include "src/__support/macros/architectures.h"
+#include "src/__support/macros/cpu_features.h"
 
 #if defined(LIBC_TARGET_HAS_FMA)
 

diff  --git a/libc/src/__support/FPUtil/aarch64/FMA.h b/libc/src/__support/FPUtil/aarch64/FMA.h
index 0f319a7bfd83a..83181930c1bf9 100644
--- a/libc/src/__support/FPUtil/aarch64/FMA.h
+++ b/libc/src/__support/FPUtil/aarch64/FMA.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_AARCH64_FMA_H
 #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_AARCH64_FMA_H
 
-#include "src/__support/cpu_features.h"
 #include "src/__support/macros/architectures.h"
+#include "src/__support/macros/cpu_features.h"
 
 #if !defined(LIBC_TARGET_IS_AARCH64)
 #error "Invalid include"

diff  --git a/libc/src/__support/FPUtil/multiply_add.h b/libc/src/__support/FPUtil/multiply_add.h
index f2db75945850d..e5df0f5dc5142 100644
--- a/libc/src/__support/FPUtil/multiply_add.h
+++ b/libc/src/__support/FPUtil/multiply_add.h
@@ -10,8 +10,8 @@
 #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_MULTIPLY_ADD_H
 
 #include "src/__support/common.h"
-#include "src/__support/cpu_features.h"
 #include "src/__support/macros/architectures.h"
+#include "src/__support/macros/cpu_features.h"
 
 namespace __llvm_libc {
 namespace fputil {

diff  --git a/libc/src/__support/FPUtil/x86_64/FMA.h b/libc/src/__support/FPUtil/x86_64/FMA.h
index 466f41316258a..48e7d08b339ff 100644
--- a/libc/src/__support/FPUtil/x86_64/FMA.h
+++ b/libc/src/__support/FPUtil/x86_64/FMA.h
@@ -10,8 +10,8 @@
 #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_X86_64_FMA_H
 
 #include "src/__support/common.h"
-#include "src/__support/cpu_features.h"
 #include "src/__support/macros/architectures.h"
+#include "src/__support/macros/cpu_features.h"
 
 #if !defined(LIBC_TARGET_IS_X86_64)
 #error "Invalid include"

diff  --git a/libc/src/__support/cpu_features.h b/libc/src/__support/macros/cpu_features.h
similarity index 86%
rename from libc/src/__support/cpu_features.h
rename to libc/src/__support/macros/cpu_features.h
index 68bf6fa474c56..34c46f5f8adc9 100644
--- a/libc/src/__support/cpu_features.h
+++ b/libc/src/__support/macros/cpu_features.h
@@ -9,8 +9,8 @@
 // preprocessor definitions.
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_LIBC_SRC_SUPPORT_CPU_FEATURES_H
-#define LLVM_LIBC_SRC_SUPPORT_CPU_FEATURES_H
+#ifndef LLVM_LIBC_SRC_SUPPORT_MACROS_CPU_FEATURES_H
+#define LLVM_LIBC_SRC_SUPPORT_MACROS_CPU_FEATURES_H
 
 #if defined(__SSE2__)
 #define LIBC_TARGET_HAS_SSE2
@@ -40,4 +40,4 @@
 #define LIBC_TARGET_HAS_FMA
 #endif
 
-#endif // LLVM_LIBC_SRC_SUPPORT_CPU_FEATURES_H
+#endif // LLVM_LIBC_SRC_SUPPORT_MACROS_CPU_FEATURES_H

diff  --git a/libc/src/math/generic/asinf.cpp b/libc/src/math/generic/asinf.cpp
index 1b38e8dc3e859..ab3ea69da5d6e 100644
--- a/libc/src/math/generic/asinf.cpp
+++ b/libc/src/math/generic/asinf.cpp
@@ -13,7 +13,7 @@
 #include "src/__support/FPUtil/except_value_utils.h"
 #include "src/__support/FPUtil/multiply_add.h"
 #include "src/__support/FPUtil/sqrt.h"
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #include <errno.h>
 

diff  --git a/libc/src/math/generic/cosf.cpp b/libc/src/math/generic/cosf.cpp
index fce60cdcb723d..297f66780a915 100644
--- a/libc/src/math/generic/cosf.cpp
+++ b/libc/src/math/generic/cosf.cpp
@@ -14,7 +14,7 @@
 #include "src/__support/FPUtil/except_value_utils.h"
 #include "src/__support/FPUtil/multiply_add.h"
 #include "src/__support/common.h"
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #include <errno.h>
 

diff  --git a/libc/src/math/generic/expm1f.cpp b/libc/src/math/generic/expm1f.cpp
index 8b57522be0761..e029dd2beb173 100644
--- a/libc/src/math/generic/expm1f.cpp
+++ b/libc/src/math/generic/expm1f.cpp
@@ -16,7 +16,7 @@
 #include "src/__support/FPUtil/multiply_add.h"
 #include "src/__support/FPUtil/nearest_integer.h"
 #include "src/__support/common.h"
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #include <errno.h>
 

diff  --git a/libc/src/math/generic/sincosf.cpp b/libc/src/math/generic/sincosf.cpp
index 991eb32b1468c..75d985d795797 100644
--- a/libc/src/math/generic/sincosf.cpp
+++ b/libc/src/math/generic/sincosf.cpp
@@ -12,7 +12,7 @@
 #include "src/__support/FPUtil/FPBits.h"
 #include "src/__support/FPUtil/multiply_add.h"
 #include "src/__support/common.h"
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #include <errno.h>
 

diff  --git a/libc/src/math/generic/sincosf_utils.h b/libc/src/math/generic/sincosf_utils.h
index 358c1cf62d61b..013c1ad51ad7c 100644
--- a/libc/src/math/generic/sincosf_utils.h
+++ b/libc/src/math/generic/sincosf_utils.h
@@ -12,7 +12,7 @@
 #include "src/__support/FPUtil/FPBits.h"
 #include "src/__support/FPUtil/PolyEval.h"
 #include "src/__support/common.h"
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #if defined(LIBC_TARGET_HAS_FMA)
 #include "range_reduction_fma.h"

diff  --git a/libc/src/math/generic/sinf.cpp b/libc/src/math/generic/sinf.cpp
index 836df2887825d..f931e0dd1d18e 100644
--- a/libc/src/math/generic/sinf.cpp
+++ b/libc/src/math/generic/sinf.cpp
@@ -14,7 +14,7 @@
 #include "src/__support/FPUtil/PolyEval.h"
 #include "src/__support/FPUtil/multiply_add.h"
 #include "src/__support/common.h"
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #include <errno.h>
 

diff  --git a/libc/src/math/generic/tanf.cpp b/libc/src/math/generic/tanf.cpp
index 0f3961ee5422a..963ce0f8f389a 100644
--- a/libc/src/math/generic/tanf.cpp
+++ b/libc/src/math/generic/tanf.cpp
@@ -15,7 +15,7 @@
 #include "src/__support/FPUtil/multiply_add.h"
 #include "src/__support/FPUtil/nearest_integer.h"
 #include "src/__support/common.h"
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 
 #include <errno.h>
 

diff  --git a/libc/src/math/generic/tanhf.cpp b/libc/src/math/generic/tanhf.cpp
index 8b6771b768821..4000730032285 100644
--- a/libc/src/math/generic/tanhf.cpp
+++ b/libc/src/math/generic/tanhf.cpp
@@ -8,7 +8,7 @@
 
 #include "src/math/tanhf.h"
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/cpu_features.h"
+#include "src/__support/macros/cpu_features.h"
 #include "src/math/generic/explogxf.h"
 
 namespace __llvm_libc {

diff  --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 4e243602cd79c..c87482c19e9f7 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -79,7 +79,7 @@ libc_support_library(
     hdrs = [
         "src/__support/macros/architectures.h",
         "src/__support/common.h",
-        "src/__support/cpu_features.h",
+        "src/__support/macros/cpu_features.h",
         "src/__support/endian.h",
     ],
 )


        


More information about the libc-commits mailing list