summaryrefslogtreecommitdiff
path: root/libc/src/complex/generic
diff options
context:
space:
mode:
Diffstat (limited to 'libc/src/complex/generic')
-rw-r--r--libc/src/complex/generic/CMakeLists.txt128
-rw-r--r--libc/src/complex/generic/cimagf128.cpp4
-rw-r--r--libc/src/complex/generic/cimagf16.cpp4
-rw-r--r--libc/src/complex/generic/conj.cpp19
-rw-r--r--libc/src/complex/generic/conjf.cpp19
-rw-r--r--libc/src/complex/generic/conjf128.cpp19
-rw-r--r--libc/src/complex/generic/conjf16.cpp19
-rw-r--r--libc/src/complex/generic/conjl.cpp19
-rw-r--r--libc/src/complex/generic/cproj.cpp19
-rw-r--r--libc/src/complex/generic/cprojf.cpp19
-rw-r--r--libc/src/complex/generic/cprojf128.cpp19
-rw-r--r--libc/src/complex/generic/cprojf16.cpp19
-rw-r--r--libc/src/complex/generic/cprojl.cpp19
-rw-r--r--libc/src/complex/generic/crealf128.cpp4
-rw-r--r--libc/src/complex/generic/crealf16.cpp4
15 files changed, 318 insertions, 16 deletions
diff --git a/libc/src/complex/generic/CMakeLists.txt b/libc/src/complex/generic/CMakeLists.txt
index a3da781c6023..3dae6f8a6149 100644
--- a/libc/src/complex/generic/CMakeLists.txt
+++ b/libc/src/complex/generic/CMakeLists.txt
@@ -1,4 +1,132 @@
add_entrypoint_object(
+ cproj
+ SRCS
+ cproj.cpp
+ HDRS
+ ../cproj.h
+ COMPILE_OPTIONS
+ ${libc_opt_high_flag}
+ DEPENDS
+ libc.src.__support.complex_type
+)
+
+add_entrypoint_object(
+ cprojf
+ SRCS
+ cprojf.cpp
+ HDRS
+ ../cprojf.h
+ COMPILE_OPTIONS
+ ${libc_opt_high_flag}
+ DEPENDS
+ libc.src.__support.complex_type
+)
+
+add_entrypoint_object(
+ cprojl
+ SRCS
+ cprojl.cpp
+ HDRS
+ ../cprojl.h
+ COMPILE_OPTIONS
+ ${libc_opt_high_flag}
+ DEPENDS
+ libc.src.__support.complex_type
+)
+
+add_entrypoint_object(
+ cprojf16
+ SRCS
+ cprojf16.cpp
+ HDRS
+ ../cprojf16.h
+ COMPILE_OPTIONS
+ ${libc_opt_high_flag}
+ DEPENDS
+ libc.src.__support.complex_type
+ libc.src.__support.macros.properties.types
+ libc.src.__support.macros.properties.complex_types
+)
+
+add_entrypoint_object(
+ cprojf128
+ SRCS
+ cprojf128.cpp
+ HDRS
+ ../cprojf128.h
+ COMPILE_OPTIONS
+ ${libc_opt_high_flag}
+ DEPENDS
+ libc.src.__support.complex_type
+ libc.src.__support.macros.properties.types
+ libc.src.__support.macros.properties.complex_types
+)
+
+add_entrypoint_object(
+ conj
+ SRCS
+ conj.cpp
+ HDRS
+ ../conj.h
+ COMPILE_OPTIONS
+ ${libc_opt_high_flag}
+ DEPENDS
+ libc.src.__support.complex_type
+)
+
+add_entrypoint_object(
+ conjf
+ SRCS
+ conjf.cpp
+ HDRS
+ ../conjf.h
+ COMPILE_OPTIONS
+ ${libc_opt_high_flag}
+ DEPENDS
+ libc.src.__support.complex_type
+)
+
+add_entrypoint_object(
+ conjl
+ SRCS
+ conjl.cpp
+ HDRS
+ ../conjl.h
+ COMPILE_OPTIONS
+ ${libc_opt_high_flag}
+ DEPENDS
+ libc.src.__support.complex_type
+)
+
+add_entrypoint_object(
+ conjf16
+ SRCS
+ conjf16.cpp
+ HDRS
+ ../conjf16.h
+ COMPILE_OPTIONS
+ ${libc_opt_high_flag}
+ DEPENDS
+ libc.src.__support.complex_type
+ libc.src.__support.macros.properties.types
+ libc.src.__support.macros.properties.complex_types
+)
+
+add_entrypoint_object(
+ conjf128
+ SRCS
+ conjf128.cpp
+ HDRS
+ ../conjf128.h
+ COMPILE_OPTIONS
+ ${libc_opt_high_flag}
+ DEPENDS
+ libc.src.__support.complex_type
+ libc.src.__support.macros.properties.types
+ libc.src.__support.macros.properties.complex_types
+)
+
+add_entrypoint_object(
creal
SRCS
creal.cpp
diff --git a/libc/src/complex/generic/cimagf128.cpp b/libc/src/complex/generic/cimagf128.cpp
index c21bd7f4602c..78dbb8eddd3e 100644
--- a/libc/src/complex/generic/cimagf128.cpp
+++ b/libc/src/complex/generic/cimagf128.cpp
@@ -7,8 +7,6 @@
//===----------------------------------------------------------------------===//
#include "src/complex/cimagf128.h"
-#if defined(LIBC_TYPES_HAS_CFLOAT128)
-
#include "src/__support/CPP/bit.h"
#include "src/__support/common.h"
#include "src/__support/complex_type.h"
@@ -21,5 +19,3 @@ LLVM_LIBC_FUNCTION(float128, cimagf128, (cfloat128 x)) {
}
} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_CFLOAT128
diff --git a/libc/src/complex/generic/cimagf16.cpp b/libc/src/complex/generic/cimagf16.cpp
index 361687984067..25d9b3ddf3b6 100644
--- a/libc/src/complex/generic/cimagf16.cpp
+++ b/libc/src/complex/generic/cimagf16.cpp
@@ -7,8 +7,6 @@
//===----------------------------------------------------------------------===//
#include "src/complex/cimagf16.h"
-#if defined(LIBC_TYPES_HAS_CFLOAT16)
-
#include "src/__support/CPP/bit.h"
#include "src/__support/common.h"
#include "src/__support/complex_type.h"
@@ -21,5 +19,3 @@ LLVM_LIBC_FUNCTION(float16, cimagf16, (cfloat16 x)) {
}
} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_CFLOAT16
diff --git a/libc/src/complex/generic/conj.cpp b/libc/src/complex/generic/conj.cpp
new file mode 100644
index 000000000000..cbcd480d6efa
--- /dev/null
+++ b/libc/src/complex/generic/conj.cpp
@@ -0,0 +1,19 @@
+//===-- Implementation of conj function -----------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/complex/conj.h"
+#include "src/__support/common.h"
+#include "src/__support/complex_type.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(_Complex double, conj, (_Complex double x)) {
+ return conjugate<_Complex double>(x);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/complex/generic/conjf.cpp b/libc/src/complex/generic/conjf.cpp
new file mode 100644
index 000000000000..a1af3d78ebc6
--- /dev/null
+++ b/libc/src/complex/generic/conjf.cpp
@@ -0,0 +1,19 @@
+//===-- Implementation of conjf function ----------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/complex/conjf.h"
+#include "src/__support/common.h"
+#include "src/__support/complex_type.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(_Complex float, conjf, (_Complex float x)) {
+ return conjugate<_Complex float>(x);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/complex/generic/conjf128.cpp b/libc/src/complex/generic/conjf128.cpp
new file mode 100644
index 000000000000..a63809a66e25
--- /dev/null
+++ b/libc/src/complex/generic/conjf128.cpp
@@ -0,0 +1,19 @@
+//===-- Implementation of conjf128 function -------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/complex/conjf128.h"
+#include "src/__support/common.h"
+#include "src/__support/complex_type.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(cfloat128, conjf128, (cfloat128 x)) {
+ return conjugate<cfloat128>(x);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/complex/generic/conjf16.cpp b/libc/src/complex/generic/conjf16.cpp
new file mode 100644
index 000000000000..cd1ab67ed1cd
--- /dev/null
+++ b/libc/src/complex/generic/conjf16.cpp
@@ -0,0 +1,19 @@
+//===-- Implementation of conjf16 function --------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/complex/conjf16.h"
+#include "src/__support/common.h"
+#include "src/__support/complex_type.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(cfloat16, conjf16, (cfloat16 x)) {
+ return conjugate<cfloat16>(x);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/complex/generic/conjl.cpp b/libc/src/complex/generic/conjl.cpp
new file mode 100644
index 000000000000..8298ede6fa38
--- /dev/null
+++ b/libc/src/complex/generic/conjl.cpp
@@ -0,0 +1,19 @@
+//===-- Implementation of conjl function ----------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/complex/conjl.h"
+#include "src/__support/common.h"
+#include "src/__support/complex_type.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(_Complex long double, conjl, (_Complex long double x)) {
+ return conjugate<_Complex long double>(x);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/complex/generic/cproj.cpp b/libc/src/complex/generic/cproj.cpp
new file mode 100644
index 000000000000..d5e8c3ff3d9e
--- /dev/null
+++ b/libc/src/complex/generic/cproj.cpp
@@ -0,0 +1,19 @@
+//===-- Implementation of cproj function ----------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/complex/cproj.h"
+#include "src/__support/common.h"
+#include "src/__support/complex_type.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(_Complex double, cproj, (_Complex double x)) {
+ return project<_Complex double>(x);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/complex/generic/cprojf.cpp b/libc/src/complex/generic/cprojf.cpp
new file mode 100644
index 000000000000..d0235f6bfef7
--- /dev/null
+++ b/libc/src/complex/generic/cprojf.cpp
@@ -0,0 +1,19 @@
+//===-- Implementation of cprojf function ---------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/complex/cprojf.h"
+#include "src/__support/common.h"
+#include "src/__support/complex_type.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(_Complex float, cprojf, (_Complex float x)) {
+ return project<_Complex float>(x);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/complex/generic/cprojf128.cpp b/libc/src/complex/generic/cprojf128.cpp
new file mode 100644
index 000000000000..eb2cd08dfc11
--- /dev/null
+++ b/libc/src/complex/generic/cprojf128.cpp
@@ -0,0 +1,19 @@
+//===-- Implementation of cprojf128 function ------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/complex/cprojf128.h"
+#include "src/__support/common.h"
+#include "src/__support/complex_type.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(cfloat128, cprojf128, (cfloat128 x)) {
+ return project<cfloat128>(x);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/complex/generic/cprojf16.cpp b/libc/src/complex/generic/cprojf16.cpp
new file mode 100644
index 000000000000..8d2d64a439e0
--- /dev/null
+++ b/libc/src/complex/generic/cprojf16.cpp
@@ -0,0 +1,19 @@
+//===-- Implementation of cprojf16 function -------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/complex/cprojf16.h"
+#include "src/__support/common.h"
+#include "src/__support/complex_type.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(cfloat16, cprojf16, (cfloat16 x)) {
+ return project<cfloat16>(x);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/complex/generic/cprojl.cpp b/libc/src/complex/generic/cprojl.cpp
new file mode 100644
index 000000000000..34deeb63b16d
--- /dev/null
+++ b/libc/src/complex/generic/cprojl.cpp
@@ -0,0 +1,19 @@
+//===-- Implementation of cprojl function ---------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/complex/cprojl.h"
+#include "src/__support/common.h"
+#include "src/__support/complex_type.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(_Complex long double, cprojl, (_Complex long double x)) {
+ return project<_Complex long double>(x);
+}
+
+} // namespace LIBC_NAMESPACE_DECL
diff --git a/libc/src/complex/generic/crealf128.cpp b/libc/src/complex/generic/crealf128.cpp
index e72a77821601..e7554989e14a 100644
--- a/libc/src/complex/generic/crealf128.cpp
+++ b/libc/src/complex/generic/crealf128.cpp
@@ -7,8 +7,6 @@
//===----------------------------------------------------------------------===//
#include "src/complex/crealf128.h"
-#if defined(LIBC_TYPES_HAS_CFLOAT128)
-
#include "src/__support/CPP/bit.h"
#include "src/__support/common.h"
#include "src/__support/complex_type.h"
@@ -21,5 +19,3 @@ LLVM_LIBC_FUNCTION(float128, crealf128, (cfloat128 x)) {
}
} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_CFLOAT128
diff --git a/libc/src/complex/generic/crealf16.cpp b/libc/src/complex/generic/crealf16.cpp
index 35142071f053..c9e8626bfda9 100644
--- a/libc/src/complex/generic/crealf16.cpp
+++ b/libc/src/complex/generic/crealf16.cpp
@@ -7,8 +7,6 @@
//===----------------------------------------------------------------------===//
#include "src/complex/crealf16.h"
-#if defined(LIBC_TYPES_HAS_CFLOAT16)
-
#include "src/__support/CPP/bit.h"
#include "src/__support/common.h"
#include "src/__support/complex_type.h"
@@ -21,5 +19,3 @@ LLVM_LIBC_FUNCTION(float16, crealf16, (cfloat16 x)) {
}
} // namespace LIBC_NAMESPACE_DECL
-
-#endif // LIBC_TYPES_HAS_CFLOAT16