diff options
| author | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
|---|---|---|
| committer | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
| commit | 38500d63e14ce340236840f60d356cdefb56a52c (patch) | |
| tree | 17edbec446ce9b50d2f215a483b83afb293a635d /libc/src/complex | |
| parent | 1a3d5daaef7a6a63448a497da3eff7fc9e23df26 (diff) | |
| parent | 27f30029741ecf023baece7b3dde1ff9011ffefc (diff) | |
Merge branch 'main' into users/meinersbur/flang_runtime_split-headersusers/meinersbur/flang_runtime_split-headers
Diffstat (limited to 'libc/src/complex')
30 files changed, 542 insertions, 44 deletions
diff --git a/libc/src/complex/CMakeLists.txt b/libc/src/complex/CMakeLists.txt index 289cce5455af..bc66a5445d72 100644 --- a/libc/src/complex/CMakeLists.txt +++ b/libc/src/complex/CMakeLists.txt @@ -24,3 +24,15 @@ add_complex_entrypoint_object(cimagf) add_complex_entrypoint_object(cimagl) add_complex_entrypoint_object(cimagf16) add_complex_entrypoint_object(cimagf128) + +add_complex_entrypoint_object(conj) +add_complex_entrypoint_object(conjf) +add_complex_entrypoint_object(conjl) +add_complex_entrypoint_object(conjf16) +add_complex_entrypoint_object(conjf128) + +add_complex_entrypoint_object(cproj) +add_complex_entrypoint_object(cprojf) +add_complex_entrypoint_object(cprojl) +add_complex_entrypoint_object(cprojf16) +add_complex_entrypoint_object(cprojf128) diff --git a/libc/src/complex/cimagf128.h b/libc/src/complex/cimagf128.h index ab8f9ac7da58..aaf52cfc54ef 100644 --- a/libc/src/complex/cimagf128.h +++ b/libc/src/complex/cimagf128.h @@ -6,15 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" -#include "src/__support/macros/properties/types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT128) - #ifndef LLVM_LIBC_SRC_COMPLEX_CIMAGF128_H #define LLVM_LIBC_SRC_COMPLEX_CIMAGF128_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" +#include "src/__support/macros/properties/types.h" namespace LIBC_NAMESPACE_DECL { @@ -23,5 +20,3 @@ float128 cimagf128(cfloat128 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CIMAGF128_H - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/src/complex/cimagf16.h b/libc/src/complex/cimagf16.h index 5c5de2eb1bcf..81ed4d2ce567 100644 --- a/libc/src/complex/cimagf16.h +++ b/libc/src/complex/cimagf16.h @@ -6,15 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" -#include "src/__support/macros/properties/types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT16) - #ifndef LLVM_LIBC_SRC_COMPLEX_CIMAGF16_H #define LLVM_LIBC_SRC_COMPLEX_CIMAGF16_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" +#include "src/__support/macros/properties/types.h" namespace LIBC_NAMESPACE_DECL { @@ -23,5 +20,3 @@ float16 cimagf16(cfloat16 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CIMAGF16_H - -#endif // LIBC_TYPES_HAS_CFLOAT16 diff --git a/libc/src/complex/conj.h b/libc/src/complex/conj.h new file mode 100644 index 000000000000..2ff82d275862 --- /dev/null +++ b/libc/src/complex/conj.h @@ -0,0 +1,20 @@ +//===-- Implementation header for conj --------------------------*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC_COMPLEX_CONJ_H +#define LLVM_LIBC_SRC_COMPLEX_CONJ_H + +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { + +_Complex double conj(_Complex double x); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_COMPLEX_CONJ_H diff --git a/libc/src/complex/conjf.h b/libc/src/complex/conjf.h new file mode 100644 index 000000000000..6b3bd612e5bf --- /dev/null +++ b/libc/src/complex/conjf.h @@ -0,0 +1,20 @@ +//===-- Implementation header for conjf -------------------------*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC_COMPLEX_CONJF_H +#define LLVM_LIBC_SRC_COMPLEX_CONJF_H + +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { + +_Complex float conjf(_Complex float x); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_COMPLEX_CONJF_H diff --git a/libc/src/complex/conjf128.h b/libc/src/complex/conjf128.h new file mode 100644 index 000000000000..cae01d3f0069 --- /dev/null +++ b/libc/src/complex/conjf128.h @@ -0,0 +1,21 @@ +//===-- Implementation header for conjf128 ----------------------*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC_COMPLEX_CONJF128_H +#define LLVM_LIBC_SRC_COMPLEX_CONJF128_H + +#include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" + +namespace LIBC_NAMESPACE_DECL { + +cfloat128 conjf128(cfloat128 x); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_COMPLEX_CONJF128_H diff --git a/libc/src/complex/conjf16.h b/libc/src/complex/conjf16.h new file mode 100644 index 000000000000..dde1221473e4 --- /dev/null +++ b/libc/src/complex/conjf16.h @@ -0,0 +1,21 @@ +//===-- Implementation header for conjf16 -----------------------*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC_COMPLEX_CONJF16_H +#define LLVM_LIBC_SRC_COMPLEX_CONJF16_H + +#include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" + +namespace LIBC_NAMESPACE_DECL { + +cfloat16 conjf16(cfloat16 x); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_COMPLEX_CONJF16_H diff --git a/libc/src/complex/conjl.h b/libc/src/complex/conjl.h new file mode 100644 index 000000000000..aec640f9433a --- /dev/null +++ b/libc/src/complex/conjl.h @@ -0,0 +1,20 @@ +//===-- Implementation header for conjl -------------------------*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC_COMPLEX_CONJL_H +#define LLVM_LIBC_SRC_COMPLEX_CONJL_H + +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { + +_Complex long double conjl(_Complex long double x); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_COMPLEX_CONJL_H diff --git a/libc/src/complex/cproj.h b/libc/src/complex/cproj.h new file mode 100644 index 000000000000..62d41bceec3e --- /dev/null +++ b/libc/src/complex/cproj.h @@ -0,0 +1,20 @@ +//===-- Implementation header for cproj -------------------------*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC_COMPLEX_CPROJ_H +#define LLVM_LIBC_SRC_COMPLEX_CPROJ_H + +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { + +_Complex double cproj(_Complex double x); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_COMPLEX_CPROJ_H diff --git a/libc/src/complex/cprojf.h b/libc/src/complex/cprojf.h new file mode 100644 index 000000000000..76124f911777 --- /dev/null +++ b/libc/src/complex/cprojf.h @@ -0,0 +1,20 @@ +//===-- Implementation header for cprojf ------------------------*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC_COMPLEX_CPROJF_H +#define LLVM_LIBC_SRC_COMPLEX_CPROJF_H + +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { + +_Complex float cprojf(_Complex float x); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_COMPLEX_CPROJF_H diff --git a/libc/src/complex/cprojf128.h b/libc/src/complex/cprojf128.h new file mode 100644 index 000000000000..71c1bbec2218 --- /dev/null +++ b/libc/src/complex/cprojf128.h @@ -0,0 +1,21 @@ +//===-- Implementation header for cprojf128 ---------------------*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC_COMPLEX_CPROJF128_H +#define LLVM_LIBC_SRC_COMPLEX_CPROJF128_H + +#include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" + +namespace LIBC_NAMESPACE_DECL { + +cfloat128 cprojf128(cfloat128 x); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_COMPLEX_CPROJF128_H diff --git a/libc/src/complex/cprojf16.h b/libc/src/complex/cprojf16.h new file mode 100644 index 000000000000..f12a46df9e17 --- /dev/null +++ b/libc/src/complex/cprojf16.h @@ -0,0 +1,21 @@ +//===-- Implementation header for cprojf16 ----------------------*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC_COMPLEX_CPROJF16_H +#define LLVM_LIBC_SRC_COMPLEX_CPROJF16_H + +#include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" + +namespace LIBC_NAMESPACE_DECL { + +cfloat16 cprojf16(cfloat16 x); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_COMPLEX_CPROJF16_H diff --git a/libc/src/complex/cprojl.h b/libc/src/complex/cprojl.h new file mode 100644 index 000000000000..ecc8dce8f853 --- /dev/null +++ b/libc/src/complex/cprojl.h @@ -0,0 +1,20 @@ +//===-- Implementation header for cprojl ------------------------*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_LIBC_SRC_COMPLEX_CPROJL_H +#define LLVM_LIBC_SRC_COMPLEX_CPROJL_H + +#include "src/__support/macros/config.h" + +namespace LIBC_NAMESPACE_DECL { + +_Complex long double cprojl(_Complex long double x); + +} // namespace LIBC_NAMESPACE_DECL + +#endif // LLVM_LIBC_SRC_COMPLEX_CPROJL_H diff --git a/libc/src/complex/crealf128.h b/libc/src/complex/crealf128.h index 4922ae78cb23..b90c3e7c8548 100644 --- a/libc/src/complex/crealf128.h +++ b/libc/src/complex/crealf128.h @@ -6,15 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" -#include "src/__support/macros/properties/types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT128) - #ifndef LLVM_LIBC_SRC_COMPLEX_CREALF128_H #define LLVM_LIBC_SRC_COMPLEX_CREALF128_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" +#include "src/__support/macros/properties/types.h" namespace LIBC_NAMESPACE_DECL { @@ -23,5 +20,3 @@ float128 crealf128(cfloat128 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CREALF128_H - -#endif // LIBC_TYPES_HAS_CFLOAT128 diff --git a/libc/src/complex/crealf16.h b/libc/src/complex/crealf16.h index e6098a218d09..09d66649fa27 100644 --- a/libc/src/complex/crealf16.h +++ b/libc/src/complex/crealf16.h @@ -6,15 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "src/__support/macros/properties/complex_types.h" -#include "src/__support/macros/properties/types.h" - -#if defined(LIBC_TYPES_HAS_CFLOAT16) - #ifndef LLVM_LIBC_SRC_COMPLEX_CREALF16_H #define LLVM_LIBC_SRC_COMPLEX_CREALF16_H #include "src/__support/macros/config.h" +#include "src/__support/macros/properties/complex_types.h" +#include "src/__support/macros/properties/types.h" namespace LIBC_NAMESPACE_DECL { @@ -23,5 +20,3 @@ float16 crealf16(cfloat16 x); } // namespace LIBC_NAMESPACE_DECL #endif // LLVM_LIBC_SRC_COMPLEX_CREALF16_H - -#endif // LIBC_TYPES_HAS_CFLOAT16 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 |
