[llvm] [flang][rt] Attempt to support some complex pow on the device (PR #135741)

Slava Zakharin via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 15 15:47:58 PDT 2025


================
@@ -65,21 +66,23 @@ template <typename C, typename I> C tgpowi(C base, I exp) {
 #ifndef _MSC_VER
 // With most compilers, C complex is implemented as a builtin type that may have
 // specific ABI requirements
-extern "C" float _Complex RTNAME(cpowi)(float _Complex base, std::int32_t exp) {
+extern "C" RT_API_ATTRS CppTypeFor<TypeCategory::Complex, 4> RTNAME(cpowi)(
+    CppTypeFor<TypeCategory::Complex, 4> base, std::int32_t exp) {
----------------
vzakhari wrote:

Note that the other APIs are passing args as references/pointers, and the memory layout is assumed to be the same for C and C++ complex.  The problem (or not) is passing it by value.

https://github.com/llvm/llvm-project/pull/135741


More information about the llvm-commits mailing list