================
@@ -151,8 +159,31 @@ ArgInfo AArch64TargetInfo::classifyReturnType(const Type
*RetTy,
NPRN);
}
- reportNYI("Aggregate return type handling");
- return ArgInfo::getIgnore();
+ // Aggregates of at most 16 bytes are returned directly in registers or on
+ // the stack.
+ if (Size <= 128) {
+ if (Size <= 64 && !Opts.IsBigEndian) {
+ // A little-endian aggregate of at most 8 bytes is an integer of its
+ // exact width. A big-endian aggregate is widened to a multiple of 8
+ // bytes so that it occupies the high bits of the register.
----------------
madhur13490 wrote:
This comment talks about big-endian but sits inside the little-endian branch.
Clang's version also explains why BE has to widen (otherwise a composite looks
the same as a plain integer, which always lives in the low bits). It'd be nice
to keep that and move the comment above the if.
https://github.com/llvm/llvm-project/pull/230631
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits