[flang-commits] [flang] [flang] AArch64 support for BIND(C) derived return types (PR #114051)

via flang-commits flang-commits at lists.llvm.org
Mon Nov 4 02:24:35 PST 2024


================
@@ -825,6 +825,51 @@ struct TargetAArch64 : public GenericTarget<TargetAArch64> {
     }
     return marshal;
   }
+
+  // Determine if the type is a Homogenous Floating-point Aggregate (HFA). An
+  // HFA is a record type with up to 4 floating-point members of the same type.
+  static bool isHFA(fir::RecordType ty) {
+    auto types = ty.getTypeList();
+    if (types.empty() || types.size() > 4) {
+      return false;
+    }
+
+    if (!isa_real(types.front().second)) {
+      return false;
+    }
----------------
jeanPerier wrote:

Derived types containing small fp arrays will be rejected here, is the following C struct an HFA? :

```
typedef struct {
    float x[2];
    float y;
} S;
```

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


More information about the flang-commits mailing list