[PATCH] D60349: [COFF, ARM64] Fix ABI implementation of struct returns
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 23 16:17:54 PDT 2019
efriedma added a comment.
It looks like there's some missing documentation in the ARM64 ABI document involving homogeneous aggregates... in particular, it looks like non-POD types are never homogeneous, or something along those lines. I guess we can address that in a followup, though.
@TomTan could you look into updating the ARM64 ABI documentation?
Testcase:
struct Pod {
double b[2];
};
struct NotAggregate {
NotAggregate();
double b[2];
};
struct NotPod {
NotAggregate x;
};
Pod copy(Pod *x) { return *x; } // ldp d0,d1,[x0]
NotAggregate copy(NotAggregate *x) { return *x; } // stp x8,x9,[x0]
NotPod copy(NotPod *x) { return *x; } // ldp x0,x1,[x8]
================
Comment at: lib/Sema/SemaDeclCXX.cpp:5956
+ bool isAArch64 = S.Context.getTargetInfo().getTriple().isAArch64();
+ if (!isAArch64 && CopyCtorIsTrivial &&
S.getASTContext().getTypeSize(D->getTypeForDecl()) <= 64)
----------------
just did some quick tests; I think this rule does in fact apply to AArch64, except that the limit is 128 bits, instead of 64 bits.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60349/new/
https://reviews.llvm.org/D60349
More information about the cfe-commits
mailing list