[libc][NFC] Move cpu_features.h to properties subfolder
authorGuillaume Chatelet <gchatelet@google.com>
Thu, 9 Feb 2023 09:30:24 +0000 (09:30 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Thu, 9 Feb 2023 09:30:24 +0000 (09:30 +0000)
23 files changed:
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/nearest_integer.h
libc/src/__support/FPUtil/x86_64/FMA.h
libc/src/__support/macros/cpu_features.h [deleted file]
libc/src/__support/macros/properties/cpu_features.h [new file with mode: 0644]
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

index 5fde894cf8589793422d2255ca303a6795ce7192..0761244137b14e4adaaa85e5b975d53dc450d29c 100644 (file)
@@ -1,4 +1,4 @@
-#include "src/__support/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #ifndef LIBC_TARGET_CPU_HAS_AVX2
 #error unsupported
index 084a21549beda398b7490b5c9b8e5f27c3408d09..4816db59e1bee42b1ecb9f151941b8acda79dab5 100644 (file)
@@ -1,4 +1,4 @@
-#include "src/__support/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #ifndef LIBC_TARGET_CPU_HAS_AVX512BW
 #error unsupported
index 2d3f171d7c8877a94b19919a3f7a3c6715097baf..da177ab0ab35ac8d4c2786c64c1780e347e63e9b 100644 (file)
@@ -1,4 +1,4 @@
-#include "src/__support/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #ifndef LIBC_TARGET_CPU_HAS_AVX512F
 #error unsupported
index 69e979c7d81c3b4da2538970cbd6b4d5bfedd5c1..e587404c13c97ea05e3005894a364d1e20f99bf9 100644 (file)
@@ -1,4 +1,4 @@
-#include "src/__support/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #ifndef LIBC_TARGET_CPU_HAS_FMA
 #error unsupported
index cbc98139a3443d83e76f6dbd0f8face4df087db3..af8f797fa9b06cd0c4cd78e1c39f1726d9c926a7 100644 (file)
@@ -1,4 +1,4 @@
-#include "src/__support/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #ifndef LIBC_TARGET_CPU_HAS_SSE2
 #error unsupported
index 3c0bae8e9b7dedefa41c7b8d8f4c3d97ed7c8c93..7de2d64f14485a36f40dbcacc361049618e5e39d 100644 (file)
@@ -1,4 +1,4 @@
-#include "src/__support/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #ifndef LIBC_TARGET_CPU_HAS_SSE4_2
 #error unsupported
index f5d2a39b1b641cf2b87ebf5300e9d4a6fcc628f1..67663bf201152c7234b0d856c22e69cd5966fd5b 100644 (file)
@@ -35,7 +35,7 @@ add_header_library(
     endian.h
     macros/properties/architectures.h
     macros/attributes.h
-    macros/cpu_features.h
+    macros/properties/cpu_features.h
 )
 
 add_header_library(
index f428e1a29e0eae5dac08abb1eff53833731751bd..0416dd4be64bc91218c05fd7d84a96858821247b 100644 (file)
@@ -10,8 +10,8 @@
 #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_FMA_H
 
 #include "src/__support/common.h"
-#include "src/__support/macros/cpu_features.h"
 #include "src/__support/macros/properties/architectures.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #if defined(LIBC_TARGET_CPU_HAS_FMA)
 
index 43829b7a57c82d28cff0209f60dc00b29391ada7..1ee37650d53172abf84b87da5c90af4ddc8a3022 100644 (file)
@@ -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/macros/cpu_features.h"
 #include "src/__support/macros/properties/architectures.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #if !defined(LIBC_TARGET_ARCH_IS_AARCH64)
 #error "Invalid include"
index 075813ddd2c09f650cdc0664007afa18e8e7be43..2aaa2c60465b5af8c97aa930144de873dd5b6e96 100644 (file)
@@ -10,8 +10,8 @@
 #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_MULTIPLY_ADD_H
 
 #include "src/__support/common.h"
-#include "src/__support/macros/cpu_features.h"
 #include "src/__support/macros/properties/architectures.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 namespace __llvm_libc {
 namespace fputil {
index da1d8528b65205b4e1a0b1ad49e3bbb89fc962ce..3d42632bd7ca776fe981a0df1ad247cd541199e7 100644 (file)
@@ -10,8 +10,8 @@
 #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_NEAREST_INTEGER_H
 
 #include "src/__support/common.h"
-#include "src/__support/macros/cpu_features.h"
 #include "src/__support/macros/properties/architectures.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #if (defined(LIBC_TARGET_ARCH_IS_X86_64) && defined(LIBC_TARGET_CPU_HAS_SSE4_2))
 #include "x86_64/nearest_integer.h"
index e2bca9e963ee6f3e304373e8e88405ee6ff81544..3eafb3dc00c6ef8683ae3d01f7df9eba41152c1c 100644 (file)
@@ -10,8 +10,8 @@
 #define LLVM_LIBC_SRC_SUPPORT_FPUTIL_X86_64_FMA_H
 
 #include "src/__support/common.h"
-#include "src/__support/macros/cpu_features.h"
 #include "src/__support/macros/properties/architectures.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #if !defined(LIBC_TARGET_ARCH_IS_X86_64)
 #error "Invalid include"
diff --git a/libc/src/__support/macros/cpu_features.h b/libc/src/__support/macros/cpu_features.h
deleted file mode 100644 (file)
index bc7ba10..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-//===-- Compile time cpu feature detection ----------------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// This file lists target cpu features by introspecting compiler enabled
-// preprocessor definitions.
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC_SUPPORT_MACROS_CPU_FEATURES_H
-#define LLVM_LIBC_SRC_SUPPORT_MACROS_CPU_FEATURES_H
-
-#if defined(__SSE2__)
-#define LIBC_TARGET_CPU_HAS_SSE2
-#endif
-
-#if defined(__SSE4_2__)
-#define LIBC_TARGET_CPU_HAS_SSE4_2
-#endif
-
-#if defined(__AVX__)
-#define LIBC_TARGET_CPU_HAS_AVX
-#endif
-
-#if defined(__AVX2__)
-#define LIBC_TARGET_CPU_HAS_AVX2
-#endif
-
-#if defined(__AVX512F__)
-#define LIBC_TARGET_CPU_HAS_AVX512F
-#endif
-
-#if defined(__AVX512BW__)
-#define LIBC_TARGET_CPU_HAS_AVX512BW
-#endif
-
-#if defined(__ARM_FEATURE_FMA) || defined(__AVX2__) || defined(__FMA__)
-#define LIBC_TARGET_CPU_HAS_FMA
-#endif
-
-#endif // LLVM_LIBC_SRC_SUPPORT_MACROS_CPU_FEATURES_H
diff --git a/libc/src/__support/macros/properties/cpu_features.h b/libc/src/__support/macros/properties/cpu_features.h
new file mode 100644 (file)
index 0000000..b986351
--- /dev/null
@@ -0,0 +1,43 @@
+//===-- Compile time cpu feature detection ----------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+// This file lists target cpu features by introspecting compiler enabled
+// preprocessor definitions.
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_SUPPORT_MACROS_PROPERTIES_CPU_FEATURES_H
+#define LLVM_LIBC_SRC_SUPPORT_MACROS_PROPERTIES_CPU_FEATURES_H
+
+#if defined(__SSE2__)
+#define LIBC_TARGET_CPU_HAS_SSE2
+#endif
+
+#if defined(__SSE4_2__)
+#define LIBC_TARGET_CPU_HAS_SSE4_2
+#endif
+
+#if defined(__AVX__)
+#define LIBC_TARGET_CPU_HAS_AVX
+#endif
+
+#if defined(__AVX2__)
+#define LIBC_TARGET_CPU_HAS_AVX2
+#endif
+
+#if defined(__AVX512F__)
+#define LIBC_TARGET_CPU_HAS_AVX512F
+#endif
+
+#if defined(__AVX512BW__)
+#define LIBC_TARGET_CPU_HAS_AVX512BW
+#endif
+
+#if defined(__ARM_FEATURE_FMA) || defined(__AVX2__) || defined(__FMA__)
+#define LIBC_TARGET_CPU_HAS_FMA
+#endif
+
+#endif // LLVM_LIBC_SRC_SUPPORT_MACROS_PROPERTIES_CPU_FEATURES_H
index b50c2cb80ca14a73898ee9116a8f3330371bafe6..f94eac8d904b6af1b6e725e27c540ede957368d4 100644 (file)
@@ -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/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #include <errno.h>
 
index c84d4fbbf4fbb0a9c5b0f7b5f5f19a3967429a86..05f1cd2d99b19ea06ed1b48c06e430b7b9726251 100644 (file)
@@ -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/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #include <errno.h>
 
index 43e7d2dffb8258551558dbd6724034cacfacfc45..0ee0721463225e985ef645427307dafbcd46f885 100644 (file)
@@ -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/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #include <errno.h>
 
index 82ddaa83c09d58af0e84dafdd5b26ec54d5e0f39..ea6722927300b7fc5e6a822c8bd18b1cd024ce43 100644 (file)
@@ -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/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #include <errno.h>
 
index 3fd713edc4c03effe91d6cfc292b011a7c08b946..bda1117a8cfac423f3fca9b00474914cf4416b5a 100644 (file)
@@ -12,7 +12,7 @@
 #include "src/__support/FPUtil/FPBits.h"
 #include "src/__support/FPUtil/PolyEval.h"
 #include "src/__support/common.h"
-#include "src/__support/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #if defined(LIBC_TARGET_CPU_HAS_FMA)
 #include "range_reduction_fma.h"
index 511f548060a5d86bdca58c0b8532e85d55f6543d..488a3e419208cd95c0464419c0bc4f73dbbb9798 100644 (file)
@@ -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/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #include <errno.h>
 
index 9c2f685a00a28a2f717e4057bba7d6c01bde6276..d2214282957ec4ea50d24b42fd2ac04542a7dfa9 100644 (file)
@@ -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/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 
 #include <errno.h>
 
index b0de6f94df7ebefba0b111c39db82e85da2e4115..87a8874771706389b3751049d4c623351e9a6a5d 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/math/tanhf.h"
 #include "src/__support/FPUtil/FPBits.h"
-#include "src/__support/macros/cpu_features.h"
+#include "src/__support/macros/properties/cpu_features.h"
 #include "src/math/generic/explogxf.h"
 
 namespace __llvm_libc {
index d114467645c12e20f578b2c8813b1b60fa71db08..42045a02ef9474a53b80c3ea033eec3a0ccda28f 100644 (file)
@@ -82,7 +82,7 @@ libc_support_library(
         "src/__support/endian.h",
         "src/__support/macros/properties/architectures.h",
         "src/__support/macros/attributes.h",
-        "src/__support/macros/cpu_features.h",
+        "src/__support/macros/properties/cpu_features.h",
     ],
     deps = [":libc_root"],
 )