asavonic added a comment.

In D100225#2681809 <https://reviews.llvm.org/D100225#2681809>, @rjmccall wrote:

> Why does the ABI "require" this to be returned as an i64 if some of the bits 
> are undefined?

AArch64 ABI requires return values (of composite types) to be rounded up to 64 
bits (see `AArch64ABIInfo::classifyReturnType`). I assume that if a value, say 
i16, is rounded up to i64, then the upper 48 bits can be arbitrary (undefined). 
I think this is aligned with the description of `CreateCoercedLoad`:

  /// CreateCoercedLoad - Create a load from \arg SrcPtr interpreted as
  /// a pointer to an object of type \arg Ty, known to be aligned to
  /// \arg SrcAlign bytes.
  ///
  /// This safely handles the case when the src type is smaller than the
  /// destination type; in this situation the values of bits which not
  /// present in the src are undefined.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100225/new/

https://reviews.llvm.org/D100225

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to