[libc-commits] [libc] [libc][complex] Implement different flavors of the `cproj` function (PR #119722)
via libc-commits
libc-commits at lists.llvm.org
Mon Dec 16 07:42:10 PST 2024
================
@@ -0,0 +1,29 @@
+//===-- 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/CPP/bit.h"
+#include "src/__support/FPUtil/BasicOperations.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)) {
+ Complex<double> x_c = cpp::bit_cast<Complex<double>>(x);
----------------
lntue wrote:
refactor it to a template function.
https://github.com/llvm/llvm-project/pull/119722
More information about the libc-commits
mailing list