[flang-commits] [flang] [flang] AArch64 support for BIND(C) derived return types (PR #114051)
David Truby via flang-commits
flang-commits at lists.llvm.org
Wed Nov 6 07:39:40 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;
+ }
----------------
DavidTruby wrote:
Ah. It is, yes. As is:
```
typedef struct {
float x;
float y;
} S1;
typedef struct {
S1 s;
float z;
} S2;
```
Good spot.
https://github.com/llvm/llvm-project/pull/114051
More information about the flang-commits
mailing list